/* 루틴 앱 화면 — 시안 A. 공통 토큰·머리·기록 위젯·세그먼트는 /assets/site.css */
/* ---------- app ---------- */
.app { padding: var(--s5) 0 var(--s8); }
.screen { display: none; }
.screen.on { display: block; }
.screen.run.on { display: flex; }
.app-title { display: flex; justify-content: space-between; align-items: end; gap: var(--s4); margin-bottom: var(--s5); }
.app-title h1 { font-size: 2.25rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1.1; }
.app-grid { display: grid; gap: var(--s5); }
.rec .stats3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); margin-top: var(--s5); border-top: 1px solid var(--line); padding-top: var(--s4); }
.rec .stats3 small { display: block; }
.rec .stats3 .num { display: block; font-size: 1.75rem; font-weight: 800; font-stretch: 88%; line-height: 1.05; }
.rec .stats3 small { font-size: .875rem; color: var(--ink-2); font-weight: 650; }
.app .rec { border: 1px solid var(--line); box-shadow: none; }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.chip { min-height: 64px; border: 2px solid var(--line); background: var(--paper); border-radius: var(--r-m); cursor: pointer; color: var(--ink);
  font-family: var(--f-num); font-weight: 800; font-size: 1.5rem; font-stretch: 90%; display: flex; align-items: center; justify-content: center; gap: 4px; }
.chip span { font-family: var(--f-ko); font-size: 1rem; font-weight: 700; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--volt); }
.plan { border: 2px solid var(--ink); border-radius: var(--r-m); padding: var(--s5); }
.plan h2 { font-size: 1.5rem; font-weight: 850; letter-spacing: -0.03em; line-height: 1.3; }
.plan .lab { display: block; margin-bottom: 6px; }
.plan ol { list-style: none; margin: var(--s4) 0 0; padding: 0; counter-reset: s; }
.plan li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: var(--s3); padding: 10px 0; border-top: 1px solid var(--line); font-weight: 650; font-size: 1.0625rem; counter-increment: s; }
.plan li::before { content: counter(s); font-family: var(--f-num); font-weight: 800; font-size: 1rem; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 3px; background: var(--mist); }
.plan li.look::before { background: var(--volt); }
.plan li .num { font-weight: 700; color: var(--ink-2); font-size: 1rem; }
.plan .seg { margin-top: var(--s4); }
.rbtn { width: 100%; min-height: 72px; border: 0; border-radius: var(--r-pill); background: var(--volt); color: var(--ink); cursor: pointer;
  font-family: var(--f-ko); font-size: 1.375rem; font-weight: 850; letter-spacing: -0.02em; display: flex; align-items: center; justify-content: center; gap: 12px; }
.rbtn:hover { background: var(--volt-deep); }
.rbtn.ghost { background: transparent; border: 2px solid var(--ink); min-height: 60px; font-size: 1.125rem; }
.rbtn.ink { background: var(--ink); color: var(--paper); }
.note { font-size: 1rem; color: var(--ink-2); font-weight: 550; margin: var(--s3) 0 0; text-align: center; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s4) 0; border-top: 1px solid var(--line); font-weight: 700; }
.switch { width: 56px; height: 32px; border-radius: 99px; background: var(--ink); position: relative; flex: none; }
.switch::after { content: ""; position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--volt); }
@media (min-width: 900px) {
  .app-grid { grid-template-columns: 1fr 1.15fr; align-items: start; gap: var(--s6); }
  .app-title h1 { font-size: 3rem; }
}

/* run */
.run { min-height: calc(100vh - 65px); flex-direction: column; padding: var(--s4) 0 var(--s5); transition: background-color .8s ease; }
.run .wrap { width: 100%; flex: 1; display: flex; flex-direction: column; }
.run-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.run-top .lab { color: var(--ink); }
.ring { display: flex; gap: 4px; height: 10px; margin: var(--s4) 0 var(--s5); }
.ring i { display: block; height: 100%; border-radius: 2px; background: var(--line); position: relative; overflow: hidden; }
.ring i.done { background: var(--ink); }
.ring i.now { background: var(--line); }
.ring i.now b { position: absolute; inset: 0 auto 0 0; background: var(--volt); box-shadow: inset 0 0 0 1.5px var(--ink); border-radius: 2px; }
.stepno { font-family: var(--f-num); font-weight: 800; font-size: 1.125rem; }
.step-name { font-size: clamp(2.25rem, 10vw, 4.5rem); font-weight: 900; letter-spacing: -0.045em; line-height: 1.08; margin: var(--s2) 0 0; }
.timer { flex: 1; min-height: 220px; display: flex; align-items: flex-end; gap: 10px; margin: var(--s2) calc(var(--gutter) * -1) 0; padding: var(--s4) var(--gutter) var(--s4); background: var(--volt); border-radius: 0; transition: background-color .8s ease; }
.timer .num { font-size: clamp(9rem, 50vw, 17rem); font-weight: 800; font-stretch: 72%; line-height: .9; letter-spacing: -0.06em; margin-bottom: 0; }
.timer .u { font-size: 1.75rem; font-weight: 850; padding-bottom: var(--s4); }
.timer .tot { margin-left: auto; text-align: right; padding-bottom: var(--s4); }
.timer .tot .num { font-size: 2rem; font-stretch: 90%; display: block; line-height: 1; margin: 0; letter-spacing: -0.02em; }
.timer .tot small { font-weight: 700; font-size: .9375rem; }
.step-text { font-size: 1.375rem; line-height: 1.55; font-weight: 600; letter-spacing: -0.02em; margin: var(--s4) 0 var(--s4); max-width: 22em; }
.voice { display: inline-flex; gap: 8px; align-items: center; font-size: .9375rem; font-weight: 700; color: var(--ink-2); }
.voice i { width: 4px; background: var(--ink); border-radius: 2px; display: inline-block; }
.run-ctrl { margin-top: auto; display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s3); padding-top: var(--s5); }
.run-ctrl .rbtn { min-height: 64px; font-size: 1.1875rem; }
/* '어둡게' 단계: 포인트 색을 빼고 중간 회색으로 밝기를 낮춘다(검정 금지) */
body.dim { background: var(--dim); }
body.dim .top { background: var(--dim); border-color: rgba(21,24,28,.15); }
body.dim .fs { background: var(--dim-2); border-color: transparent; }
body.dim .timer { background: var(--dim-2); }
body.dim .ring i { background: rgba(21,24,28,.18); }
body.dim .ring i.done { background: var(--ink); }
body.dim .ring i.now b { background: var(--ink); box-shadow: none; }
body.dim .voice, body.dim .lab { color: var(--ink); }
body.dim .rbtn.ink { background: var(--ink); }
body.dim .rbtn.ghost { border-color: var(--ink); }
@media (min-width: 900px) {
  .run .wrap { max-width: 1100px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto 1fr auto; column-gap: var(--s7); }
  .run-top, .ring { grid-column: 1 / -1; }
  .timer { margin: 0; border-radius: var(--r-m); grid-row: 3 / 5; grid-column: 2; padding: var(--s6); align-items: flex-end; overflow: hidden; }
  .timer .num { font-size: 24rem; }
}

/* done */
.done-hero { background: var(--volt); margin: 0 calc(var(--gutter) * -1); padding: var(--s6) var(--gutter) var(--s5); }
.done-hero .lab { color: var(--ink); }
.done-hero h1 { font-size: 2.25rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1.15; margin-top: var(--s2); }
.done-hero .streak { margin-top: var(--s4); display: inline-flex; position: relative; padding-right: 56px; }
.done-hero .streak .num { font-size: 9rem; font-stretch: 72%; }
.done-hero .streak .u { font-size: 1.75rem; }
.plus { font-family: var(--f-num); font-weight: 800; background: var(--ink); color: var(--volt); padding: 4px 10px; border-radius: 3px; font-size: 1.125rem; position: absolute; right: 0; top: 0; }
.saved { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.0625rem; margin-top: var(--s4); }
.saved i { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; flex: none; }
.saved i::after { content: ""; width: 10px; height: 6px; border-left: 2.5px solid var(--volt); border-bottom: 2.5px solid var(--volt); transform: rotate(-45deg) translate(1px, -1px); }
.done-body { padding-top: var(--s5); display: grid; gap: var(--s5); }
.done-body .msg { font-size: 1.25rem; font-weight: 600; line-height: 1.6; margin: 0; letter-spacing: -0.02em; }
.read h2 { font-size: 1.125rem; font-weight: 850; margin-bottom: var(--s2); }
.read a { display: block; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; font-weight: 750; font-size: 1.125rem; line-height: 1.45; }
.done-ctrl { display: grid; gap: var(--s3); }
/* 단추 묶음 공통(회장 실기기 12/2): 단추가 세로로 이어지면 12px — 묶음은 .done-ctrl(grid gap) 을 쓰고, 묶음 밖에서 붙은 단추도 같은 간격 */
.rbtn + .rbtn { margin-top: var(--s3); } .done-ctrl > .rbtn + .rbtn { margin-top: 0; }
@media (min-width: 900px) {
  .done-hero { margin: 0; border-radius: var(--r-m); padding: var(--s7); display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--s5); }
  .done-hero .streak .num { font-size: 12rem; }
  .done-body { grid-template-columns: 1fr 1fr; gap: var(--s7); }
}


/* ---------- 운영 보강(시안 밖) ---------- */
.col { display: flex; flex-direction: column; gap: var(--s4); }
.col-l { gap: var(--s5); }
.toggle { width: 100%; min-height: 56px; background: none; border-left: 0; border-right: 0; border-bottom: 0; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; text-decoration: none; text-align: left; }
.toggle .state { color: var(--ink-2); font-weight: 600; }
.toggles .toggle:last-child { border-bottom: 1px solid var(--line); }
.switch.off { background: var(--line); }
.switch.off::after { right: auto; left: 4px; background: var(--paper); }
.small { font-size: .9375rem; color: var(--ink-2); margin: 0; }
.voice.off i { opacity: .25; }
.skip-intro { margin-top: var(--s3); }
.rem-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin: var(--s5) 0; }
.rem-opts .chip { font-size: 1.125rem; font-family: var(--f-ko); }
.rem p { max-width: 32em; }
.back { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; text-decoration: none; }
/* PC: 시작 단추가 스크롤 없이 보이도록 오른쪽 열에서 루틴 구성표를 단추 아래로(1366×768 기준) */
@media (min-width: 900px) {
  .app { padding-top: var(--s4); }
  .app-title { margin-bottom: var(--s4); }
  .col-r .plan { order: 2; }
}
.loading { padding: var(--s6) 0; }
.rec .stats3 small.u2 { display: inline; font-size: 1rem; color: var(--ink); margin-left: 2px; }

/* ---------- 소리(발주 5): 음량 슬라이더·소리 설정·첫 실행 소리 안내 시트·숨 원 ---------- */
[hidden] { display: none !important; }
.vol { display: grid; grid-template-columns: 4.5em 1fr; align-items: center; gap: var(--s3); min-height: 48px; font-weight: 700; }
.vol input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; cursor: pointer; margin: 0; }
.vol input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: var(--line); }
.vol input[type=range]::-moz-range-track { height: 8px; border-radius: 99px; background: var(--line); }
.vol input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: var(--volt); border: 2px solid var(--ink); }
.vol input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--volt); border: 2px solid var(--ink); }
.vol input[type=range]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.snd-set { display: grid; gap: var(--s1, 4px); }
.snd-set.off { opacity: .45; }
.bg-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-top: var(--s2); }
.bg-opts .chip { min-height: 48px; font-size: 1rem; font-family: var(--f-ko); }
.run-vol { padding-top: var(--s4); }
.run-vol .vol { max-width: 28em; }
body.dim .vol input[type=range]::-webkit-slider-runnable-track { background: rgba(21,24,28,.22); }
/* 첫 실행 소리 안내 시트 — 아래에서 올라오는 흰 면(검정 바탕 없음, 뒤는 옅은 회색 막) */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(141,147,154,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet-in { position: relative; width: 100%; max-width: 560px; background: var(--paper); border-radius: var(--r-m) var(--r-m) 0 0; border-top: 2px solid var(--ink); padding: var(--s6) var(--gutter) calc(var(--s5) + env(safe-area-inset-bottom)); display: grid; gap: var(--s3); }
.sheet-in h2 { font-size: 1.75rem; font-weight: 900; letter-spacing: -0.035em; line-height: 1.2; margin: var(--s2) 0 0; }
.sheet-in p { margin: 0; color: var(--ink-2); font-weight: 600; font-size: 1.0625rem; line-height: 1.55; }
.sheet-vol { display: grid; grid-template-columns: auto 1fr; gap: var(--s4); align-items: center; padding: var(--s3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: var(--s2) 0; }
.sheet-vol .prev { width: auto; min-height: 48px; padding: 0 var(--s4); font-size: 1rem; }
.sheet-vol .vol { grid-template-columns: auto 1fr; }
.sheet-x { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; }
.sheet-x::before, .sheet-x::after { content: ""; position: absolute; left: 12px; top: 21px; width: 20px; height: 2.5px; background: var(--ink); border-radius: 2px; transform: rotate(45deg); }
.sheet-x::after { transform: rotate(-45deg); }
@media (min-width: 900px) { .sheet { align-items: center; } .sheet-in { border-radius: var(--r-m); border: 2px solid var(--ink); padding: var(--s6); } }
/* 숨 원(눈 감기 단계): 들숨 4초 커지고 날숨 6초 작아짐 — transition 길이는 app.js 가 숨 일정대로 */
.breath { width: 132px; height: 132px; margin: var(--s2) 0 var(--s4); display: grid; place-items: center; }
.breath i { display: block; width: 100%; height: 100%; border-radius: 50%; border: 2.5px solid var(--ink); background: rgba(255,255,255,.32); }
.breath { transform: scale(.62); transform-origin: center; will-change: transform; }
/* 진행 중임을 보이는 미세한 움직임: 지금 단계 막대가 부드럽게 차오르고, 음성 막대가 천천히 숨쉰다(어두운 단계 포함) */
.ring i.now b { transition: width .25s linear; }
body.live .voice:not(.off) i { animation: ec-bars 2.4s ease-in-out infinite; transform-origin: bottom; }
body.live .voice:not(.off) i:nth-child(2) { animation-delay: -.6s; } body.live .voice:not(.off) i:nth-child(3) { animation-delay: -1.2s; }
body.live .voice:not(.off) i:nth-child(4) { animation-delay: -1.8s; } body.live .voice:not(.off) i:nth-child(5) { animation-delay: -.3s; }
@keyframes ec-bars { 0%, 100% { transform: scaleY(.55); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  body.live .voice i { animation: none !important; }
  .ring i.now b { transition: none; }
  .breath { transition: none !important; }
}
