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

body {
  font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: #f8f9fa;
  color: #222;
  line-height: 1.6;
}

/* 광고 영역 */
.ad-wrap { width: 100%; max-width: 728px; margin: 12px auto; text-align: center; min-height: 90px; background: #f0f0f0; }
.ad-top { max-width: 100%; }

header {
  background: linear-gradient(135deg, #1a237e, #283593);
  color: #fff;
  text-align: center;
  padding: 28px 16px 20px;
}
header h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 700; }
.subtitle { font-size: 0.9rem; opacity: 0.85; margin-top: 6px; }

/* 3컬럼 레이아웃 */
.layout { display: flex; gap: 0; align-items: flex-start; }
.side-ad { width: 160px; min-width: 160px; position: sticky; top: 8px; padding: 8px; }
.side-ad ins { display: block; min-height: 600px; }
main { flex: 1; max-width: 720px; margin: 0 auto; padding: 16px; min-width: 0; }

@media (max-width: 1100px) { .side-ad { width: 120px; min-width: 120px; } }
@media (max-width: 900px) { .side-ad { display: none; } }

/* 오늘의 음력 카드 */
.today-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  text-align: center;
}
.today-card h2 { font-size: 1rem; color: #666; margin-bottom: 10px; }
.today-info { font-size: clamp(1.1rem, 3vw, 1.4rem); font-weight: 600; color: #1a237e; }

/* 변환기 */
.converter {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  margin-bottom: 16px;
}

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1;
  padding: 10px;
  border: 2px solid #1a237e;
  border-radius: 8px;
  background: #fff;
  color: #1a237e;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.tab.active { background: #1a237e; color: #fff; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.input-row select, .input-row input[type="number"] {
  flex: 1;
  min-width: 90px;
  padding: 12px 8px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  font-size: 1.05rem;
  text-align: center;
  background: #fff;
  cursor: pointer;
}
.input-row select:focus, .input-row input[type="number"]:focus { outline: none; border-color: #1a237e; }
.input-row button {
  padding: 10px 20px;
  background: #1a237e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.input-row button:hover { background: #283593; }

.leap-label { display: flex; align-items: center; gap: 4px; font-size: 0.9rem; white-space: nowrap; cursor: pointer; }

.result {
  margin-top: 14px;
  padding: 14px;
  background: #e8eaf6;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a237e;
  min-height: 48px;
  text-align: center;
}
/* 캘린더 */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-selects { display: flex; gap: 8px; margin-bottom: 12px; }
.cal-selects select { flex: 1; padding: 8px 32px 8px 8px; border: 1.5px solid #ccc; border-radius: 8px; font-size: 1rem; cursor: pointer; text-align: center; text-align-last: center; appearance: none; -webkit-appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a237e' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat center right 10px; }
.cal-selects select:focus { outline: none; border-color: #1a237e; }
.cal-nav button { background: none; border: 1.5px solid #1a237e; border-radius: 6px; color: #1a237e; font-size: 1.4rem; width: 36px; height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.cal-nav button:hover { background: #e8eaf6; }
#cal-title { font-size: 1.1rem; font-weight: 700; color: #1a237e; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 12px; }
.cal-grid .day-header { text-align: center; font-size: 0.78rem; font-weight: 700; padding: 4px 0; color: #666; }
.cal-grid .day { text-align: center; padding: 6px 2px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.cal-grid .day:hover { background: #e8eaf6; }
.cal-grid .day.selected { background: #1a237e; color: #fff; }
.cal-grid .day.today { font-weight: 700; border: 2px solid #1a237e; }
.cal-grid .day.empty { cursor: default; pointer-events: none; }
.cal-grid .day .solar { font-size: 0.95rem; }
.cal-grid .day .lunar { font-size: 0.68rem; color: #888; margin-top: 1px; }
.cal-grid .day.selected .lunar, .cal-grid .day.selected .solar { color: #fff !important; }

/* FAQ */
.faq { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.08); margin-bottom: 16px; }
.faq h2 { font-size: 1.1rem; margin-bottom: 12px; color: #1a237e; }
details { border-bottom: 1px solid #eee; padding: 10px 0; }
details:last-child { border-bottom: none; }
summary { font-weight: 600; cursor: pointer; font-size: 0.95rem; list-style: none; display: flex; justify-content: space-between; }
summary::after { content: '+'; font-size: 1.2rem; color: #1a237e; }
details[open] summary::after { content: '−'; }
details p { margin-top: 8px; font-size: 0.9rem; color: #444; line-height: 1.7; }

footer {
  text-align: center;
  padding: 20px 16px;
  font-size: 0.82rem;
  color: #888;
  border-top: 1px solid #e0e0e0;
}
footer a { color: #1a237e; text-decoration: none; }
.footer-desc { margin-top: 4px; font-size: 0.78rem; }

@media (max-width: 480px) {
  .input-row input[type="number"] { min-width: 60px; }
  .input-row button { width: 100%; }
}
