/* 꿈 · 잠 · 일기 · 대화 확장(ZD-LUCID-SLEEP) — assets/ls.js 의 화면. body.ux 일 때만 쓰인다(ux.css 의 변수와 부품을 쓴다).
   색 · 크기는 docs/design/ZD-LUCID-SLEEP/ 의 값이다(청록 #8fe0d4 · 달빛 #f2d9a4 · 보라 #8b6ef0). 글자는 12px 이상 · 누르는 곳은 44px 이상.
   이 파일을 고치면 index.html 의 ?v= 를 올린다. */

.ls-dhead { display: flex; flex-direction: column; gap: 12px; }
.ls-card { border-radius: 20px; border: 1px solid var(--line); background: var(--glass); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ls-card.teal { border-color: var(--sleep-35); background: linear-gradient(160deg, var(--sleep-10), var(--wash-03)); }
.ls-card.warm { border-color: var(--peach-40); background: linear-gradient(160deg, var(--peach-10), var(--wash-03)); }
.ls-card .k { font-size: 14px; color: var(--sleep); font-weight: 700; }
.ls-card h3 { margin: 0; font-size: 16px; font-weight: 700; }
.ls-card .s, .ls-card p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--text2); word-break: keep-all; }
.ls-card .big { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.5; }
.ls-card .rest, .ls-card .s.warn { color: var(--peach); }
.ls-stat3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; gap: 4px; }
.ls-stat3 .it b { display: block; font-size: 22px; font-weight: 800; }
.ls-stat3 .it.hi b { color: var(--sleep); }
.ls-stat3 .it span { font-size: 12px; color: var(--dim); }
.ls-hd { display: flex; justify-content: space-between; align-items: center; padding: 0 2px; margin-top: 4px; }
.ls-hd h2 { margin: 0; font-size: 17px; font-weight: 700; }
.ux-link.warm { color: var(--peach) !important; }
.ls-step { border-radius: 18px; background: var(--glass); border: 1px solid var(--line); padding: 12px; display: flex; gap: 12px; align-items: center; text-align: left; min-height: 72px; }
.ls-step .p { width: 96px; flex: none; }
.ls-step .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ls-step .n { font-size: 12.5px; color: var(--sleep); }
.ls-step b { font-size: 15.5px; font-weight: 700; }
.ls-step .s { font-size: 12.5px; line-height: 1.5; color: var(--dim); }
.ls-step .chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--mint-x22); color: var(--mint); }
.ls-step .chip.now { background: var(--sleep-x22); color: var(--sleep); }
.ls-pic { display: block; border-radius: 16px; }
.ls-bigpic { border-radius: 18px; overflow: hidden; }
.ls-kicker { margin: 0; font-size: 13.5px; color: var(--sleep); font-weight: 700; }
.ls-h2 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.45; word-break: keep-all; }
.ls-sh { margin: 4px 2px 0; font-size: 17px; font-weight: 700; }
.ls-how { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.65; color: var(--text2); }
.ls-how li::marker { color: var(--sleep); font-weight: 700; }
.ls-volrow { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.ls-volrow input[type=range] { flex: 1 1 auto; width: 100%; min-width: 120px; height: 44px; accent-color: var(--sleep); }
.ls-safe-it { margin: 0; display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.65; color: var(--text2); padding: 12px 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); word-break: keep-all; }
.ls-safe-it .ms { color: var(--peach); margin-top: 2px; }
.ls-check { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: 15px; padding: 0 4px; cursor: pointer; }
.ls-check input { width: 22px; height: 22px; accent-color: var(--violet); flex: none; }
.ls-dl { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ls-dl > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.ls-dl dt { color: var(--dim); flex: none; }
.ls-dl dd { margin: 0; text-align: right; }
.ls-dl.big > div { flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); }
.ls-dl.big dt { font-size: 13px; color: var(--sleep); font-weight: 700; }
.ls-dl.big dd { text-align: left; font-size: 14.5px; line-height: 1.6; word-break: keep-all; }
.ls-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; font-size: 15px; cursor: pointer; }
.ls-toggle input { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 999px; background: var(--mark-14); position: relative; flex: none; cursor: pointer; margin: 0; }
.ls-toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.ls-toggle input:checked { background: var(--violet); }
.ls-toggle input:checked::after { transform: translateX(20px); }
.ls-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ls-two .ux-ghost, .ls-two .ux-cta { height: 52px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; }
.ls-row { width: 100%; min-height: 64px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); padding: 10px 12px 10px 14px; display: flex; align-items: center; gap: 12px; text-align: left; }
.ls-row > .ms:first-child { color: var(--sleep); }
.ls-row .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ls-row b { font-size: 15.5px; font-weight: 700; }
.ls-row .t span { font-size: 13px; color: var(--dim); line-height: 1.5; }
.ls-chipbtn { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--glass); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.ls-chipbtn[aria-pressed="true"] { border-color: var(--sleep-50); color: var(--sleep) !important; }
.ls-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ls-chips button { min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--glass); font-size: 14.5px; }
.ls-chips button[aria-pressed="true"] { background: var(--violet-28); border-color: var(--violet); color: var(--text-hi) !important; font-weight: 700; }
.ls-sec { display: flex; flex-direction: column; gap: 10px; }
.ls-tip { margin: 0; display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--moon-08); border: 1px solid var(--moon-25); font-size: 14.5px; line-height: 1.65; color: var(--warm-text); word-break: keep-all; }
.ls-tip .ms { color: var(--moon); }

/* 잠 첫 화면 */
.ls-card .hd { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ls-card .hd .s { font-size: 12.5px; color: var(--dim); }
.ls-bars { display: flex; gap: 8px; align-items: flex-end; height: 96px; }
.ls-bars .c { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.ls-bars .bar { width: 100%; border-radius: 6px; background: var(--sleep-xaa); }
.ls-bars .bar.low { background: var(--peach-xaa); }
.ls-bars .bar.none { background: var(--mark-08); }
.ls-bars span { font-size: 12px; color: var(--dim); }
.ls-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ls-tool { min-height: 104px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; }
.ls-tool .ms { color: var(--sleep); margin-bottom: 4px; }
.ls-tool b { font-size: 15.5px; }
.ls-tool span:not(.ms) { font-size: 12.5px; color: var(--dim); line-height: 1.45; }
.ls-tools2 { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* 살펴보기 */
.ls-prog { display: flex; align-items: center; gap: 12px; }
.ls-prog .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--mark-10); overflow: hidden; }
.ls-prog .bar i { display: block; height: 100%; background: var(--sleep); border-radius: 3px; }
.ls-prog span { font-size: 13px; color: var(--dim); }
.ls-opts { display: flex; flex-direction: column; gap: 8px; }
.ls-opts button { min-height: 56px; border-radius: 14px; border: 1px solid var(--line2); background: var(--glass); padding: 0 14px; display: flex; align-items: center; gap: 10px; text-align: left; font-size: 15.5px; }
.ls-opts button[aria-checked="true"] { border-color: var(--sleep); background: var(--sleep-12); }
.ls-opts button .ms { color: var(--sleep); }
.ls-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ls-levels .it { border-radius: 14px; border: 1px solid var(--line); padding: 10px 6px; text-align: center; opacity: .55; }
.ls-levels .it b { display: block; font-size: 14px; }
.ls-levels .it span { font-size: 12px; color: var(--dim); }
.ls-levels .it.on { opacity: 1; border-color: var(--sleep); background: var(--sleep-12); }
.ls-result[data-level="consult"] .ls-levels .it.on, [data-level="consult"] .ls-levels .it.on { border-color: var(--peach); background: var(--peach-12); }
.ls-card .lead { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.55; word-break: keep-all; }
.ls-card .ai { font-size: 12.5px; color: var(--dim); display: flex; align-items: center; gap: 5px; }
.ls-consult { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--dim); word-break: keep-all; }

/* 숨 고르기 */
.ls-circle { position: relative; width: 220px; height: 220px; margin: 8px auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.ls-circle .ring { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, var(--sleep-35), var(--sleep-08) 65%, transparent 70%); border: 2px solid var(--sleep-50); transform: scale(.55); transition: transform var(--dur, 4s) ease-in-out; }
.ls-circle[data-ph="in"] .ring { transform: scale(1); }
.ls-circle[data-ph="hold"] .ring { transition-duration: .2s; }
.ls-circle[data-ph="out"] .ring { transform: scale(.55); }
.ls-circle .ph { position: relative; font-size: 20px; font-weight: 700; }
.ls-circle .sec { position: relative; font-size: 14px; color: var(--dim); }
.ls-how1 { margin: 0; text-align: center; font-size: 15px; line-height: 1.6; word-break: keep-all; }
.ls-cnt { margin: 0; text-align: center; font-size: 13px; color: var(--dim); word-break: keep-all; }
body.ls-dimmed #ux { filter: brightness(.35); }
body.ls-dimmed #sky, body.ls-dimmed #haze { opacity: .2; }

/* 몸 풀기 */
.ls-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ls-parts li { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 12px; background: var(--glass); font-size: 15px; color: var(--dim); }
.ls-parts li.done { color: var(--text); }
.ls-parts li.done .ms { color: var(--mint); }
.ls-parts li.now { color: var(--text); border: 1px solid var(--sleep); }
.ls-parts li.now .ms { color: var(--sleep); }

/* 잠 소리 */
.ls-sgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ls-sgrid button { min-height: 88px; border-radius: 16px; border: 1px solid var(--line); background: var(--glass); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 14px; }
.ls-sgrid button .ms { color: var(--sleep); }
.ls-sgrid button[aria-checked="true"] { border-color: var(--sleep); background: var(--sleep-12); font-weight: 700; }
.ls-sstate { margin: 0; text-align: center; font-size: 13.5px; color: var(--sleep); min-height: 20px; }

/* 습관 */
.ls-habit { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); }
.ls-habit .ms { color: var(--sleep); }
.ls-habit .t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ls-habit b { font-size: 15.5px; }
.ls-habit .t span { font-size: 13.5px; line-height: 1.6; color: var(--dim); word-break: keep-all; }

/* 일기 */
.ls-jlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ls-jcard { border-radius: 18px; background: var(--glass); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.ls-jcard .top, .ux-dcard .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ls-kind { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--sleep); }
.ls-jcard[data-kind="sleep"] .ls-kind { color: var(--lav); }
.ls-jcard .d { font-size: 13px; color: var(--dim); }
.ls-jcard .vis { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--wash-07); color: var(--dim); margin-left: auto; }
.ls-jcard .vis.on { background: var(--sleep-14); color: var(--sleep); }
.ls-jcard p { margin: 0; }
.ls-jcard .body { font-size: 15px; line-height: 1.65; word-break: keep-all; overflow-wrap: anywhere; }
.ls-jcard .sum { font-size: 14.5px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ls-jcard .dots { display: inline-flex; gap: 3px; }
.ls-jcard .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--mark-18); }
.ls-jcard .dots i.on { background: var(--sleep); }
.ls-jcard .chips { font-size: 13px; color: var(--dim); line-height: 1.55; word-break: keep-all; }
.ls-jcard .act { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.ls-jcard .act button { min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line2); background: transparent; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.ls-jcard .act .cm { margin-right: auto; border-color: var(--sleep-40); color: var(--sleep) !important; }
.ls-jcard .act .del { color: var(--danger) !important; }
.ls-picks { display: flex; flex-direction: column; gap: 8px; }

/* 잠든 뒤 화면 · 새벽 화면 */
.ls-night { position: fixed; inset: 0; z-index: 40; background: var(--nm-bg); color: var(--nm-text); display: flex; align-items: center; justify-content: center; padding: 24px 20px; transition: background 1s; }
.ls-night .in { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; align-items: stretch; text-align: center; transition: opacity 1.5s; }
.ls-night.deep .in { opacity: .18; }
.ls-night .clock { margin: 0; font-size: 44px; font-weight: 300; color: var(--nm-dim); }
.ls-night .msg, .ls-night .s, .ls-night .lost { margin: 0; font-size: 14px; line-height: 1.6; word-break: keep-all; }
.ls-night .lost { color: var(--nm-warm); }
.ls-night h2 { margin: 0; font-size: 20px; color: var(--nm-hi); }
.ls-night .ls-how { text-align: left; color: var(--dim); }
.ls-night[data-mode="wake"] .clock { font-size: 20px; }
.ls-night button { font: inherit; color: inherit; cursor: pointer; }
.ls-nbtn { min-height: 48px; border-radius: 14px; border: 1px solid var(--rule-12); background: transparent; color: var(--nm-dim); font: inherit; font-size: 15px; cursor: pointer; }
.ls-night .ux-ctabs button { color: var(--nm-dim) !important; }
.ls-night .ux-ctabs button[aria-pressed="true"] { color: var(--nm-on) !important; }

/* 대화 판 */
.ls-bstats .it b { font-size: 18px; }
.ux-ccard .tg.ld { color: var(--sleep); }

/* 세로 배치 안의 큰 단추(ux.css 의 .ux-cta.md 는 가로 줄에서 늘어나도록 flex: 1 이다 — 세로 배치에서는 높이가 줄지 않게) */
.ux-ccol > .ux-cta.md, .ls-card > .ux-cta.md, .ls-night .ux-cta.md { flex: none; width: 100%; }

/* 대화 판 5개(해몽 마당 · 자각몽 · 잠 · 이야기 · 전체)는 360px 에서도 한 줄로(꺾이지 않게 글자와 여백을 줄인다) */
[data-t="ux-talk-tabs"] { gap: 2px; padding: 4px 3px; }
[data-t="ux-talk-tabs"] button { padding: 0 2px; font-size: 13.5px; letter-spacing: -0.3px; white-space: nowrap; min-width: 0; }

/* ZD-SLEEP-SND: 안내 목소리 · 음성 안내 카드 · 자기 전 훈련 방식 · 잠 도구 5개 · 잠 음악 */
.ls-voice { display: flex; align-items: center; gap: 10px; }
.ls-voice .l { font-size: 13.5px; color: var(--dim); white-space: nowrap; }
.ls-voice .ux-seg { flex: 1; }
.ls-guide .hd b { font-size: 16px; }
.ls-guide .ls-chipbtn { align-self: center; }
.ls-ai, .ls-card .ls-ai { margin: 0; font-size: 12.5px; color: var(--dim); text-align: center; }
.ls-tvoice, .ls-tbell { display: flex; flex-direction: column; gap: 12px; }
.ls-tvoice[hidden], .ls-tbell[hidden] { display: none; }
.ls-tools > .ls-tool:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 0; }
.ls-sgrid[data-t="ls-music-grid"] button { min-height: 96px; }
.ls-night[data-mode="wake"] { align-items: flex-start; overflow-y: auto; }
.ls-night .ls-guide { background: var(--wash-03); border-color: var(--rule-08); text-align: left; }
.ls-night .ls-guide .hd b { color: var(--nm-hi); }
.ls-night .ls-guide .ls-voice .l, .ls-night .ls-ai, .ls-night .ls-sstate { color: var(--nm-dim); }
.ls-tbell > .ux-cta.md, .ls-tvoice > .ux-cta.md { flex: none; width: 100%; }

/* 몸 풀기 설명 그림(ZD-PMR-SEC2) — 4:3 · 지금 카드와 같은 둥근 모서리 · 그림 바탕이 짙은 남색이라 새벽 테마에서도 판으로 보이게 1px 선 */
.ls-pmr-fig { position: relative; margin: 0; width: 100%; aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.ls-pmr-fig img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ls-pmr-fig img.old { position: absolute; inset: 0; transition: opacity .45s ease; }
html:not([data-lay="m"]) .ls-pmr-fig { max-width: 480px; }
.ls-parts li[role="button"] { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .ls-pmr-fig img.old { transition: none; } }
