/* 아하브 숙면 (밤에 쓰는 앱이라 늘 어두운 화면) */
:root, :root[data-theme="dark"] {
  --bg: #0D0E24; --surface: #16183A; --sunk: #1F2250; --ink: #ECEBFF; --muted: #A9A6D6; --line: #2A2D63;
  --accent: #A59BFF; --accent-2: #7C6FF0; --accent-ink: #120F33; --accent-soft: #2C2870;
  --in: #7FB4FF; --out: #FF8A7A; --gold: #FFE08A; --ok: #5ED3A6; --bad: #FF8A80; --new: #FFB45C; --hl: #2A2748;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
  --hero: radial-gradient(120% 120% at 100% 0%, #6A5FD9 0%, transparent 55%), radial-gradient(60% 60% at 0% 100%, #2B6CB0 0%, transparent 60%), linear-gradient(160deg, #0B0C2A 0%, #2B2580 100%);
  --hero-shadow: 0 12px 32px rgba(40,30,140,.45); --hero-ink: #2B2580;
  --font-ui: "Pretendard", "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; --radius: 18px;
}
body { background: radial-gradient(100% 60% at 50% 0%, #1A1B46 0%, var(--bg) 70%) fixed, var(--bg); }
.tip b { color: var(--gold); }
.stars { position: relative; }
.snd { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 560px) { .snd { grid-template-columns: repeat(4, 1fr); } }
.snd button { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; color: var(--ink); transition: background .2s, border-color .2s; }
.snd button span { font-size: 28px; line-height: 1.1; }
.snd button small { font-size: 11px; color: var(--muted); font-weight: 500; }
.snd button.on { border-color: var(--accent); background: linear-gradient(160deg, #3A3390, #221E66); box-shadow: 0 0 0 3px rgba(165,155,255,.18); }
.snd button .lk { position: absolute; top: 6px; right: 8px; font-size: 11px; }
.snd button.on::after { content: ""; position: absolute; bottom: 6px; width: 18px; height: 3px; border-radius: 2px; background: var(--accent); animation: pl 1.2s ease-in-out infinite; }
@keyframes pl { 50% { opacity: .3; width: 28px; } }
.mix { display: grid; gap: 10px; }
.mix .row { display: grid; grid-template-columns: 30px 1fr 36px; gap: 10px; align-items: center; }
.mix .row span { font-size: 22px; } .mix .row b { font-size: 13px; color: var(--muted); text-align: right; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.player { position: sticky; top: 64px; z-index: 4; display: flex; gap: 10px; align-items: center; justify-content: space-between; background: rgba(22,24,58,.92); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; margin: 12px 0; }
.player .pt { display: flex; flex-direction: column; font-size: 14px; line-height: 1.3; min-width: 0; }
.player .pt small { color: var(--muted); font-size: 12px; }
.timers { display: flex; gap: 6px; flex-wrap: wrap; }
.timers button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.timers button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.breath { display: flex; flex-direction: column; align-items: center; padding: 18px 0 6px; }
.bcircle { width: 220px; height: 220px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-direction: column; position: relative; }
.bcircle::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #B9B1FF, #6A5FD9 55%, #2B2580); box-shadow: 0 0 60px rgba(140,120,255,.55); transform: scale(var(--s, .55)); transition: transform var(--t, 1s) cubic-bezier(.45,.05,.55,.95); }
.bcircle b, .bcircle small { position: relative; z-index: 1; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.bcircle b { font-size: 24px; } .bcircle small { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pats button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px; color: var(--ink); display: flex; flex-direction: column; gap: 2px; position: relative; }
.pats button b { font-size: 15px; } .pats button small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.pats button.on { border-color: var(--accent); background: var(--accent-soft); }
.pats button .lk { position: absolute; top: 8px; right: 10px; font-size: 12px; }
.med { display: grid; gap: 8px; }
.med button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px; color: var(--ink); display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; }
.med button > span:first-child { font-size: 26px; } .med button b { font-size: 16px; } .med button small { display: block; color: var(--muted); font-size: 12.5px; }
.mstep { font-size: 20px; line-height: 1.7; text-align: center; padding: 26px 8px; min-height: 180px; display: flex; align-items: center; justify-content: center; }
.prog { height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); transition: width .5s; }
.nights { display: grid; gap: 0; }
.night { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.night:first-child { border-top: 0; }
.night .nv { font-weight: 800; font-variant-numeric: tabular-nums; }
.night small { display: block; color: var(--muted); font-size: 12px; }
.stars5 { display: flex; gap: 4px; } .stars5 button { border: 0; background: none; font-size: 30px; padding: 0 2px; filter: grayscale(1); opacity: .4; }
.stars5 button.on { filter: none; opacity: 1; }
.sbars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; height: 150px; align-items: end; }
.sbars div { white-space: nowrap; overflow: visible; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: 9.5px; color: var(--muted); gap: 3px; }
.sbars i { display: block; width: 100%; border-radius: 4px 4px 1px 1px; background: var(--accent); min-height: 2px; }
.sbars i.short { background: var(--out); } .sbars i.long { background: var(--in); }
.goal { display: flex; gap: 10px; align-items: center; }
.tags button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; color: var(--ink); }
