/* ==========================================================
   홍씨스터 공통 스타일 — 모든 과목 공유
   - 밤(night) = 기본 / 낮(day) = html[data-theme="light"]
   - 과목별 강조색은 body[data-subject] 에서 --accent 로 바꿔 사용
   ========================================================== */
:root {
  --bg: #0e0d0c;
  --bg-2: #151311;
  --surface: #1c1916;
  --surface-2: #242019;
  --line: #2f2a23;
  --hover: #2d2820;
  --text: #f4eee5;
  --muted: #a89e90;
  --faint: #6e665b;
  --accent: #f2a65a;       /* 강조색 (기타: 앰버) */
  --accent-ink: #1a1208;
  --accent-soft: rgba(242, 166, 90, .14);
  --label: #ffc107;        /* 질문 제목: 진한 노란색 */
  --good: #6fcf97;
  --good-soft: rgba(111, 207, 151, .14);
  --warn: #f2c94c;
  --warn-soft: rgba(242, 201, 76, .14);
  --bad: #eb6f5f;
  --bad-soft: rgba(235, 111, 95, .14);
  --top-bg: rgba(14, 13, 12, .82);
  --nav-bg: rgba(21, 19, 17, .96);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: dark;
}

/* ---------- 낮 모드 ---------- */
html[data-theme="light"] {
  --bg: #faf6ef;
  --bg-2: #f3ede3;
  --surface: #ffffff;
  --surface-2: #f7f1e8;
  --line: #e7dccb;
  --hover: #efe6d8;
  --text: #221c15;
  --muted: #6d6356;
  --faint: #a2978a;
  --accent: #e8862b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(232, 134, 43, .13);
  --label: #d99100;
  --good: #1f9d57;
  --good-soft: rgba(31, 157, 87, .12);
  --warn: #b98900;
  --warn-soft: rgba(217, 145, 0, .13);
  --bad: #d64533;
  --bad-soft: rgba(214, 69, 51, .11);
  --top-bg: rgba(250, 246, 239, .86);
  --nav-bg: rgba(255, 255, 255, .97);
  --shadow: 0 10px 30px rgba(80, 60, 30, .12);
  color-scheme: light;
}

body[data-subject="piano"]   { --accent: #8fb8ff; --accent-soft: rgba(143,184,255,.14); }
body[data-subject="english"] { --accent: #7fd6c2; --accent-soft: rgba(127,214,194,.14); }
body[data-subject="camping"] { --accent: #a3d977; --accent-soft: rgba(163,217,119,.14); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, var(--accent-soft), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ---------- 상단바 ---------- */
.hs-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: 60px; padding: 0 20px;
  background: var(--top-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.hs-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.hs-brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: 16px;
}
.hs-brand-name { font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.hs-brand-sub { color: var(--muted); font-size: 13px; padding-left: 10px; border-left: 1px solid var(--line); }
.hs-top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.hs-top-right a { text-decoration: none; }
.hs-top-right a:hover { color: var(--text); }

/* ---------- 낮/밤 전환 버튼 ---------- */
.hs-theme-btn {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer;
}
.hs-theme-btn span { width: 30px; height: 26px; border-radius: 999px; display: grid; place-items: center; color: var(--faint); transition: all .2s ease; }
.hs-theme-btn svg { width: 16px; height: 16px; }
html:not([data-theme="light"]) .hs-theme-btn .t-moon,
html[data-theme="light"] .hs-theme-btn .t-sun { background: var(--accent); color: var(--accent-ink); }

/* ---------- 레이아웃 ---------- */
.hs-shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 60px); }
.hs-nav { padding: 20px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.hs-nav button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 14px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted); text-align: left; cursor: pointer; font-size: 15px;
}
.hs-nav button:hover { background: var(--surface); color: var(--text); }
.hs-nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.hs-nav .ico { width: 22px; text-align: center; }
.hs-main { padding: 28px clamp(16px, 4vw, 48px) 80px; max-width: 1080px; width: 100%; }

@media (max-width: 820px) {
  .hs-shell { grid-template-columns: 1fr; }
  .hs-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    flex-direction: row; justify-content: space-around;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--nav-bg); border-right: 0; border-top: 1px solid var(--line);
  }
  .hs-nav button { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; text-align: center; justify-content: center; }
  .hs-nav .ico { font-size: 18px; }
  .hs-brand-sub { display: none; }
  .hs-main { padding-bottom: 110px; }
  .hs-top { padding: 0 12px; gap: 8px; }
  .hs-top-right { gap: 8px; font-size: 13px; }
}

/* ---------- 코치 말풍선 ---------- */
.hs-coach {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px; margin-bottom: 24px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.hs-coach-avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.hs-coach-name { font-size: 12px; color: var(--accent); font-weight: 700; margin-bottom: 2px; }
.hs-coach-text { font-size: 15.5px; }
.hs-coach.pulse .hs-coach-avatar { animation: hsPulse 1.2s ease-out; }
@keyframes hsPulse { 0% { box-shadow: 0 0 0 0 var(--accent); } 100% { box-shadow: 0 0 0 14px transparent; } }

/* ---------- 공통 컴포넌트 ---------- */
h1.hs-title { font-size: clamp(22px, 3vw, 30px); letter-spacing: -.03em; margin: 0 0 6px; }
p.hs-lead { color: var(--muted); margin: 0 0 22px; }
.hs-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.hs-card + .hs-card { margin-top: 16px; }
.hs-card h3 { margin: 0 0 12px; font-size: 16px; }
.hs-grid { display: grid; gap: 16px; }
.hs-grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.hs-grid.three { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.hs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 15px; text-decoration: none; color: var(--text);
  transition: transform .08s ease, background .15s ease;
}
.hs-btn:hover { background: var(--hover); }
.hs-btn:active { transform: scale(.97); }
.hs-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.hs-btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.hs-btn.ghost { background: transparent; }
.hs-btn.small { padding: 7px 14px; font-size: 13.5px; }
.hs-btn.block { width: 100%; }
.hs-btn:disabled { opacity: .45; cursor: not-allowed; }
.hs-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hs-row.end { justify-content: flex-end; }
.hs-spacer { flex: 1; }

.hs-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; font-size: 14.5px; user-select: none;
}
.hs-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.hs-chip small { color: var(--faint); font-weight: 400; }

.hs-option {
  display: block; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer;
}
.hs-option + .hs-option { margin-top: 8px; }
.hs-option.on { border-color: var(--accent); background: var(--accent-soft); }
.hs-option b { display: block; }
.hs-option span { color: var(--muted); font-size: 13.5px; }

.hs-input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit;
}
.hs-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hs-label { display: block; font-weight: 800; font-size: 16px; color: var(--label); margin: 22px 0 10px; }
.hs-label:first-child { margin-top: 0; }
.hs-help { color: var(--muted); font-size: 13.5px; margin: -2px 0 10px; }

.hs-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.hs-tag.good { background: var(--good-soft); color: var(--good); }
.hs-tag.warn { background: var(--warn-soft); color: var(--warn); }
.hs-tag.bad  { background: var(--bad-soft);  color: var(--bad); }
.hs-tag.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- 상담(온보딩) ---------- */
.hs-steps { display: flex; gap: 6px; margin-bottom: 22px; }
.hs-steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.hs-steps i.done { background: var(--accent); }
.hs-step-count { color: var(--accent); font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.hs-onb-foot { display: flex; gap: 10px; margin-top: 26px; }

/* ---------- 미터/게이지 ---------- */
.hs-meter { height: 10px; border-radius: 10px; background: var(--bg-2); overflow: hidden; border: 1px solid var(--line); }
.hs-meter > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .12s linear; border-radius: 10px; }
.hs-meter.good > i { background: var(--good); }

.hs-big { font-size: clamp(44px, 8vw, 84px); font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.hs-muted { color: var(--muted); }
.hs-center { text-align: center; }
.hs-hidden { display: none !important; }

.hs-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--surface-2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 999px;
  box-shadow: var(--shadow); opacity: 0; transition: all .25s ease; z-index: 50; font-size: 14px;
}
.hs-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 820px) { .hs-toast { bottom: 96px; } }
