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

body {
  font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
  font-size: 14px;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

.page-wrapper {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
  max-width: 1280px;
}

.ad-slot {
  width: 300px;
  min-width: 300px;
  height: 600px;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 13px;
  position: sticky;
  top: 32px;
  margin-top: 45px;
}

@media (max-width: 1000px) { .ad-slot.ad-left  { display: none; } }
@media (max-width: 1280px) { .ad-slot.ad-right { display: none; } }

.container {
  width: 100%;
  max-width: 640px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1 { font-size: 22px; font-weight: 700; color: #1a1a1a; }
h1 span { color: #0078d4; }

/* 탭 */
.tabs {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  gap: 0;
}
.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: #0078d4; }
.tab-btn.active { color: #0078d4; border-bottom-color: #0078d4; }

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
}

.section { display: none; }
.section.active { display: block; }

/* 입력 폼 */
.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.form-row label {
  width: 90px;
  flex-shrink: 0;
  font-size: 13px;
  color: #555;
}
.form-row input[type=date],
.form-row input[type=number] {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.form-row input:focus { border-color: #0078d4; }

.form-row select {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fff;
  cursor: pointer;
}

/* 계산 버튼 */
.btn-calc {
  width: 100%;
  padding: 11px;
  background: #0078d4;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}
.btn-calc:hover { background: #005fa3; }

/* 결과 */
.result-box {
  display: none;
  margin-top: 16px;
  background: #f0f6ff;
  border: 1px solid #c5ddf9;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}
.result-box.show { display: block; }

.result-main {
  font-size: 42px;
  font-weight: 700;
  color: #0078d4;
  font-family: 'Consolas', monospace;
  line-height: 1.2;
}
.result-unit {
  font-size: 16px;
  color: #5a9fd4;
  margin-left: 4px;
}
.result-sub {
  margin-top: 10px;
  font-size: 13px;
  color: #666;
  line-height: 1.8;
}
.result-sub span {
  display: inline-block;
  background: #fff;
  border: 1px solid #d0e1fb;
  border-radius: 4px;
  padding: 2px 10px;
  margin: 2px 4px;
  font-weight: 600;
  color: #0078d4;
}
