/* 수면 계산기 */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --indigo: #4f46e5;
  --indigo2: #4338ca;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif; font-size: 14px; }

.wrap { max-width: 100%; padding: 0 0 60px; }

/* ── 헤더 ── */
.top { padding: 20px 0 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 48px; height: 48px; flex-shrink: 0;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 22px;
}
h1 { font-size: 22px; font-weight: 700; }
.sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── 카드 ── */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; }

/* ── 모드 탭 ── */
.mode-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.mode-tab {
  flex: 1; padding: 10px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--bg);
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted);
  transition: all .12s; text-align: center;
}
.mode-tab.active { background: var(--indigo); border-color: var(--indigo); color: #fff; }

/* ── 시간 입력 ── */
.time-input-wrap { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.time-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.time-input {
  padding: 14px 20px; font-size: 32px; font-weight: 700;
  border: 2px solid var(--line); border-radius: 12px;
  outline: none; text-align: center; color: var(--indigo);
  transition: border-color .12s; font-family: 'JetBrains Mono', monospace;
  width: 100%; max-width: 280px;
}
.time-input:focus { border-color: var(--indigo); }

.btn-calc {
  margin-top: 16px; width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--indigo), #7c3aed);
  color: #fff; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer; transition: opacity .12s;
}
.btn-calc:hover { opacity: .9; }

/* ── 결과 ── */
.result-section { display: none; }
.result-section.show { display: block; }
.result-desc { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.6; }
.cycle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.cycle-card {
  background: #f1f0ff; border: 1.5px solid #c7d2fe;
  border-radius: 10px; padding: 14px 16px; text-align: center;
  cursor: pointer; transition: all .12s;
}
.cycle-card:hover { border-color: var(--indigo); background: #e0e7ff; }
.cycle-card.best { border-color: var(--indigo); background: var(--indigo); color: #fff; }
.cycle-card.best .cc-label, .cycle-card.best .cc-cycles { color: rgba(255,255,255,.8); }
.cc-time { font-size: 22px; font-weight: 800; }
.cc-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cc-cycles { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── 수면 팁 ── */
.tip-box {
  margin-top: 12px; padding: 12px 16px;
  background: #eef2ff; border: 1px solid #c7d2fe;
  border-radius: 10px; font-size: 12px; color: #3730a3; line-height: 1.6;
}

/* ── 사용 안내 섹션 공통 ── */
.guide-section {
  margin-top: 24px; background: rgba(246,248,255,.6);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.guide-section h2 { font-size: 15px; font-weight: 800; margin: 0 0 10px; color: var(--ink); }
.guide-section h2:not(:first-child) { margin-top: 18px; }
.guide-steps, .guide-features, .guide-usecase {
  margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.8;
}
.guide-steps li, .guide-features li, .guide-usecase li { margin-bottom: 4px; }
.guide-steps strong, .guide-features strong { color: var(--ink); }
.guide-privacy {
  margin-top: 16px; background: #eff6ff; border: 1px solid rgba(37,99,235,.22);
  border-radius: 12px; padding: 12px 14px; font-size: 12px; color: #1e40af; line-height: 1.55;
}
