* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #eef2f7;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  padding: 1rem;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.calculator {
  max-width: 1100px;
  width: 100%;
  background: white;
  border-radius: 1.75rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  overflow: visible;
}

.calc-header {
  background: #1a4c61;
  padding: 0.8rem 1.5rem;
  color: white;
}
.calc-header h1 {
  font-size: 1.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.calc-header p {
  font-size: 0.8rem;
  opacity: 0.9;
  margin-top: 0.2rem;
}

.three-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem 0.5rem 1.5rem;
}
.col {
  flex: 1;
  min-width: 200px;
  background: #fafcff;
  border-radius: 1rem;
  padding: 0.7rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2c6e8f;
  border-left: 3px solid #2c7da0;
  padding-left: 0.6rem;
  margin-bottom: 0.7rem;
}
.field-row {
  margin-bottom: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.field-row label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #2c5a74;
  display: flex;
  justify-content: space-between;
}
.field-row input {
  width: 100%;
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  border: 1px solid #d4e2ec;
  border-radius: 0.8rem;
  font-family: monospace;
  background: white;
}
.banked-preview {
  background: #eef3f8;
  border-radius: 0.8rem;
  padding: 0.45rem 0.7rem;
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f6683;
  text-align: center;
}
.auto-hint {
  background: #eef3fa;
  border-radius: 0.7rem;
  padding: 0.3rem 0.5rem;
  margin: 0.5rem 0 0.3rem 0;
  font-size: 0.7rem;
  color: #2c6e8f;
  text-align: center;
}
.info-hint {
  font-size: 0.65rem;
  color: #7a621f;
  margin-top: 0.3rem;
  text-align: center;
}

.result-area {
  background: #f5f9fe;
  margin: 0 1.5rem 1rem 1.5rem;
  border-radius: 1rem;
  padding: 0.8rem 1rem;
}
.result-header {
  font-weight: 700;
  font-size: 0.8rem;
  color: #125072;
  border-bottom: 1px solid #d7e5f0;
  padding-bottom: 0.4rem;
  margin-bottom: 0.5rem;
}
.result-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.result-item {
  flex: 1;
  background: #ffffffcc;
  border-radius: 0.8rem;
  padding: 0.2rem 0.5rem;
  text-align: center;
}
.result-label-sm {
  font-size: 0.65rem;
  color: #4b6e88;
}
.result-number {
  font-weight: 800;
  font-size: 0.9rem;
  font-family: monospace;
}
.total-box {
  background: #e2f0f7;
  border-radius: 1rem;
  padding: 0.6rem 1rem;
  margin: 0.4rem 0 0.6rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.total-label-big {
  font-weight: 800;
  font-size: 0.9rem;
  color: #004070;
}
.total-numbers {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.total-number-big {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0a6b8c;
  font-family: monospace;
}
.total-unit {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0a6b8c;
}
.total-separator {
  font-size: 1.2rem;
  color: #7f9eb5;
  margin: 0 0.2rem;
}
.total-number-days {
  font-size: 1rem;
  font-weight: 700;
  color: #2c6e8f;
  background: #ffffffaa;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
}
.calculation-steps {
  margin-top: 0.2rem;
}
.steps-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #125072;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.steps-title::before {
  content: "📐";
  font-size: 0.8rem;
}
.explanation-text {
  font-size: 0.8rem;
  background: #ecf3f8;
  border-radius: 0.8rem;
  padding: 0.6rem 0.8rem;
  line-height: 1.45;
  color: #1f4e6e;
  overflow: visible;
}
.explanation-text strong {
  color: #0a5c7e;
}
.footer-note {
  background: #f0f4f9;
  padding: 0.6rem 1.5rem;
  font-size: 0.7rem;
  color: #446d88;
  border-top: 1px solid #e2eaf0;
  line-height: 1.3;
}

@media (max-width: 750px) {
  body { padding: 0.5rem; }
  .three-columns { flex-direction: column; gap: 0.8rem; padding: 0.8rem; }
  .result-area { margin: 0 0.8rem 0.8rem 0.8rem; }
  .total-number-big { font-size: 1.3rem; }
  .total-number-days { font-size: 0.85rem; }
}
