/* 묶음16(2026-11-26) 첫 진입·기도 시작. 기준: prayer-room/DESIGN.md, 시안: specs/2026-11-26-ui-principles/시안/
   - 첫 인사 A안: 글자 크게·모습 고르기는 위쪽 작은 칸, [기도하기] 주황, [말씀 묵상][둘러보기] 나란히, 맨 아래 [그냥 머물기](테두리)
   - 기도 칸 A안: [내 기도 | 함께 기도] 탭. 선택은 흰 바탕 + 진한 테두리 + ✓(묶음15 영상 탭과 같은 규칙)
   3D 장면·재질·외곽선 규칙은 여기에 두지 않는다. */

/* ---------- 1. 첫 인사 ---------- */
#hint .start-what:not(#_) { margin: 0 0 var(--s-3); font-size: var(--t-body); color: var(--ink-2); }
#hint .hint-tools { display: flex; gap: var(--s-2); margin: 0 0 var(--s-2); }
#hint .hint-tools > button:not(#_) {
  flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  width: auto; min-height: var(--h-btn); margin: 0; padding: 0 var(--s-2);
  background: transparent; border: 2px solid var(--line); border-radius: var(--r-btn); box-shadow: none;
  font-size: var(--t-chip); font-weight: 700; line-height: 1.25; text-decoration: none; white-space: nowrap;
}
#hint #hint-text .state:not(#_) { display: none; }      /* 켜짐은 ✓와 흰 바탕으로(꺼짐·켜짐 글자를 줄여 한 줄에) */
#hint #hint-text[aria-pressed="true"]:not(#_) { background: #FFFFFF; border-width: 3px; }
#hint #hint-text[aria-pressed="true"]::after { content: "✓"; content: "✓" / ""; font-weight: 800; }
#hint-look { --ic: var(--i-user); }
#hint-look::before { content: ""; flex: none; width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
#hint .hint-pair { display: flex; gap: var(--s-2); margin-top: var(--s-2); }
#hint .hint-pair > button:not(#_) { flex: 1 1 0; min-width: 0; margin: 0; padding: 0 var(--s-2); }
#hint #hint-pray:not(#_) { min-height: var(--h-cta); }
#hint #hint-stay:not(#_) { background: transparent; box-shadow: none; }
#hint .not-instead:not(#_) { margin-top: var(--s-3); }
/* 좁은 폰·큰 글자: 나란한 두 칸이 꺾이면 위아래로 */
/* 좁은 폰(320 큰 글자 포함): 두 칸은 나란히 두고, 작은 칸·나란한 칸의 아이콘만 뺀다(위아래로 쌓으면 [그냥 머물기]가 화면 밖으로 밀렸다) */
@media (max-width: 340px) {
  #hint .hint-tools > button::before, #hint .hint-tools > button::after, #hint .hint-pair > button::before { display: none; }
  #hint .hint-tools > button:not(#_) { padding: 0 var(--s-1); }
  #hint #hint-text[aria-pressed="true"]::after { display: inline; }
}

/* ---------- 2. 기도 칸 탭 ---------- */
#praybar .pray-tabs { display: flex; margin: 0 0 var(--s-3); border: 2px solid var(--line); border-radius: var(--r-btn); overflow: hidden; }
#praybar .pray-tabs [role="tab"]:not(#_) {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--h-btn); margin: 0; padding: 0 var(--s-2); border: 0; border-radius: 0; box-shadow: none;
  background: #F0DDB4; font-size: var(--t-sub); font-weight: 700; color: var(--line);
}
#praybar .pray-tabs [role="tab"] + [role="tab"] { border-left: 2px solid var(--line); }
#praybar .pray-tabs [role="tab"][aria-selected="true"]:not(#_) { background: #FFFFFF; }
#praybar .pray-tabs [role="tab"][aria-selected="true"]::before { content: "✓"; content: "✓" / ""; font-weight: 800; }
#praybar .pray-tabs [role="tab"]:focus-visible { outline: 3px solid #B5482E; outline-offset: -5px; }
#pray-mine[hidden], #pray-with[hidden] { display: none; }

/* 내 기도: 입력 바로 아래 저장 범위 한 줄 */
#praybar .pray-where:not(#_) { margin: var(--s-2) 2px 0; text-align: left; }
#praybar #btn-continue:not(#_) { display: block; width: auto; margin: var(--s-2) auto 0; min-height: 44px; padding: 0 var(--s-4); background: transparent; border: 2px solid var(--line); box-shadow: none; font-size: var(--t-chip); }
#praybar #btn-continue[hidden] { display: none; }
#praybar #btn-start:not(#_) { display: block; width: 100%; margin-top: var(--s-3); min-height: var(--h-cta); background: #E9A23B; border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); font-size: var(--t-sub); }
#praybar #btn-quit:not(#_) { display: block; width: 100%; margin-top: var(--s-2); min-height: var(--h-btn); background: transparent; border: 2px solid var(--line); box-shadow: none; text-decoration: none; font-size: var(--t-sub); }
/* 예전 입구 단추: 함께 기도 탭이 대신한다(다른 곳에서 누르는 단추라 지우지 않고 숨김) */
#praybar .row.legacy, #pray-write #btn-public-prayer:not(#_), #pray-write #btn-askpray:not(#_) { display: none; }

/* 함께 기도: 길어지면 칸 안에서 내려 본다(아래 [그냥 머물기]·109 줄은 늘 보이게) */
#praybar.with-open #pray-with { max-height: min(52dvh, 460px); overflow-y: auto; overscroll-behavior: contain; padding: 0 2px var(--s-2); text-align: left; }
#pray-with .with-sec + .with-sec, #pray-with .with-sec + details, #pray-with details + .with-ask { margin-top: var(--s-4); }
#pray-with h3 { margin: 0 0 var(--s-2); font-size: var(--t-sub); font-weight: 700; }
#pray-with .with-status:not(#_) { margin: var(--s-2) 0; text-align: center; }
#pray-with .with-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
#pray-with .with-notes li { padding: var(--s-3); background: #FFF8EC; border: 2px solid var(--line); border-radius: var(--r-card); }
#pray-with .with-notes p { margin: 0; font-size: var(--t-body); line-height: var(--lh-body); word-break: keep-all; overflow-wrap: anywhere; }
#pray-with button:not(#_) { display: block; width: 100%; margin: var(--s-2) 0 0; min-height: var(--h-btn); padding: var(--s-1) var(--s-3); background: #F0DDB4; border: 2px solid var(--line); box-shadow: none; font-size: var(--t-body); font-weight: 700; line-height: 1.35; white-space: normal; word-break: keep-all; }
#pray-with .with-church { display: flex; flex-direction: column; gap: var(--s-2); }
#pray-with .with-church button:not(#_) { margin: 0; }
#pray-with .with-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); margin-top: var(--s-2); }
#pray-with .with-chips button:not(#_) { width: auto; margin: 0; padding: 0 var(--s-4); font-size: var(--t-chip); }
#pray-with .small:not(#_) { margin: 0; }
#pray-with details { border-top: 2px dashed #C9B28A; padding-top: var(--s-1); }
#pray-with summary { min-height: 44px; display: flex; align-items: center; font-size: var(--t-body); font-weight: 700; cursor: pointer; }
#pray-with summary:focus-visible { outline: 3px solid #B5482E; outline-offset: 2px; }
#pray-with .with-ask:not(#_) { background: transparent; }

/* 함께 기도하는 중: 머리줄만 바뀐다 */
#pray-now .eyebrow { text-align: center; }
#pray-now-text.long:not(#_) { max-height: 36dvh; overflow-y: auto; font-family: inherit; font-size: var(--t-sub); font-weight: 600; line-height: var(--lh-body); text-align: left; }

/* ---------- 3. 중보기도함 주제 칸: 부탁이 없는 주제는 접어 둔다(펼치면 맨 뒤에) ---------- */
#ask-pray-list .ask-row.empty { order: 1; }
#ask-pray-list:not(.show-empty) .ask-row.empty:not(#_) { display: none; }
#ask-empty-toggle:not(#_) { display: block; width: 100%; margin: var(--s-2) 0 0; min-height: var(--h-btn); background: transparent; border: 0; box-shadow: none; text-decoration: underline; text-underline-offset: 4px; font-size: var(--t-body); }
#ask-empty-toggle[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  #praybar.with-open #pray-with { scroll-behavior: auto; }
}

/* ---------- 4. 위 띠: 장소 단추는 「본당 · 이동」(기획자 2026-11-26 A안). 낭독은 단추 안 '교회 둘러보기, 지금 본당'이 맡는다 ---------- */
#where::after { content: " · 이동"; content: " · 이동" / ""; font-size: inherit; font-weight: 700; }
@media (max-width: 360px) { #where:not(#_) { max-width: none; } }      /* 예전 6.5em 자르기는 「이동」까지 잘라 먹는다. 긴 이름은 barPlace()가 이미 줄인다 */
@media (max-width: 340px) { :root[data-text="large"] #btn-tour .pin { display: none; } }      /* 320 큰 글자: 핀을 거두어 [메뉴]가 띠 안에(시안 측정 12px 넘침) */
/* 다섯 칸(밖·로비 등에서 [본당] 단추가 더해질 때): 핀을 거두고, 320 큰 글자에서는 「· 이동」 대신 예전 「▾」(측정: 기념관 24px 넘침). 남은 예외로 HANDOFF에 적음 */
@media (max-width: 430px) { .bar.top:has(#btn-home:not([hidden])) #btn-tour .pin { display: none; } }
@media (max-width: 340px) { :root[data-text="large"] .bar.top:has(#btn-home:not([hidden])) #where::after { content: " ▾"; content: " ▾" / ""; font-size: 12px; } }

/* ---------- 5. 기도나무 창(#ptree, js/prayer-tree.js). 시안: specs/2026-11-26-ui-principles/시안/비교5·6 ---------- */
:root { --i-leaf: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20256%20256%22%3E%3Cpath%20d%3D%22M223.45%2C40.07a8%2C8%2C0%2C0%2C0-7.52-7.52C139.8%2C28.08%2C78.82%2C51%2C52.82%2C94a87.09%2C87.09%2C0%2C0%2C0-12.76%2C49A101.72%2C101.72%2C0%2C0%2C0%2C46.7%2C175.2a4%2C4%2C0%2C0%2C0%2C6.61%2C1.43l85-86.3a8%2C8%2C0%2C0%2C1%2C11.32%2C11.32L56.74%2C195.94%2C42.55%2C210.13a8.2%2C8.2%2C0%2C0%2C0-.6%2C11.1%2C8%2C8%2C0%2C0%2C0%2C11.71.43l16.79-16.79c14.14%2C6.84%2C28.41%2C10.57%2C42.56%2C11.07q1.67.06%2C3.33.06A86.93%2C86.93%2C0%2C0%2C0%2C162%2C203.18C205%2C177.18%2C227.93%2C116.21%2C223.45%2C40.07Z%22/%3E%3C/svg%3E"); }      /* Phosphor Leaf(fill), MIT */
.leaf { display: inline-block; flex: none; width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; background: #4F7A3A; -webkit-mask: var(--i-leaf) center / contain no-repeat; mask: var(--i-leaf) center / contain no-repeat; }
.leaf-line:not(#_) { display: flex; align-items: center; color: var(--line); font-weight: 600; }
.thanks-line:not(#_) { margin-top: var(--s-1); color: var(--line); }
#ptree h2 { text-align: center; }
#ptree > p, #ptree .ptree-notes > p { text-align: center; }
#ptree hr { border: 0; border-top: 2px solid #E5D3AE; margin: var(--s-4) 0 var(--s-2); }
#ptree .ptree-notes, #ptree .ptree-mine { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }
#ptree .ptree-slip, #pray-with .with-notes li { text-align: left; }
#ptree .ptree-slip { padding: var(--s-3); background: #FFF8EC; border: 2px solid var(--line); border-radius: 4px var(--r-card) var(--r-card) var(--r-card); }
#ptree .ptree-slip p { margin: 0; font-size: var(--t-body); line-height: var(--lh-body); word-break: keep-all; overflow-wrap: anywhere; }
#ptree .ptree-slip .small:not(#_) { margin-top: var(--s-1); font-size: var(--t-caption); }
#ptree button:not(#_) { display: block; width: 100%; margin: var(--s-2) 0 0; min-height: var(--h-btn); padding: var(--s-1) var(--s-3); background: #F0DDB4; border: 2px solid var(--line); box-shadow: none; font-size: var(--t-sub); font-weight: 700; line-height: 1.35; white-space: normal; word-break: keep-all; }
#ptree button.go:not(#_) { min-height: var(--h-cta); background: #E9A23B; box-shadow: 0 3px 0 var(--line); }
#ptree button.plain:not(#_) { background: transparent; }
#ptree button.danger:not(#_) { color: #9A3A22; border-color: #9A3A22; }
#ptree .ptree-close:not(#_) { margin-top: var(--s-4); }
#ptree button:disabled { opacity: 0.6; }
#ptree .ptree-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-2); }
#ptree .ptree-state { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border: 2px solid var(--line); border-radius: 999px; background: #FFFFFF; font-size: var(--t-caption); font-weight: 700; }
#ptree .ptree-state.checking { background: #F0DDB4; }
#ptree .ptree-state.fix { background: #FFE9DF; color: #9A3A22; border-color: #9A3A22; }
#ptree .ptree-memo:not(#_) { margin: var(--s-2) 0 0; padding: var(--s-2) var(--s-3); background: #FFE9DF; border: 2px solid #9A3A22; border-radius: 12px; font-size: var(--t-body); color: var(--line); text-align: left; }
#ptree .ptree-acts { display: flex; gap: var(--s-2); flex-wrap: wrap; }
#ptree .ptree-acts button:not(#_) { flex: 1 1 140px; width: auto; }
#ptree .ptree-code:not(#_) { margin: var(--s-2) 0; padding: var(--s-2); text-align: center; font: 700 22px/1.2 ui-monospace, Menlo, monospace; letter-spacing: 2px; color: var(--line); background: #FFFFFF; border: 2px dashed var(--line); border-radius: 10px; }
#ptree textarea, #ptree input[type="text"] { display: block; width: 100%; box-sizing: border-box; margin-top: var(--s-2); padding: var(--s-2) var(--s-3); font: inherit; font-size: var(--t-body); line-height: var(--lh-body); color: var(--line); background: #FFFFFF; border: 2px solid var(--line); border-radius: var(--r-btn); }
#ptree input[type="text"] { min-height: var(--h-btn); letter-spacing: 1px; }
#ptree textarea:focus-visible, #ptree input:focus-visible { outline: 3px solid #B5482E; outline-offset: 2px; }
#ptree label.check { display: flex; align-items: flex-start; gap: var(--s-2); margin-top: var(--s-3); min-height: var(--h-btn); text-align: left; font-size: var(--t-body); }
#ptree label.check input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: #9A3A22; }
#ptree .small:not(#_) { margin-top: var(--s-2); }
#ptree a.tel { display: inline-block; min-width: 44px; padding: 10px 4px; margin: -10px 0; font-weight: 800; color: inherit; }
#pray-now #pray-now-note:not(#_) { margin: var(--s-2) 0 0; text-align: center; }
#pray-now-note[hidden] { display: none; }
#ptree .ptree-status:not(#_) { margin: var(--s-2) 0 0; min-height: 0; font-size: var(--t-body); font-weight: 700; color: #9A3A22; text-align: center; }
#ptree .ptree-status:empty { display: none; }
#ptree textarea { word-break: keep-all; overflow-wrap: anywhere; }
#ptree a.tel:not(#_) { padding: 10px 2px; margin: -10px 0; min-width: 0; }
/* 동의 칸: 기본 체크 칸은 테두리가 흐려 잘 안 보였다(320 큰 글자 사진). 진한 테두리 + 체크 표시 */
#ptree label.check input[type="checkbox"]:not(#_) { -webkit-appearance: none; appearance: none; display: grid; place-content: center; width: 26px; height: 26px; border: 2px solid var(--line); border-radius: 6px; background: #FFFFFF; }
#ptree label.check input[type="checkbox"]:not(#_):checked { background: #9A3A22; border-color: #9A3A22; }
#ptree label.check input[type="checkbox"]:not(#_):checked::after { content: "✓"; color: #FFFFFF; font-weight: 800; font-size: 18px; line-height: 1; }
#ptree label.check input[type="checkbox"]:focus-visible { outline: 3px solid #B5482E; outline-offset: 2px; }
#ptree label.check span { word-break: keep-all; }
#ptree, #pray-with { overscroll-behavior: contain; }
/* 함께 기도 탭 「아래로 더 있어요」: 칸 바로 아래 가운데(다른 창의 알약과 같은 모양) */
#praybar .with-cue:not(#_) { display: block; width: max-content; margin: var(--s-1) auto 0; position: static; }      /* 목록 위에 겹치지 않고 목록과 [그냥 머물기] 사이 제자리에 */
#praybar .with-cue[hidden] { display: none !important; }
/* 새해 트리 기간 장소 단추의 작은 별(✦): 320폭 + 다섯 칸에서는 거둔다(기념관·예배실에서 넘침, 2026-11-28 점검) */
@media (max-width: 340px) { .bar.top:has(#btn-home:not([hidden])) .yt-badge { display: none; } }

/* 내가 부탁한 기도 새 소식 점(모체 2026-11-27): 메뉴 단추와 메뉴 안 항목 오른쪽 위 주황 점 */
#btn-menu.has-news, #btn-my-asks.has-news { position: relative; }
#btn-menu.has-news::after, #btn-my-asks.has-news::after { content: ""; position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #D9541E; box-shadow: 0 0 0 2px var(--paper, #FBF4E4); }

/* 계단 바로 가기 단추(2026-11-28, cam-light). 층 이동은 그 장소의 주요 실행이 아니라 이동이라 보조 단추 모양(옅은 베이지·갈색 테두리, 모서리 11px). 주황은 「기도하기」에만 남긴다.
   Phosphor 굵은 계단 아이콘(stairs-bold)+글자. 등장 0.22초 expo-out, 퇴장 0.18초 expo-in, 움직임 줄이기면 바로 */
:root { --i-stairs: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M200,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V40A20,20,0,0,0,200,20ZM152,148h44v16H116V148Zm12-24V108h32v16Zm32-80V84H152a12,12,0,0,0-12,12v28H104a12,12,0,0,0-12,12v28H60V44ZM60,212V188H196v24Z'/%3E%3C/svg%3E"); }
#stair-go {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2, 8px);
  min-height: var(--h-cta); padding: 0 20px; border-radius: var(--r-btn);
  background: #F0DDB4; color: var(--line); border: 2px solid var(--line);
  font-family: inherit; font-weight: 800; font-size: var(--t-sub); line-height: 1.2; white-space: nowrap;
  transform: translateX(-50%);
  transition: opacity .22s cubic-bezier(0.16, 1, 0.3, 1), transform .22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s;
}
#stair-go::before { content: ""; flex: none; width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--i-stairs) center / contain no-repeat; mask: var(--i-stairs) center / contain no-repeat; }
#stair-go.off { opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, 8px);
  transition: opacity .18s cubic-bezier(0.7, 0, 0.84, 0), transform .18s cubic-bezier(0.7, 0, 0.84, 0), visibility 0s .18s; }
#stair-go:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { #stair-go, #stair-go.off { transition: none; transform: translateX(-50%); } }
