/* 월클톡 모바일 5차: 앱 틀 (아래 탭 5개 · 첫 화면 · 안전 여백 · 아래에서 올라오는 시트 · 누를 때 반응 · 홈 화면에 추가 안내)
   ================================================================================================
   겉모습 값은 이 맨 위 :root 한 곳에서만 바꿈 (디자인 담당 자리). 1~4차 화면 이름(--head · --wm-* 등)도 여기 값을 그대로 이어 받음.
   아이콘 · 아이폰 첫 화면 그림 색은 tools_5차\make_icons.ps1 의 세 색과 같게.
   ================================================================================================ */
:root {
  /* 색 */
  --app-navy: #16233F;      /* 월클톡 남색 (머리줄 · 첫 화면 · theme_color) */
  --app-navy2: #243458;
  --app-bg: #F4F6FA;
  --app-card: #FFFFFF;
  --app-text: #18223A;
  --app-sub: #7A869E;
  --app-line: #E3E8F1;
  --app-accent: #4F8CFF;
  --app-accent-d: #306ADC;
  --app-soft: #EEF4FF;
  --app-a-text: #285CC4;
  --app-red: #D23434;
  --app-red-soft: #FDEDED;
  --app-green: #34C759;
  --app-amber: #FFB020;
  --app-amber-soft: #FFF7D6;
  /* 글꼴 */
  --app-font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  --app-fs: 16px;
  /* 둥글기 */
  --app-r-card: 18px;
  --app-r-btn: 12px;
  --app-r-sheet: 22px;
  --app-r-pill: 999px;
  /* 틀 크기 */
  --app-tabh: 60px;
  /* 안전 여백(노치 · 상태 표시줄 · 아래 홈 막대): 기기 값 그대로 · 보여 주기용(#demo&notch=1)만 덮어씀 */
  --ap-safe-top: env(safe-area-inset-top, 0px);
  --ap-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ap-safe-left: env(safe-area-inset-left, 0px);
  --ap-safe-right: env(safe-area-inset-right, 0px);
  --ap-headh: 104px;        /* 머리줄 높이 (app.js 가 실제 값으로 맞춤) */

  /* ---- 1~4차 이름 이어 받기 (아래는 고치지 않음) ---- */
  --head: var(--app-navy); --head2: var(--app-navy2); --bg: var(--app-bg); --card: var(--app-card); --text: var(--app-text); --sub: var(--app-sub); --line: var(--app-line);
  --accent: var(--app-accent); --accentD: var(--app-accent-d); --soft: var(--app-soft); --aText: var(--app-a-text); --red: var(--app-red); --redSoft: var(--app-red-soft);
  --green: var(--app-green); --amber: var(--app-amber); --amberSoft: var(--app-amber-soft);
  --wm-head: var(--app-navy); --wm-accent: var(--app-accent); --wm-accent-d: var(--app-accent-d); --wm-bg: var(--app-bg); --wm-card: var(--app-card); --wm-text: var(--app-text); --wm-sub: var(--app-sub);
  --wm-line: var(--app-line); --wm-soft: var(--app-soft); --wm-a-text: var(--app-a-text); --wm-red: var(--app-red); --wm-red-soft: var(--app-red-soft); --wm-amber: var(--app-amber); --wm-amber-soft: var(--app-amber-soft);
  --wm-font: var(--app-font); --wm-r: var(--app-r-card); --wm-r-s: var(--app-r-btn);
}
html, body { font-family: var(--app-font); font-size: var(--app-fs); }
.card, .tile, .wm.card { border-radius: var(--app-r-card); }
.b, .wm-b, .inrow input, .edit input, .wm-in { border-radius: var(--app-r-btn); }
.sheet { border-radius: var(--app-r-sheet) var(--app-r-sheet) 0 0; }

/* ---------------- 첫 화면 (켤 때 로고) ---------------- */
#apSplash { position: fixed; inset: 0; z-index: 100; background: var(--app-navy); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff;
  transition: opacity .28s ease, visibility .28s; animation: apSplashAuto .3s ease 4s forwards; }
#apSplash.off { opacity: 0; visibility: hidden; }
#apSplash .logo { width: 92px; height: 92px; border-radius: 22.5%; background: linear-gradient(180deg, #33497A, var(--app-navy2)); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
#apSplash .logo svg { width: 56px; height: 56px; }
#apSplash b { font-size: 21px; letter-spacing: -.3px; font-weight: 800; }
#apSplash small { color: #9FB0D0; font-size: 13.5px; margin-top: -8px; }
@keyframes apSplashAuto { to { opacity: 0; visibility: hidden; } }   /* 글이 안 돌아도 4초 뒤 저절로 사라짐 */

/* ---------------- 머리줄 (모든 탭 공통 · PC 연결 줄) ---------------- */
body.ap .top { position: sticky; top: 0; z-index: 12; padding: calc(10px + var(--ap-safe-top)) calc(16px + var(--ap-safe-right)) 12px calc(16px + var(--ap-safe-left)); }
body.ap .top .row { min-height: 40px; }
body.ap .brand { font-size: 22px; }
body.ap .brand small { font-size: 13px; }
body.ap .pill { margin-top: 6px; }
body.ap .hint { margin-top: 4px; font-size: 12.5px; }
body.ap main { padding: 12px calc(12px + var(--ap-safe-right)) calc(var(--app-tabh) + var(--ap-safe-bottom) + 20px) calc(12px + var(--ap-safe-left)); }
body.ap .tiles { display: none; }
body.ap .toast { bottom: calc(var(--app-tabh) + var(--ap-safe-bottom) + 14px); }

/* ---------------- 탭 화면 ---------------- */
.ap-panel { display: none; }
.ap-panel.on { display: block; animation: apIn .18s ease; }
@keyframes apIn { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ap-sec { font-size: 13px; font-weight: 800; color: var(--app-sub); margin: 18px 6px 8px; letter-spacing: .2px; }
.ap-sec:first-child { margin-top: 4px; }

/* ---------------- 아래 탭 막대 ---------------- */
.ap-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 14; background: rgba(255,255,255,.96); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--app-line); display: none; padding: 0 var(--ap-safe-right) var(--ap-safe-bottom) var(--ap-safe-left); }
body.ap.ap-main .ap-tabs { display: flex; }
.ap-tabs .in { display: flex; width: 100%; max-width: 560px; margin: 0 auto; }
.ap-tab { flex: 1; height: var(--app-tabh); background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #8A95AB; font-size: 11.5px; font-weight: 700; position: relative; border-radius: 14px; }
.ap-tab svg { width: 25px; height: 25px; }
.ap-tab.on { color: var(--app-accent); }
.ap-tab.on svg { stroke-width: 2.3; }
.ap-tab i { position: absolute; top: 8px; left: calc(50% + 8px); min-width: 9px; height: 9px; border-radius: 9px; background: var(--app-red); box-shadow: 0 0 0 2px #fff; display: none; }
.ap-tab.ap-dot i { display: block; }
#wmGoResend { display: inline-block; background: var(--app-soft); color: var(--app-a-text); border-radius: 10px; padding: 8px 12px; font-weight: 700; font-size: 14px; }

/* ---------------- 누를 때 반응 ---------------- */
.b, .wm-b, .tile, .chip, .ap-tab, .wm-stat, .wm-mini, .wm-chip, .wm-link, .mrow, .gear, .ap-row, .ap-seg button { transition: transform .08s ease, background-color .12s ease, opacity .12s; }
.b:active, .wm-b:active, .chip:active, .wm-mini:active, .wm-chip:active, .mrow:active, .ap-row:active, .wm-stat:active { transform: scale(.97); }
.ap-tab:active { transform: scale(.92); background: rgba(79,140,255,.08); }
.b:active:not(.pri):not(:disabled), .wm-b:active:not(.pri):not(:disabled) { filter: brightness(.96); }
button:disabled:active { transform: none; }

/* ---------------- 아래에서 올라오는 시트 (확인 · 목록) ---------------- */
.sheetBg { z-index: 40; transition: opacity .2s; }
.sheet { z-index: 41; padding: 10px calc(18px + var(--ap-safe-right)) calc(18px + var(--ap-safe-bottom)) calc(18px + var(--ap-safe-left)); transition: transform .26s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -8px 30px rgba(15,22,40,.18); touch-action: pan-y; }
.sheet .grab { width: 44px; height: 5px; margin: 0 auto 14px; cursor: grab; }
.sheet .btns .b { min-height: 52px; font-size: 16px; }
.sheet.drag { transition: none; }
.sheetBg[style*="none"] + .sheet.on { transform: translateY(105%); }   /* 바탕이 닫히면 시트도 꼭 내려감 */
.wm-pin-bg { z-index: 50 !important; }
.wm-pin { z-index: 51 !important; padding-bottom: calc(14px + var(--ap-safe-bottom)) !important; }
.toast { z-index: 60; }

/* ---------------- (3차) 문구 화면을 문구 탭 안에 ---------------- */
body.ap #msgPage { top: var(--ap-headh); bottom: calc(var(--app-tabh) + var(--ap-safe-bottom)); z-index: 11; }
body.ap #msgPage .mh { padding: 8px 10px; background: var(--app-bg); color: var(--app-text); border-bottom: 1px solid var(--app-line); }
body.ap #msgPage .mh button { color: var(--app-a-text); }
body.ap #msgPage .mh b { font-size: 17px; }
body.ap #msgPage .mf { padding-bottom: 10px; }
body.ap #msgPage.ap-list #msgBack { visibility: hidden; }
body.ap #msgPage.ap-away { display: none !important; }

/* ---------------- 공통 줄 · 카드 (5차 새 카드) ---------------- */
.ap-rows { margin: 2px 0 0; }
.ap-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--app-line); font-size: 15.5px; width: 100%; background: transparent; text-align: left; color: var(--app-text); }
.ap-row:last-child { border-bottom: 0; }
.ap-row span { color: var(--app-sub); font-size: 14.5px; text-align: right; overflow-wrap: anywhere; }
.ap-row.go::after { content: '›'; color: #A9B3C6; font-size: 22px; margin-left: 4px; }
.ap-note { font-size: 13.5px; color: var(--app-sub); margin: 8px 0 0; line-height: 1.5; }
.ap-q { display: flex; gap: 8px; }
.ap-q input { flex: 1; min-width: 0; height: 48px; border: 1.5px solid var(--app-line); border-radius: var(--app-r-btn); padding: 0 14px; font-size: 16px; background: #fff; color: var(--app-text); font-family: inherit; }
.ap-q input:focus { outline: none; border-color: var(--app-accent); }
.ap-q .b { flex: 0 0 84px; }
details.ap-help { border-bottom: 1px solid var(--app-line); }
details.ap-help:last-child { border-bottom: 0; }
details.ap-help summary { list-style: none; padding: 13px 2px; font-size: 15.5px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
details.ap-help summary::-webkit-details-marker { display: none; }
details.ap-help summary::after { content: '+'; color: var(--app-sub); font-size: 20px; font-weight: 600; }
details.ap-help[open] summary::after { content: '−'; }
details.ap-help div { padding: 0 2px 13px; color: var(--app-sub); font-size: 14.5px; line-height: 1.6; }

/* ---------------- 홈 화면에 추가 안내 (브라우저로 열었을 때만) ---------------- */
.ap-a2hs { background: linear-gradient(160deg, #1E2F55, var(--app-navy)); color: #fff; border-radius: var(--app-r-card); padding: 16px 16px 14px; margin-bottom: 12px; box-shadow: 0 6px 20px rgba(22,35,63,.18); }
.ap-a2hs .t { display: flex; align-items: center; gap: 12px; }
.ap-a2hs .t img { width: 44px; height: 44px; border-radius: 22.5%; flex: 0 0 auto; }
.ap-a2hs .t b { display: block; font-size: 17px; letter-spacing: -.2px; }
.ap-a2hs .t small { display: block; color: #AFC0E0; font-size: 13px; margin-top: 2px; }
.ap-a2hs .seg { display: flex; background: rgba(255,255,255,.1); border-radius: 12px; padding: 3px; margin: 14px 0 12px; }
.ap-a2hs .seg button { flex: 1; height: 36px; border-radius: 10px; background: transparent; color: #C9D5EC; font-weight: 700; font-size: 14px; }
.ap-a2hs .seg button.on { background: #fff; color: var(--app-navy); }
.ap-a2hs ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ap-a2hs li { background: rgba(255,255,255,.07); border-radius: 12px; padding: 8px 6px 9px; text-align: center; font-size: 12.5px; line-height: 1.4; color: #DCE5F7; }
.ap-a2hs li svg { display: block; width: 100%; height: auto; margin: 0 auto 6px; }
.ap-a2hs li em { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 9px; background: var(--app-accent); color: #fff; font-style: normal; font-size: 11.5px; font-weight: 800; margin-right: 3px; vertical-align: 1px; }
.ap-a2hs .warn { margin-top: 10px; font-size: 13px; color: #FFE08A; line-height: 1.5; }
.ap-a2hs .x { display: flex; justify-content: flex-end; margin-top: 8px; }
.ap-a2hs .x button { background: transparent; color: #9FB0D0; font-size: 13.5px; font-weight: 700; padding: 6px 4px; }

/* ---------------- 3번째 휴대폰 (이미 2대) ---------------- */
.ap-full { background: var(--app-red-soft); color: var(--app-red); border-radius: 14px; padding: 12px 14px; font-weight: 700; font-size: 15px; margin: 0 0 12px; line-height: 1.5; }
.ap-full small { display: block; color: #8A3B3B; font-weight: 600; font-size: 13.5px; margin-top: 4px; }

/* ---------------- 보여 주기용 가짜 노치 (#demo&notch=1 · 캡처 전용) ---------------- */
.ap-fakebar { position: fixed; left: 0; right: 0; top: 0; height: var(--ap-safe-top); z-index: 90; pointer-events: none; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; color: #fff; font-weight: 700; font-size: 15px; font-family: -apple-system, system-ui, sans-serif; }
.ap-fakebar::after { content: ''; position: absolute; left: 50%; top: 11px; width: 120px; height: 34px; margin-left: -60px; border-radius: 20px; background: #000; }
.ap-fakehome { position: fixed; left: 50%; bottom: 8px; width: 134px; height: 5px; margin-left: -67px; border-radius: 3px; background: #111; z-index: 90; pointer-events: none; }
