/* 밤의 지도첩 테마 — 랜딩과 같은 분위기를 앱·약관에도 입힌다 (10-23).
   style.css 토큰을 body.night 에서 덮어쓴다. 강조색은 금색 하나, 카드 16px, 버튼은 알약. */
body.night {
  --bg: #0b0e1a; --surface: #131830; --surface-2: #1a2040; --ink: #eceaf4; --sub: #b3b2c6; --faint: #9a99b3;
  --line: rgb(236 234 244 / .13); --gold: #e2b356; --gold-ink: #1a1405;
  --accent: var(--gold); --accent-ink: var(--gold-ink); --accent-soft: rgb(226 179 86 / .14); --star: var(--gold);
  --ok: #7fd3a2; --lock: #6d6c86; --err: #ffab8f;
  --radius: 12px; --r: 16px; --shadow: 0 18px 48px rgb(4 6 18 / .45);
  background: var(--bg); color: var(--ink); color-scheme: dark;
}
.night .disp, .night h1, .night .vhead h1, .night .workhead h1, .night .doc h2, .night .qcard h2 {
  font-family: "Hahmlet", "Pretendard Variable", serif; letter-spacing: -.02em; }
.night a { color: var(--gold); }

/* 별하늘 */
.night .sky { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 18%, rgb(255 255 255 / .6), transparent 60%),
    radial-gradient(1px 1px at 68% 9%, rgb(255 255 255 / .5), transparent 60%),
    radial-gradient(1px 1px at 84% 34%, rgb(255 255 255 / .55), transparent 60%),
    radial-gradient(1px 1px at 31% 62%, rgb(255 255 255 / .35), transparent 60%),
    radial-gradient(1px 1px at 7% 83%, rgb(255 255 255 / .4), transparent 60%),
    radial-gradient(1px 1px at 92% 76%, rgb(255 255 255 / .4), transparent 60%),
    radial-gradient(1px 1px at 44% 23%, rgb(255 255 255 / .5), transparent 60%),
    radial-gradient(1px 1px at 76% 52%, rgb(255 255 255 / .45), transparent 60%),
    linear-gradient(180deg, #0e1430 0%, var(--bg) 55%); }

/* 머리줄 */
.night .nav { background: rgb(11 14 26 / .78); border-bottom-color: var(--line); }
.night .nav .wrap { height: 64px; }
.night .brand { color: var(--ink); display: flex; align-items: center; gap: 10px; font-family: "Hahmlet", serif; }
.night .brand i { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--gold); position: relative; flex: none; }
.night .brand i::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--gold); }
.night .nav nav a, .night .nav nav button { border-radius: 999px; color: var(--sub); }
.night .nav nav a:hover, .night .nav nav button:hover { background: var(--surface); color: var(--ink); }
.night .nav nav .on { background: var(--accent-soft); color: var(--gold); }

/* 버튼 */
.night .btn { border-radius: 999px; padding: 11px 22px; }
.night .btn.small { padding: 7px 14px; }
.night .btn.primary { background: var(--gold); color: var(--gold-ink); }
.night .btn.ghost { background: transparent; color: var(--ink); border-color: rgb(236 234 244 / .26); }
.night .btn.ghost:hover { border-color: var(--gold); color: var(--gold); }

/* 카드·입력 */
.night .panel { background: rgb(19 24 48 / .86); border-color: var(--line); border-radius: var(--r); backdrop-filter: blur(6px); }
.night input, .night textarea, .night select { color: var(--ink); }
.night .form input:not([type]), .night .form input[type=text], .night .qcard textarea, .night .qcard .var input, .night .chhead input {
  background: rgb(8 10 22 / .55); border-color: rgb(236 234 244 / .16); }
.night .form input:focus, .night .qcard textarea:focus, .night .qcard .var input:focus, .night .chhead input:focus {
  outline: none; border-color: var(--gold); }
.night .qcard textarea { min-height: 160px; font-size: 16px; }
.night .err { color: var(--err); }
.night .pills span { background: transparent; border-color: rgb(236 234 244 / .22); }
.night .pills label:hover span { border-color: var(--gold); }
.night .tabs { background: rgb(8 10 22 / .5); border-radius: 999px; }
.night .tabs button { border-radius: 999px; }
.night .tabs .on { background: var(--gold); color: var(--gold-ink); }
.night .ex > div { background: rgb(255 255 255 / .04); }
.night .side button.cur { background: var(--accent-soft); color: var(--ink); }
.night .side button.done .d { color: var(--gold); }
.night .doc h3 { border-bottom-color: rgb(226 179 86 / .5); }
.night .foot { border-top: 1px solid var(--line); margin-top: 24px; }

/* 진행 막대: 질문 카드 위 */
.qprog { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 14px; color: var(--sub); }
.qprog .track { flex: 1; height: 6px; border-radius: 6px; background: rgb(236 234 244 / .1); overflow: hidden; }
.qprog .track i { display: block; height: 100%; border-radius: 6px; background: var(--gold); transition: width .5s cubic-bezier(.16, 1, .3, 1); }
.qprog b { color: var(--gold); font-weight: 800; }
.qnav .kbd { font-size: 13px; color: var(--faint); }
.qnav .kbd kbd { font: inherit; padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; }
.qcard.answered { border-color: rgb(226 179 86 / .45); }

/* 처음 화면: 세 갈래 */
.start { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; }
.start .go { text-align: left; padding: 28px 24px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; color: var(--ink);
  font: inherit; min-height: 210px; justify-content: flex-end; transition: transform .2s ease, border-color .2s ease; position: relative; overflow: hidden; }
.start .go:hover { transform: translateY(-3px); border-color: var(--gold); }
.start .go .k { color: var(--gold); font-weight: 700; font-size: 13px; }
.start .go b { font-family: "Hahmlet", serif; font-size: 24px; line-height: 1.3; }
.start .go span.d { color: var(--sub); font-size: 15px; }
.start .go.main { background: linear-gradient(200deg, #2a2240 0%, #171433 60%, #10132a 100%); }
.start .go .ring { position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; border: 1px solid rgb(226 179 86 / .35); }
.start .go .ring::after { content: ""; position: absolute; inset: 30px; border-radius: 50%; border: 1px dashed rgb(236 234 244 / .2); }
.hello { margin: 0 0 18px; color: var(--sub); }

/* 목록 카드 */
.night .witem { padding: 20px 22px; }
.night .witem h2 { font-family: "Hahmlet", serif; font-size: 20px; }
.night .witem .bar { height: 6px; background: rgb(236 234 244 / .1); }
.night .witem .bar i { background: var(--gold); }

/* 알림 (중간 지점 축하) */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; z-index: 30;
  background: var(--surface-2); color: var(--ink); border: 1px solid rgb(226 179 86 / .5); border-radius: 999px;
  padding: 12px 22px; font-weight: 700; box-shadow: var(--shadow); transition: opacity .3s ease, transform .3s ease; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.sidetog { display: none; }
@media (max-width: 860px) {
  .sidetog { display: inline-flex; margin-bottom: 10px; }
  .night .side { display: none; }
  .night .side.open { display: block; }
  .start { grid-template-columns: 1fr; }
  .start .go { min-height: 150px; }
  .qnav .kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .start .go, .qprog .track i, .toast { transition: none; }
}
@media print {
  body.night { --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #111; --sub: #444; --faint: #595959; --line: #ddd; --gold: #7a5c16; --gold-ink: #fff; background: #fff; }
  .night .sky, .toast, .qprog, .sidetog { display: none !important; }
  .night .panel { backdrop-filter: none; background: #fff; }
}
