/* =====================================================================
 * style.css — Stellar Connect (S:CON) 디자인 시스템
 * 아스트로젠(ASTROGEN) 브랜드 기반 · 디지털 헬스케어
 *
 * 브랜드 원칙
 *  - 컬러: 브랜드 4색 — 신뢰(네이비) · 이해(퍼플) · 연결(블루) · 성장(틸)
 *    (아스트로젠 블루 'Light It Up Blue' 계보를 잇는 연결 블루가 주조색)
 *  - 톤: 과학적 신뢰 × 사람을 향한 따뜻함 ("과학과 사람 사이의 빈틈을 채운다")
 *  - 접근성: 발달장애 아동 양육자 대상 — 큰 터치 영역, 명확한 대비, 차분한 리듬
 * ===================================================================== */

/* ---------- 0. 웹폰트 ----------
   본문 폰트 = Pretendard (2026-08-10 아스트로젠 디자인 의견 반영).
   기존 나눔스퀘어 네오는 자폭이 넓고 개성이 강해 긴 본문의 가독성이 떨어졌다.
   Pretendard는 국문 본문용 표준 고딕으로 개성이 옅고 자간·자폭이 고르다.
   가변 폰트 1개(2MB)로 100~900 전 굵기를 덮어, TTF 5개보다 요청 수가 적다. */
@font-face {
  font-family: 'Pretendard';
  src: url('../fonts/PretendardVariable.woff2') format('woff2-variations');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
/* 나눔스퀘어라운드 — 랜딩 히어로 헤드라인용 둥근 고딕 (인트로 시안 톤) */
@font-face {
  font-family: 'NanumSquareRound';
  src: url('../fonts/NanumSquareRound-EB.ttf') format('truetype');
  font-weight: 700 900; font-style: normal; font-display: swap;
}

/* ---------- 1. 디자인 토큰 ---------- */
:root {
  /* 표면 / 배경 */
  --bg:            #eef2fa;
  --surface:       #ffffff;
  --surface-2:     #eef2fb;
  --surface-3:     #f6f8fd;

  /* 브랜드 컬러 4색 — #신뢰 #이해 #연결 #성장 (브랜드 가이드) */
  --brand-trust:        #1b2a5c;  --brand-trust-soft:      #e8ecf8;
  --brand-understand:   #6c63dd;  --brand-understand-soft: #edebfc;
  --brand-connect:      #4a7bd9;  --brand-connect-soft:    #e8effc;
  --brand-grow:         #2da195;  --brand-grow-soft:       #e0f3f0;

  /* primary 계열 — 연결(Connect) 블루 기반 인터랙션 톤 (기존 변수명 유지) */
  --primary:       #3566cd;
  --primary-dark:  #27479a;
  --primary-deep:  #1b2a5c;
  --primary-soft:  #e8eefb;
  --primary-100:   #d6e2fa;
  --primary-tint:  #f2f6fe;

  /* 액센트 — 성장(Grow) 틸 · 변화와 긍정의 색 */
  --accent:        #2da195;
  --accent-dark:   #15786d;
  --accent-soft:   #ddf2ef;

  /* 잉크 / 텍스트 */
  --text:          #16213f;
  --text-muted:    #586183;
  --text-faint:    #8b95b2;

  /* 라인 */
  --border:        #e3e8f3;
  --border-strong: #cdd6e8;

  /* 카테고리 색상 (설명서 7개 영역) — 브랜드 4색과 정렬 */
  --c-cando:    #1f9d6b;  --c-cando-bg:   #e6f5ee;
  --c-help:     #2b8fc7;  --c-help-bg:    #e3f1f9;
  --c-like:     #d95f93;  --c-like-bg:    #fbe9f1;
  --c-dislike:  #6c63dd;  --c-dislike-bg: #edebfc;   /* 이해 퍼플 */
  --c-problem:  #d68a18;  --c-problem-bg: #fbf0d7;
  --c-comm:     #4a7bd9;  --c-comm-bg:    #e8effc;   /* 연결 블루 */
  --c-routine:  #2da195;  --c-routine-bg: #e0f3f0;   /* 성장 틸 */
  --c-safety:   #d6584e;  --c-safety-bg:  #fbe9e7;   /* 안전 주의사항 */

  /* 컨디션 감정색 — Inside Out 벤치마킹(슬픔 파랑 → 기쁨 노랑 정서 곡선), 입력 피커·표시 칩 공용 */
  --mood-1: #376ca9;  --mood-1-bg: #e9f1fb;  /* 힘들어요 — 슬픔 파랑 */
  --mood-2: #7159b0;  --mood-2-bg: #ede8f9;  /* 아쉬워요 — 소심 보라 */
  --mood-3: #616d76;  --mood-3-bg: #eef1f4;  /* 보통이에요 — 잔잔한 회청 */
  --mood-4: #237851;  --mood-4-bg: #e4f4ec;  /* 좋아요 — 산뜻한 초록 */
  --mood-5: #8a6909;  --mood-5-bg: #fbf3d0;  /* 아주 좋아요 — 기쁨 노랑 */

  /* 감정 카드 색 — Inside Out 캐릭터 벤치마킹 (2차 전용) */
  --emo-joy:    #8a6909;  --emo-joy-bg:    #fbf3d0;  /* 기쁨 — 조이 노랑 */
  --emo-excite: #a74673;  --emo-excite-bg: #fbe7f0;  /* 신남 — 활기 핑크 */
  --emo-calm:   #20776d;  --emo-calm-bg:   #e0f3f0;  /* 평온 — 청록 */
  --emo-sad:    #376ca9;  --emo-sad-bg:    #e9f1fb;  /* 슬픔 — 새드니스 파랑 */
  --emo-anx:    #9c5616;  --emo-anx-bg:    #fbebd9;  /* 불안 — 앤자이어티 주황 */
  --emo-angry:  #b83e33;  --emo-angry-bg:  #fbe7e4;  /* 화남 — 앵거 빨강 */

  /* 상태 색 */
  --ok:     #1f9d6b;
  --warn:   #d68a18;
  --danger: #d6584e;
  /* 연한 붉은 배경 위 '글자'용 — #d6584e는 3.34:1로 AA 미달이라 비활성 버튼처럼 보였다 */
  --danger-ink: #b83b31;
  --info:   #2b8fc7;

  /* 형태 */
  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-xl: 30px;

  /* 그림자 (블루 톤 섞인 깊이감) */
  --shadow-xs: 0 1px 2px rgba(16,30,72,.06);
  --shadow-sm: 0 2px 10px rgba(16,30,72,.07);
  --shadow:    0 4px 16px rgba(16,30,72,.08);
  --shadow-md: 0 10px 30px rgba(16,30,72,.12);
  --shadow-lg: 0 24px 60px rgba(16,30,72,.20);
  --ring:      0 0 0 4px rgba(53,102,205,.16);

  /* 레이아웃 */
  --sidebar-w: 256px;
  --appbar-h:  64px;
  --maxw:      1200px;

  --ease: cubic-bezier(.22,.7,.24,1);
}

/* ---------- 2. 리셋 & 베이스 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic',
               'Noto Sans KR', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
  letter-spacing: -0.003em;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
::selection { background: var(--primary-100); color: var(--primary-deep); }

h1,h2,h3,h4 { line-height: 1.32; font-weight: 800; letter-spacing: -0.022em; color: var(--text); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.26rem; }
h3 { font-size: 1.05rem; }
small { font-size: .82rem; }
b, strong { font-weight: 700; }

/* 가독성(2차 리뷰 §3-④) — 읽기 영역 줄 간격.
   .summary-block ul li·.item-row .txt는 뒤쪽 컴포넌트 규칙(889·823행)이 line-height를 확정하므로
   여기서 제외해 죽은 선언을 없앤다. .kv-card는 존재하지 않는 셀렉터라 삭제.
   한 장 요약 항목 구분선은 889행의 점선 하나로 통일 — 예전 'li + li' 실선이 점선과 겹쳐
   항목마다 이중 구분선이 그려지던 결함을 제거. */
p.muted { line-height: 1.72; }

/* 스크롤바 */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #c6cfe2; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aab6d2; background-clip: content-box; }

/* ---------- 3. 레이아웃 셸 ---------- */
.app-shell { min-height: 100%; display: flex; flex-direction: column; }

.app-bar {
  position: sticky; top: 0; z-index: 40;
  /* 하이브리드: 노치·상태바 안전영역만큼 키 패딩 (웹에서는 0) */
  height: calc(var(--appbar-h) + env(safe-area-inset-top, 0px));
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.6) blur(10px);
  -webkit-backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: env(safe-area-inset-top, 0px) 20px 0;
}
.app-bar .brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.app-bar .brand .mark { width: 36px; height: 36px; flex: none; }
.app-bar .brand .wordmark { display: flex; flex-direction: column; line-height: 1.15; }
.app-bar .brand .wordmark b { font-size: 1.02rem; font-weight: 800; letter-spacing: -.02em; }
.app-bar .brand .wordmark span {
  font-size: .64rem; font-weight: 700; color: var(--primary);
  letter-spacing: .12em; text-transform: uppercase;
}
.app-bar .spacer { flex: 1; }

.child-switch {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 9px 5px 6px;
  font-size: .88rem; font-weight: 700; transition: .16s var(--ease);
}
.child-switch:hover { background: var(--primary-soft); border-color: var(--primary-100); }
.child-switch .avatar { width: 28px; height: 28px; font-size: .78rem; }
.child-switch svg { width: 15px; height: 15px; color: var(--text-faint); }

.usermenu { position: relative; }
.usermenu .trigger {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 9px 5px 6px; border-radius: 999px; transition: .16s var(--ease);
}
.usermenu .trigger:hover { background: var(--surface-2); }
.usermenu .dropdown {
  position: absolute; right: 0; top: calc(100% + 10px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 224px; padding: 8px; z-index: 50;
  animation: popIn .16s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-6px); } }
.usermenu .dropdown button {
  width: 100%; text-align: left; padding: 10px 12px;
  border-radius: var(--radius-sm); font-size: .9rem; font-weight: 600;
  display: flex; align-items: center; gap: 11px; transition: .12s var(--ease);
}
.usermenu .dropdown button:hover { background: var(--primary-soft); color: var(--primary-dark); }
.usermenu .dropdown button svg { color: var(--text-faint); }
.usermenu .dropdown button:hover svg { color: var(--primary); }
.usermenu .dropdown .sep { height: 1px; background: var(--border); margin: 6px 6px; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(140deg, var(--primary), var(--primary-dark));
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: .88rem; flex: none; overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.12);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 58px; height: 58px; font-size: 1.3rem; border-radius: 18px; }
.avatar.xl { width: 86px; height: 86px; font-size: 2rem; border-radius: 26px; }

.app-body { flex: 1; display: flex; }

/* 사이드바 */
.sidebar {
  width: var(--sidebar-w); flex: none;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 18px 14px;
  position: sticky; top: calc(var(--appbar-h) + env(safe-area-inset-top, 0px));
  height: calc(100dvh - var(--appbar-h) - env(safe-area-inset-top, 0px));
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.nav-group-label {
  font-size: .7rem; font-weight: 800; color: var(--text-faint);
  padding: 14px 12px 7px; letter-spacing: .07em; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .93rem; color: var(--text-muted);
  width: 100%; margin-bottom: 3px; transition: .14s var(--ease);
  position: relative;
}
.nav-item svg { width: 19px; height: 19px; flex: none; color: var(--text-faint); transition: .14s var(--ease); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover svg { color: var(--primary); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); }
.nav-item.active svg { color: var(--primary); }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; background: var(--primary); border-radius: 0 4px 4px 0;
}
/* 가입 심사 큐 — SLA 초과 건은 색으로 바로 눈에 띄게 */
.admin-over { color: var(--danger-ink); font-weight: 800; }
/* 제출 서류 뷰어 — 심사 동안만 보관하는 사진 */
.admin-doc {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 8px; text-align: center;
}
.admin-doc img { max-width: 100%; max-height: 46vh; border-radius: 8px; }
/* 백오피스의 .faint는 장식이 아니라 운영 판단에 쓰는 값이다 — 연락처·양육자·경과
   시간·반려 사유·「사진 파기됨」·정책 안내문. --text-faint(#8b95b2)는 흰 배경에서
   2.98:1로 AA 미달이라 운영자가 읽어야 할 정보가 흐렸다 → muted(6.08:1)로 올린다.
   양육자 화면의 .faint는 실제로 보조 장식이라 그대로 둔다 */
#admin-panel .faint { color: var(--text-muted); }

/* 되돌릴 수 없는 처리 전에 '누구를' 처리하는지 모달 안에서 못 박는다 */
.admin-target {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 13px; font-size: .92rem;
}
/* 회원가입 5단계 표시 — 지금 어디까지 왔는지 늘 보이게 (긴 절차의 이탈 방지) */
.su-steps {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin: -4px 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.su-step {
  display: flex; align-items: center; gap: 5px; flex: 1; min-width: 0;
  font-size: .72rem; font-weight: 700; color: var(--text-faint); white-space: nowrap;
}
.su-step b {
  display: grid; place-items: center; flex: none;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-muted); font-size: .68rem;
}
.su-step.on { color: var(--primary-dark); }
.su-step.on b { background: var(--primary); color: #fff; }
.su-step.done { color: var(--text-muted); }
.su-step.done b { background: var(--primary-soft); color: var(--primary-dark); }
/* 가입은 법적 고지 문구가 담기는 화면이라 본문 대비를 AA(4.5:1) 위로 올린다.
   --text-faint는 흰 배경에서 2.98:1이라 이 화면에서는 쓰지 않는다. */
.su-card .faint, .su-step, .su-pwmsg, .su-docprev p { color: var(--text-muted); }
.su-card .req { color: #b3352c; font-weight: 800; }
/* 전체 동의 — .checkline의 padding:8px 0가 덮어써 안쪽 여백이 사라져 있었다(구체도 상향) */
.checkline.su-all {
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 13px 14px; margin-bottom: 2px;
}
/* 동의 항목 터치 타깃 44px 확보 (짧은 문구 줄이 41px로 떨어졌었다) */
.su-c, .su-all { min-height: 44px; }
/* .checkline이 뒤에서 align-items:center를 덮어써, 2~3줄 항목에서 체크박스가
   글 한가운데로 내려가 있었다 → 구체도를 높여 첫 줄에 맞춘다 */
.checkline.su-c { align-items: flex-start; padding: 12px 2px; gap: 12px; }
/* 항목끼리 간격이 0이라 어디까지가 한 항목인지 흐렸다 → 헤어라인으로 경계를 준다 */
.checkline.su-c + .checkline.su-c { border-top: 1px solid var(--border); }
.checkline.su-c input { margin-top: 1px; width: 20px; height: 20px; }
/* 필수 / 선택 그룹 구분 — 법적으로도 구분이 분명해야 한다 */
.su-optcap {
  margin: 14px 0 2px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: .78rem; font-weight: 800; color: var(--text-muted); letter-spacing: .02em;
}
.su-optcap + .checkline.su-c { border-top: 0; }
.su-next { margin-top: 22px; }
/* .field label의 display:block이 .btn의 inline-flex를 덮어써 아이콘과 파일명이
   두 줄로 쌓였다 → 파일 선택 버튼만 구체도를 높여 한 줄로 */
.field label.su-docbtn { display: inline-flex; }

/* 서류 사진 미리보기 — 흐린 사진을 제출 전에 알아차리게 */
.su-docprev { margin-bottom: 8px; }
.su-docprev.hide { display: none; }
.su-docprev img {
  display: block; width: 100%; max-height: 190px; object-fit: contain;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.su-docprev p { margin: 6px 0 0; font-size: .8rem; color: var(--text-muted); line-height: 1.55; }
.su-docprev p b { color: var(--text); }
/* 촬영 안내 — 반려 사유 1순위가 '판독 불가'라, 찍기 전에 짚어 주는 자리 */
.su-tips {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.su-tips-h {
  display: flex; align-items: center; gap: 7px;
  font-size: .84rem; font-weight: 800; color: var(--text); margin-bottom: 7px;
}
.su-tips-h svg { color: var(--primary); flex: none; }
/* 전역 ul은 list-style:none이라, 항목이 구분되도록 체크 표시를 직접 붙인다 */
.su-tips ul { margin: 0; padding: 0; }
.su-tips li {
  position: relative; padding: 2px 0 2px 21px;
  font-size: .81rem; color: var(--text-muted); line-height: 1.65;
}
.su-tips li::before {
  content: ''; position: absolute; left: 3px; top: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}
.su-tips li b { color: var(--text); font-weight: 700; }
/* 파일명이 길어도 버튼 밖으로 밀리지 않게 */
.su-docfile { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* 비밀번호 조건·일치 실시간 안내 */
.su-pwmsg { margin: 6px 0 0; font-size: .78rem; color: var(--text-faint); min-height: 1em; }
.su-pwmsg.ok { color: var(--ok, #1d8a5b); font-weight: 700; }
.su-pwmsg.warn { color: var(--danger-ink); font-weight: 700; }

@media (max-width: 520px) {
  /* 번호만 남기지 않는다 — 지금이 무슨 단계인지는 늘 읽혀야 한다 */
  .su-step { font-size: 0; gap: 0; flex: none; }
  .su-step b { font-size: .68rem; }
  .su-step.on { flex: 1; font-size: .74rem; gap: 5px; }
}

/* 아이 미등록 — 메뉴는 보이되 잠금. 클릭하면 등록 화면으로 안내한다(무반응 금지) */
.nav-item.locked { opacity: .45; cursor: default; text-align: left; }
.nav-item.locked:hover { background: none; color: var(--text-muted); }
.nav-item.locked:hover svg { color: var(--text-faint); }
.nav-item.locked svg:last-child { margin-left: auto; width: 13px; height: 13px; }
.nav-item.locked:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sidebar .side-foot {
  margin-top: auto; padding: 14px 12px 4px; font-size: .72rem;
  color: var(--text-faint); line-height: 1.5;
}
.sidebar .side-foot b { color: var(--primary); font-weight: 800; letter-spacing: .04em; }
/* 메뉴가 하나뿐인 심사자 사이드바의 빈 공간 — 권한 범위를 알려주는 자리로 쓴다 */
.sidebar .side-note {
  display: flex; gap: 9px; margin: 14px 4px 0; padding: 12px 13px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: .78rem; line-height: 1.6;
  color: var(--text-muted);
}
.sidebar .side-note b { color: var(--text); }
.sidebar .side-note svg { flex: none; color: var(--primary); margin-top: 1px; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.container { max-width: var(--maxw); margin: 0 auto; width: 100%; padding: 28px 24px 40px; }
.container.narrow { max-width: 780px; }
.app-foot {
  border-top: 1px solid var(--border); padding: 18px 24px;
  text-align: center; font-size: .78rem; color: var(--text-faint);
}
.app-foot b { color: var(--primary); font-weight: 800; letter-spacing: .05em; }

/* 뷰 전환 애니메이션 */
.view-anim { animation: viewIn .34s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }

/* 하단 탭바 (모바일) */
.bottom-nav { display: none; }

/* ---------- 4. 페이지 헤더 ---------- */
.page-head { margin-bottom: 22px; }
.page-head .eyebrow {
  font-size: .76rem; font-weight: 800; color: var(--primary);
  text-transform: uppercase; letter-spacing: .08em;
}
.page-head h1 { margin-top: 5px; }
.page-head p { color: var(--text-muted); margin-top: 7px; font-size: .95rem; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-faint); margin-bottom: 10px; }
.breadcrumb a:hover { color: var(--primary); }

/* ---------- 5. 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 19px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .92rem; white-space: nowrap;
  border: 1.5px solid transparent;
  transition: transform .08s var(--ease), background .16s var(--ease),
              box-shadow .16s var(--ease), border-color .16s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 14px rgba(53,102,205,.30);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 6px 20px rgba(53,102,205,.38); }
.btn-accent {
  background: linear-gradient(135deg, var(--accent), #15786d); color: #fff;
  box-shadow: 0 4px 14px rgba(45,161,149,.38);
}
.btn-accent:hover { filter: brightness(1.06); box-shadow: 0 6px 20px rgba(45,161,149,.48); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--primary-100); }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn-soft:hover { background: var(--primary-100); }
.btn-danger { background: #fbe9e7; color: var(--danger-ink); }
.btn-danger:hover { background: #f6d6d2; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 13px; font-size: .85rem; border-radius: 9px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon {
  width: 38px; height: 38px; padding: 0; border-radius: 10px;
  background: var(--surface-2); color: var(--text-muted);
  transition: .14s var(--ease);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--primary-soft); color: var(--primary); }
/* 인라인 아이콘 baseline 정렬 — SVG가 텍스트 중심에 오도록 (아이콘 높이 어긋남 방지) */
svg { vertical-align: middle; }
.btn svg, .btn-icon svg { display: block; }

/* ---------- 6. 카드 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.card-head {
  padding: 17px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 11px;
}
.card-head h3 { flex: 1; }
/* 카드 헤더 아이콘 — 인라인 span을 아이콘에 딱 맞춰 h3와 수직 중앙 정렬 */
.card-head > span { display: inline-flex; align-items: center; flex: none; }
.card-body { padding: 22px; }
/* minmax(0,1fr): 자식의 min-content(특히 nowrap 텍스트)가 트랙을 밀어내
   가로 오버플로를 일으키지 않도록 — 모바일 레이아웃 뷰포트 확장 방지 */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------- 7. 폼 ---------- */
.field { margin-bottom: 17px; }
.field label, .field-label {
  display: block; font-weight: 700; font-size: .87rem;
  margin-bottom: 7px; color: var(--text);
}
.field .hint { font-size: .8rem; color: var(--text-faint); margin-top: 5px; }
.req { color: var(--danger-ink); }
.input, .textarea, .select {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
/* 단일 행 컨트롤(텍스트·숫자·날짜·셀렉트)은 높이를 통일 — native 기본 높이 차이 제거, 터치 타깃 44px+ */
.input, .select { min-height: 46px; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary); box-shadow: var(--ring); outline: none;
}
.input:hover, .textarea:hover, .select:hover { border-color: var(--border-strong); }
.textarea { resize: vertical; min-height: 92px; line-height: 1.58; }
.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23586183' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.field-row { display: flex; gap: 14px; }
.field-row > * { flex: 1; }
/* 동적 입력 행 — 라벨 있는 필드는 컬럼 셀로 정렬(행렬 유지), 없는 필드는 인라인 */
.dyn-row { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 10px; align-items: flex-end; }
.dyn-cell { display: flex; flex-direction: column; gap: 4px; min-width: 118px; }
.dyn-cell .dyn-lbl { font-size: .72rem; font-weight: 700; color: var(--text-muted); padding-left: 2px; white-space: nowrap; }
.dyn-cell .input, .dyn-cell .select { width: 100%; }
.dyn-cell .input[type="date"] { min-width: 150px; }
/* 삭제 버튼 — 옆 입력창(46px)과 높이를 맞춰 수직 정렬 (약물·알레르기·연락처 공통) */
.dyn-del { flex: none; align-self: flex-end; width: 46px; height: 46px; }
.checkline { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.checkline input { width: 19px; height: 19px; accent-color: var(--primary); flex: none; }
.seg {
  display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 5px; gap: 6px; border: 1px solid var(--border); flex-wrap: wrap;
}
.seg button {
  padding: 8px 15px; border-radius: 8px; font-weight: 700; font-size: .85rem;
  color: var(--text-muted); transition: .14s var(--ease);
  min-height: 38px;   /* 터치 타깃 보정 (375에서 31px로 측정됨) */
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--primary-dark); box-shadow: var(--shadow-xs); }
/* 건수는 라벨에 딸린 값이다 — 그냥 띄어쓰기로 붙이면 항목 사이 간격과 똑같아져
   («활성 2 심사 대기 0») 어디까지가 한 항목인지 읽히지 않는다 */
.seg .seg-n {
  font-size: .78rem; font-weight: 800; color: var(--text-muted);
  background: var(--surface); border-radius: 999px; padding: 1px 7px; min-width: 20px;
  text-align: center;
}
.seg button.on .seg-n { background: var(--primary-soft); color: var(--primary-dark); }
.seg button.zero .seg-n { opacity: .55; }

/* ---------- 8. 배지 / 칩 / 태그 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted);
  /* 배지는 한 덩어리 라벨이다 — 좁은 폭에서 「변화 / 기록」으로 갈라지면
     두 개처럼 보인다(아스트로젠 디자인 의견 3) */
  white-space: nowrap;
}
.badge.ok      { background: var(--c-cando-bg); color: #157a51; }
.badge.warn    { background: var(--c-problem-bg); color: #9a6207; }
.badge.danger  { background: #fbe9e7; color: var(--danger-ink); }
.badge.info    { background: var(--c-help-bg); color: #1d6f9e; }
.badge.brand   { background: var(--primary-soft); color: var(--primary-dark); }
.badge.by-team { background: var(--c-dislike-bg); color: var(--c-dislike); }  /* 케어팀 팀원이 남긴 기록 */
.badge.dot::before { content:''; width:6px; height:6px; border-radius:50%; background: currentColor; }
.tag {
  display: inline-block; font-size: .75rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-muted);
  padding: 2px 9px; border-radius: 7px; margin: 2px 4px 2px 0;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; font-size: .85rem; font-weight: 700;
  background: var(--surface-2); border: 1.5px solid transparent;
  color: var(--text-muted); transition: .14s var(--ease); white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.sm { padding: 4px 10px; font-size: .78rem; gap: 4px; }

/* 약물 항목 = 입력 행 + 빠른 입력 줄 */
/* ---------- 약물 항목 = 카드형 서브블록 ----------
   헤더(번호+삭제) / 필드 3줄 그리드 / 빠른 입력 푸터.
   삭제는 헤더 오른쪽 — '이 카드 전체 삭제'가 명확. 번호는 counter로 자동(삭제 시 재번호) */
#med-rows { counter-reset: med; }
.med-item {
  counter-increment: med;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-3); padding: 12px 14px 12px; margin-bottom: 12px;
}
.med-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.med-num {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .8rem; font-weight: 800; color: var(--primary-dark);
}
.med-num::after { content: ' ' counter(med); }
.med-del {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  width: auto; height: 34px;                       /* .dyn-del의 46×46 고정 크기 무효화 */
  font-size: .78rem; font-weight: 700; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 0 12px;
  transition: .14s var(--ease);
}
.med-del:hover { color: var(--danger); border-color: var(--danger); background: #fbe9e7; }
.med-del:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 필드 3줄 그리드: ①구분·약이름·용량·단위 ②복용시간·시작일·종료일 ③복용정보·메모 */
.med-item .dyn-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px 10px; align-items: end; }
.med-item .dyn-row .dyn-cell { min-width: 0; }
.med-item .dyn-row .dyn-cell .dyn-lbl { overflow: hidden; text-overflow: ellipsis; }
.med-item .dyn-row .dyn-cell .input, .med-item .dyn-row .dyn-cell .select { width: 100%; min-width: 0; }
.med-item .dyn-row .dyn-cell .input[type="date"] { min-width: 0; }
.med-item .dyn-row > .dyn-cell:nth-child(1) { grid-column: span 3; }   /* 구분 — 셀렉트 화살표 패딩(36px) 때문에 2칸이면 '처방약'이 잘림 */
.med-item .dyn-row > .dyn-cell:nth-child(2) { grid-column: span 4; }   /* 약 이름 */
.med-item .dyn-row > .dyn-cell:nth-child(3) { grid-column: span 2; }   /* 용량 (숫자라 좁아도 충분) */
.med-item .dyn-row > .dyn-cell:nth-child(4) { grid-column: span 3; }   /* 단위 */
.med-item .dyn-row > .dyn-cell:nth-child(5) { grid-column: span 4; }   /* 복용 시간 */
.med-item .dyn-row > .dyn-cell:nth-child(6) { grid-column: span 4; }   /* 시작일 */
.med-item .dyn-row > .dyn-cell:nth-child(7) { grid-column: span 4; }   /* 종료일 */
.med-item .dyn-row > .dyn-cell:nth-child(8) { grid-column: span 6; }   /* 복용 정보 */
.med-item .dyn-row > .dyn-cell:nth-child(9) { grid-column: span 6; }   /* 보호자 메모 */
@media (max-width: 640px) {
  .med-item .dyn-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .med-item .dyn-row > .dyn-cell:nth-child(2) { grid-column: span 3; }  /* 약 이름 (구분 3칸과 한 줄) */
  .med-item .dyn-row > .dyn-cell:nth-child(3) { grid-column: span 3; }  /* 용량 */
  .med-item .dyn-row > .dyn-cell:nth-child(5) { grid-column: span 6; }  /* 복용 시간 */
  .med-item .dyn-row > .dyn-cell:nth-child(6) { grid-column: span 3; }  /* 시작일 */
  .med-item .dyn-row > .dyn-cell:nth-child(7) { grid-column: span 3; }  /* 종료일 */
  .med-del { height: 42px; }   /* 모바일 터치 타깃 */
}
/* 빠른 입력 푸터 — 필드와 점선으로 구분 */
.med-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.med-quick .mq-lbl { font-size: .74rem; font-weight: 700; color: var(--text-faint); margin-right: 2px; }
/* 오늘의 복약 — 아코디언 헤더 + 시간대 버튼으로 기록·취소 */
.med-acc-head { cursor: pointer; user-select: none; }
.med-acc-head:hover { background: var(--surface-3); }
.med-acc-head .badge { margin-left: 4px; }
/* 카드 제목은 좁은 폭에서도 접히지 않게 (「오늘의 / 복약」으로 갈라지던 문제) */
.card-head h3.nw { white-space: nowrap; }
.acc-chev { display: inline-flex; color: var(--text-faint); transition: transform .18s var(--ease); margin-left: 8px; }
.acc-chev.open { transform: rotate(180deg); }
.med-log-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--border); }
.med-log-row:last-of-type { border-bottom: none; }
.med-log-row .txt { flex: 1; min-width: 120px; font-size: .92rem; }
.med-log-row .slot-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.slot-chip {
  min-height: 36px; padding: 6px 12px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; transition: .14s var(--ease);
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text-muted);
}
.slot-chip.todo { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }
.slot-chip.todo:hover { background: var(--primary); color: #fff; }
.slot-chip.done { border-color: transparent; background: var(--c-cando-bg); color: #157a51; }
.slot-chip.done:hover { border-color: var(--danger); color: var(--danger); background: #fbe9e7; }
.slot-chip.off { opacity: .35; cursor: default; }
.slot-chip .sc-time { font-weight: 400; font-size: .72rem; opacity: .85; }

/* 기록 추가 — 프로필 약물 선택 삽입 패널 */
.med-picker { margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-3); }
.med-picker .mp-list { display: flex; flex-direction: column; gap: 2px; }
.med-picker .badge { margin-right: 2px; }
/* 빈 상태 안내 — 약물·알레르기·비상연락에 항목이 하나도 없을 때 */
#med-rows:empty::before, #allg-rows:empty::before, #ct-rows:empty::before {
  content: attr(data-empty); display: block;
  color: var(--text-faint); font-size: .85rem; padding: 2px 2px 10px;
}

/* 아이 컨텍스트바 칩 스크롤러 — 스크롤바 숨김 + 터치 모멘텀 */
.ctx-chips {
  display: flex; gap: 6px; max-width: 100%;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding: 2px;
}
.ctx-chips::-webkit-scrollbar { display: none; }
.ctx-chips .chip { flex: none; }

/* ---------- 9. 통계 카드 ---------- */
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden; transition: .16s var(--ease);
}
.stat:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat .label { font-size: .82rem; color: var(--text-muted); font-weight: 700; }
.stat .value { font-size: 1.8rem; font-weight: 800; margin-top: 5px; letter-spacing: -.03em; color: var(--text); }
.stat .value small { font-size: .88rem; color: var(--text-muted); font-weight: 700; }
.stat .ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); float: right;
}
.stat .ico svg { width: 21px; height: 21px; }
/* 관리자 지표는 눌러서 그 건들이 있는 화면으로 가는 입구다 */
a.stat-link { display: block; text-decoration: none; color: inherit; }
a.stat-link:hover { border-color: var(--primary); }
a.stat-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 값이 0이 아닐 때만 색을 준다 — 늘 빨간 대시보드는 아무도 보지 않는다 */
.stat-warn { border-color: var(--warn); }
.stat-warn .value { color: #9a6207; }
.stat-warn .ico { background: var(--c-problem-bg); color: #9a6207; }
.stat-danger { border-color: var(--danger); }
.stat-danger .value { color: var(--danger-ink); }
.stat-danger .ico { background: #fbe9e7; color: var(--danger-ink); }
.sec-title {
  font-size: .84rem; font-weight: 800; color: var(--text-muted);
  letter-spacing: .02em; margin: 4px 0 10px;
  display: flex; align-items: center; gap: 8px;
}

/* ---------- 10. 빈 상태 ---------- */
.empty { text-align: center; padding: 54px 24px; color: var(--text-muted); }
.empty .emoji {
  font-size: 2rem; width: 78px; height: 78px; margin: 0 auto 4px;
  display: grid; place-items: center; border-radius: 26px;
  background: var(--primary-tint); border: 1px solid var(--border);
}
.empty h3 { margin: 14px 0 6px; color: var(--text); }
.empty p { font-size: .92rem; margin-bottom: 18px; }

/* ---------- 11. 랜딩 ---------- */
.landing { background: var(--surface); }
.lp-bar {
  position: sticky; top: 0; z-index: 40;
  height: calc(66px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 12px;
  padding: env(safe-area-inset-top, 0px) 24px 0;
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.lp-section { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.hero {
  position: relative; overflow: hidden;
  /* 드리미 파스텔 — 페리윙클 그라데이션 + 이해(퍼플)·성장(틸) 빛 번짐
     + 우측 웜 크림 글로우 (아이들 일러스트가 자연스럽게 앉는 자리) */
  background:
    radial-gradient(680px 520px at 82% 46%, rgba(255,247,230,.92), transparent 68%),
    radial-gradient(950px 520px at 86% 6%, rgba(108,99,221,.16), transparent 62%),
    radial-gradient(760px 460px at 6% 96%, rgba(45,161,149,.16), transparent 60%),
    radial-gradient(1200px 640px at 50% -28%, rgba(255,255,255,.72), transparent 62%),
    linear-gradient(163deg, #e7edfc 0%, #ccd8f7 44%, #b3c2ef 78%, #a8b5e9 100%);
  color: var(--text);
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; padding: 76px 24px 86px; position: relative; z-index: 2; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 800; letter-spacing: .04em;
  color: var(--primary-dark); background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.9);
  padding: 7px 14px; border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(31,42,92,.08);
}
.hero h1 {
  font-family: 'NanumSquareRound', 'Pretendard', sans-serif;
  color: var(--brand-trust); font-size: 2.7rem; line-height: 1.26;
  margin: 22px 0 18px; max-width: 660px; letter-spacing: -.02em;
}
.hero h1 .em {
  background: linear-gradient(92deg, var(--brand-understand) 4%, var(--primary) 48%, var(--brand-grow) 96%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.hero p { font-size: 1.1rem; max-width: 545px; color: #39477f; line-height: 1.66; }
.hero p b { color: var(--brand-trust); }
.hero .cta { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn-ghost {
  background: rgba(255,255,255,.66); border-color: rgba(255,255,255,.95);
  color: var(--primary-dark);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero .btn-ghost:hover { background: #fff; border-color: #fff; }
.hero .trust {
  margin-top: 30px; display: flex; gap: 20px; flex-wrap: wrap;
  font-size: .85rem; font-weight: 600; color: #44518e;
  max-width: 560px;   /* 우측 일러스트와 겹치지 않게 */
}
.hero .trust span { display: flex; align-items: center; gap: 7px; }
.hero .trust svg { width: 16px; height: 16px; color: #1f8d81; }
.hero-spark { position: absolute; color: rgba(255,255,255,.85); z-index: 1;
  filter: drop-shadow(0 0 6px rgba(124,134,220,.6)); }
.hero-spark.hs-heart { color: #f2a9c4; filter: drop-shadow(0 0 6px rgba(242,169,196,.6)); }
/* 인트로 시안 일러스트 — 풀밭 위 두 아이 (가장자리는 페더 마스크로 배경에 녹임) */
.hero-illust {
  position: absolute; right: -14px; top: 50%; transform: translateY(-50%);
  width: min(500px, 40vw); z-index: 1; pointer-events: none;
}
.hero-illust img {
  width: 100%; height: auto; display: block;
  -webkit-mask-image: radial-gradient(70% 72% at 50% 54%, #000 42%, transparent 88%);
  mask-image: radial-gradient(70% 72% at 50% 54%, #000 42%, transparent 88%);
}

.section { padding: 76px 0; }
.section.tint { background: var(--surface-3); }
/* 라이트 섹션 공통 — 은은한 브랜드 글로우 (톤앤매너 통일) */
.glow-sec {
  background:
    radial-gradient(640px 320px at 12% 0%, rgba(108,99,221,.07), transparent 60%),
    radial-gradient(560px 300px at 90% 100%, rgba(45,161,149,.07), transparent 60%),
    #ffffff;
}
.glow-sec.alt {
  background:
    radial-gradient(640px 320px at 88% 0%, rgba(74,123,217,.09), transparent 60%),
    radial-gradient(540px 300px at 8% 100%, rgba(108,99,221,.07), transparent 60%),
    var(--surface-3);
}
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head .eyebrow {
  font-size: .78rem; font-weight: 800; color: var(--primary);
  text-transform: uppercase; letter-spacing: .08em;
}
.section-head h2 {
  font-size: 1.92rem; margin-top: 8px; letter-spacing: -.03em;
  color: var(--brand-trust);
}
.section-head p { color: var(--text-muted); margin-top: 12px; font-size: 1.02rem; }

.feature-card {
  padding: 26px; border-radius: var(--radius-lg);
  transition: .18s var(--ease); height: 100%;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.feature-card .ico {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--primary), var(--primary-dark));
  color: #fff; margin-bottom: 15px; box-shadow: 0 6px 16px rgba(53,102,205,.28);
}
/* 8가지 약속 아이콘 — 브랜드 4색(신뢰·이해·연결·성장) 순환 */
.grid .feature-card:nth-child(4n+1) .ico {
  background: linear-gradient(140deg, #33457e, var(--brand-trust));
  box-shadow: 0 6px 16px rgba(27,42,92,.30);
}
.grid .feature-card:nth-child(4n+2) .ico {
  background: linear-gradient(140deg, #837bea, var(--brand-understand));
  box-shadow: 0 6px 16px rgba(108,99,221,.32);
}
.grid .feature-card:nth-child(4n+3) .ico {
  background: linear-gradient(140deg, #6590e2, var(--brand-connect));
  box-shadow: 0 6px 16px rgba(74,123,217,.32);
}
.grid .feature-card:nth-child(4n+4) .ico {
  background: linear-gradient(140deg, #45b5a8, var(--brand-grow));
  box-shadow: 0 6px 16px rgba(45,161,149,.32);
}
.feature-card .ico svg { width: 26px; height: 26px; }
.feature-card h3 { margin-bottom: 7px; font-size: 1.1rem; }
.feature-card p { color: var(--text-muted); font-size: .92rem; }

.steps { counter-reset: s; display: grid; gap: 8px; }
.step {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px; border-radius: var(--radius); transition: .16s var(--ease);
}
.step:hover { background: var(--surface-3); }
.step .num {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: linear-gradient(140deg, var(--sn1, #6590e2), var(--sn2, var(--primary)));
  color: #fff;
  display: grid; place-items: center; font-size: 1.05rem; font-weight: 800;
  box-shadow: 0 5px 12px -4px var(--sn2, var(--primary));
}
.step h4 { font-size: 1.02rem; margin-bottom: 3px; }
.step p { font-size: .9rem; color: var(--text-muted); }

.quote-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 26px;
  box-shadow: var(--shadow-sm); height: 100%;
}
.quote-card .qmark { font-size: 2.6rem; line-height: .5; color: var(--primary-100); font-weight: 800; }
.quote-card p { margin-top: 14px; font-size: 1.02rem; color: var(--text); line-height: 1.62; }
.quote-card .who { margin-top: 14px; font-size: .85rem; color: var(--text-faint); font-weight: 600; }

.mission {
  /* 비비드 브랜드 그라데이션 — 이해(퍼플) → 연결(블루) → 성장(틸) */
  background:
    radial-gradient(720px 380px at 90% -10%, rgba(255,255,255,.22), transparent 58%),
    radial-gradient(560px 320px at 4% 110%, rgba(20,32,72,.30), transparent 62%),
    linear-gradient(116deg, #6c63dd 0%, #4470d6 50%, #2aa093 100%);
  color: #fff; border-radius: var(--radius-xl); padding: 56px 48px;
  position: relative; overflow: hidden;
  box-shadow: 0 24px 60px -18px rgba(76,98,200,.45);
}
.mission .eyebrow { color: #e7fcf8; font-weight: 800; letter-spacing: .06em; font-size: .8rem; }
.mission h2 { color: #fff; font-size: 1.9rem; margin: 12px 0 16px; letter-spacing: -.03em; }
.mission p { color: #f0f4ff; font-size: 1.04rem; max-width: 620px; line-height: 1.72; }
.mission .pills { margin-top: 26px; display: flex; gap: 10px; flex-wrap: wrap; }
.mission .pill {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.38);
  padding: 9px 16px; border-radius: 999px; font-size: .88rem; font-weight: 700;
}

.lp-foot {
  /* 깊은 인디고 그라데이션 — 퍼플·틸 기운 (플랫 네이비 탈피) */
  background:
    radial-gradient(620px 280px at 88% 0%, rgba(108,99,221,.26), transparent 60%),
    radial-gradient(520px 260px at 6% 100%, rgba(45,161,149,.20), transparent 60%),
    linear-gradient(135deg, #232a58 0%, #1f2a5e 52%, #173f4d 100%);
  color: #9fadd4; padding: 44px 24px 36px;
  border-top: 4px solid;
  border-image: linear-gradient(90deg, var(--brand-understand),
    var(--brand-connect), var(--brand-grow)) 1;
}
.lp-foot .inner { max-width: var(--maxw); margin: 0 auto; }
.lp-foot .row-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.lp-foot b { color: #fff; }
.lp-foot .fnav { display: flex; gap: 18px; flex-wrap: wrap; font-size: .88rem; }
.lp-foot .fnav a:hover { color: #fff; }
.lp-foot .copyright { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); font-size: .8rem; }

/* ---------- 12. 아이 카드 ---------- */
.child-card {
  display: flex; gap: 15px; align-items: center; min-width: 0;
  padding: 19px; transition: box-shadow .16s var(--ease), transform .08s var(--ease), border-color .16s var(--ease);
  text-align: left;
}
.child-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--primary-100); cursor: pointer; }
.child-card:active { transform: translateY(0); }
.child-card .meta { flex: 1; min-width: 0; }
.child-card .meta .nm { font-weight: 800; font-size: 1.06rem; }
.child-card .meta .sub { font-size: .84rem; color: var(--text-muted); }
.child-card > svg { color: var(--text-faint); flex: none; }

/* ---------- 13. 사용 설명서 편집 ---------- */
.manual-tabs {
  display: flex; gap: 2px; overflow-x: auto; padding-bottom: 2px;
  margin-bottom: 20px; border-bottom: 2px solid var(--border);
  scrollbar-width: none;
}
.manual-tabs::-webkit-scrollbar { display: none; }
.manual-tab {
  padding: 12px 16px; font-weight: 700; font-size: .9rem; white-space: nowrap;
  color: var(--text-muted); border-bottom: 3px solid transparent; margin-bottom: -2px;
  display: flex; align-items: center; gap: 8px; transition: .14s var(--ease);
}
.manual-tab:hover { color: var(--text); }
.manual-tab .dot { width: 9px; height: 9px; border-radius: 50%; }
.manual-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.manual-tab .num {
  font-size: .72rem; background: var(--surface-2); border-radius: 999px;
  padding: 1px 8px; font-weight: 800; color: var(--text-muted);
}
.manual-tab.active .num { background: var(--primary-soft); color: var(--primary-dark); }

.sec-head { display: flex; align-items: center; gap: 13px; }
.sec-head .sec-ico {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none;
}
.sec-head .sec-ico svg { width: 23px; height: 23px; }
.sec-head h2 { font-size: 1.14rem; }
.sec-head p { font-size: .86rem; color: var(--text-muted); margin-top: 1px; }

.item-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.item-row:last-of-type { border-bottom: none; }
.item-row .bullet {
  width: 24px; height: 24px; border-radius: 8px; flex: none; margin-top: 1px;
  display: grid; place-items: center; color: #fff;
}
.item-row .bullet svg { width: 13px; height: 13px; }
.item-row .txt { flex: 1; line-height: 1.72; }
.item-row .txt .resp { color: var(--text-muted); font-size: .9rem; margin-top: 3px; }
.item-actions { display: flex; gap: 2px; margin-left: auto; flex: none; opacity: 0; transition: .14s var(--ease); }
.item-actions .btn-icon {
  width: 34px; height: 34px; background: transparent; color: var(--text-faint);
}
.item-actions .btn-icon:hover,
.item-actions .btn-icon:focus-visible { background: var(--surface-2); color: var(--text-muted); }
.item-row:hover .item-actions { opacity: 1; }
/* 터치 기기(hover 불가)·키보드 포커스에서도 편집/삭제 접근 가능하게 — hover 의존 금지 */
@media (hover: none) { .item-actions { opacity: 1; } }
.item-row:focus-within .item-actions { opacity: 1; }
/* 복용 중인 약물 목록은 항상 조작 버튼이 보여야 함 (2026-07-14 사용자 요청) */
.med-row .item-actions { opacity: 1; }

.add-item { display: flex; gap: 9px; margin-top: 14px; align-items: flex-start; }
.add-item .input, .add-item .textarea { flex: 1; }
.plan-area-select { flex: none; width: auto; min-width: 164px; }  /* '재정·법적 준비' 99px + 패딩 50px */
/* 셀렉트는 좌 14 + 우 36(화살표) = 50px가 패딩이라, 내용 폭 + 50 이상이어야 안 잘린다 */
.plan-term-select { flex: none; width: auto; min-width: 126px; }
/* select(고정폭)+입력+버튼 조합은 좁은 화면에서 입력칸이 짓눌림 — 모바일엔 세로로 쌓아 입력칸을 충분히 넓게 */
@media (max-width: 560px) {
  .add-item-select { flex-wrap: wrap; }
  .add-item-select select,
  .add-item-select input,
  .add-item-select button { width: 100%; flex: none; }
}

/* ---------- 14. 한 장 요약 (서포트북) ---------- */
.summary-sheet {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  overflow: hidden;
}
.summary-sheet .sheet-top {
  background:
    radial-gradient(420px 200px at 92% -20%, rgba(45,161,149,.40), transparent 65%),
    linear-gradient(135deg, #4a7bd9, #1f3a7e);
  color: #fff; padding: 28px 30px; display: flex; gap: 18px; align-items: center;
  position: relative;
}
.summary-sheet .sheet-top .avatar { background: rgba(255,255,255,.2); }
.summary-sheet .sheet-top h2 { color: #fff; font-size: 1.45rem; }
.summary-sheet .sheet-top .sub { color: #d3e0ff; font-size: .9rem; margin-top: 2px; }
.summary-sheet .sheet-top .brand-tag {
  position: absolute; right: 26px; top: 22px;
  font-size: .68rem; font-weight: 800; letter-spacing: .12em;
  color: rgba(255,255,255,.7);
}
.summary-sheet .sheet-top .sheet-print {
  position: absolute; right: 24px; bottom: 20px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.55);
  color: #fff; padding: 7px 13px; border-radius: 9px;
  font-size: .82rem; font-weight: 700; min-height: 36px; transition: .14s var(--ease);
}
.summary-sheet .sheet-top .sheet-print:hover { background: rgba(255,255,255,.3); }
.summary-sheet .sheet-body { padding: 28px 30px; }
.summary-note {
  background: var(--brand-understand-soft); border: 1px solid #d9d4f8;
  border-radius: var(--radius); padding: 16px 18px;
  font-size: .96rem; color: #45408f; margin-bottom: 22px; line-height: 1.6;
  display: flex; gap: 9px;
}
.summary-note svg { flex: none; margin-top: 2px; color: var(--brand-understand); }
/* 진단 정보부터 보호자 한마디까지가 한 덩어리 텍스트로 읽히던 문제
   (아스트로젠 디자인 의견 4) — 블록 사이에 여백과 헤어라인으로 구획을 만든다.
   첫 블록은 위에 선을 긋지 않는다(응급 카드 바로 아래라 선이 겹쳐 보인다). */
.summary-block { padding-top: 22px; margin-bottom: 4px; break-inside: avoid; }
.summary-block + .summary-block,
.summary-cols + .summary-block { border-top: 1px solid var(--border); }
/* 첫 블록만 위 여백을 줄인다 — 응급 카드 바로 아래라 선이 겹쳐 보인다.
   2열 묶음(좋아해요·싫어해요) 안의 블록은 이미 묶음이 구획을 만들므로 제외한다. */
.sheet-body > .summary-block:first-of-type { padding-top: 4px; }
.summary-cols .summary-block { padding-top: 0; border-top: 0; }
.summary-block + .summary-cols,
.summary-cols + .summary-cols { border-top: 1px solid var(--border); padding-top: 22px; }
.summary-block .blk-title {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 1.02rem; margin-bottom: 11px; color: var(--text);
  letter-spacing: -.01em;
}
.summary-block .blk-title .dot { width: 13px; height: 13px; border-radius: 5px; flex: none; }
/* 몇 건 중 몇 건을 실었는지 — 말없이 잘리면 받는 사람이 빠진 줄 모른다 */
.summary-block .blk-title .blk-count {
  margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--text-muted);
  background: var(--surface-2); border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.summary-block .blk-more {
  margin: 8px 0 0; font-size: .82rem; color: var(--text-muted); line-height: 1.6;
}
.summary-block ul li {
  padding: 7px 0 7px 19px; position: relative; font-size: .92rem; line-height: 1.72;
  border-bottom: 1px dotted var(--border);
}
.summary-block ul li:last-child { border-bottom: none; }
.summary-block ul li::before {
  content: ''; position: absolute; left: 3px; top: 14px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}
.summary-block .prob-li { padding-left: 0; }
.summary-block .prob-li::before { display: none; }
.summary-block .prob-li b { color: var(--c-problem); }
.summary-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 26px; }
.sheet-foot {
  border-top: 1px solid var(--border); padding: 16px 30px;
  font-size: .78rem; color: var(--text-faint); display: flex;
  justify-content: space-between; flex-wrap: wrap; gap: 6px;
  background: var(--surface-3);
}

/* ---------- 15. 기록 타임라인 ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 8px; bottom: 8px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; margin-bottom: 14px; }
.tl-item::before {
  content: ''; position: absolute; left: -26px; top: 19px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--border);
}
.tl-item.t-behavior::before  { background: var(--c-help); }
.tl-item.t-treatment::before { background: var(--c-comm); }
.tl-item.t-medication::before { background: var(--brand-grow); }
.tl-item.t-change::before    { background: var(--accent); }
.tl-item.t-assessment::before { background: var(--brand-understand); }
.rec-card { padding: 16px 18px; transition: .16s var(--ease); }
.rec-card:hover { box-shadow: var(--shadow-md); transform: translateX(2px); cursor: pointer; }
.rec-card .rec-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.rec-card .rec-date { font-size: .8rem; color: var(--text-faint); margin-left: auto; }
.rec-card .rec-title { font-weight: 700; }
.rec-card .rec-content { font-size: .89rem; color: var(--text-muted); margin-top: 4px; }
/* 컨디션 표시 칩 — 기록 카드·상세에서 입력 피커와 같은 이모지·감정색 사용 */
.mood-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700;
}
.mood-chip.m1 { background: var(--mood-1-bg); color: var(--mood-1); }
.mood-chip.m2 { background: var(--mood-2-bg); color: var(--mood-2); }
.mood-chip.m3 { background: var(--mood-3-bg); color: var(--mood-3); }
.mood-chip.m4 { background: var(--mood-4-bg); color: var(--mood-4); }
.mood-chip.m5 { background: var(--mood-5-bg); color: var(--mood-5); }

/* 컨디션 입력 피커 — 감정별 색 버튼 (탭 한 번 선택) */
.mood-pick { display: flex; gap: 6px; }
.mood-btn {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 7px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); cursor: pointer; font-size: 1.32rem;
  transition: .14s var(--ease); opacity: .62;
}
.mood-btn small { font-size: .64rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.mood-btn:hover { opacity: 1; }
.mood-btn.on { opacity: 1; transform: translateY(-1px); }
.mood-btn.m1.on { background: var(--mood-1-bg); border-color: var(--mood-1); }
.mood-btn.m2.on { background: var(--mood-2-bg); border-color: var(--mood-2); }
.mood-btn.m3.on { background: var(--mood-3-bg); border-color: var(--mood-3); }
.mood-btn.m4.on { background: var(--mood-4-bg); border-color: var(--mood-4); }
.mood-btn.m5.on { background: var(--mood-5-bg); border-color: var(--mood-5); }
.mood-btn.m1.on small { color: var(--mood-1); }
.mood-btn.m2.on small { color: var(--mood-2); }
.mood-btn.m3.on small { color: var(--mood-3); }
.mood-btn.m4.on small { color: var(--mood-4); }
.mood-btn.m5.on small { color: var(--mood-5); }

/* 감정 표현 카드 (2차) — 보호자가 관찰한 아이의 감정, 복수 선택 */
.emo-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emo-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 62px; padding: 8px 10px 6px; border: 1.5px solid var(--border);
  border-radius: 12px; background: var(--surface); cursor: pointer;
  font-size: 1.2rem; transition: .14s var(--ease); opacity: .62;
}
.emo-btn small { font-size: .66rem; font-weight: 700; color: var(--text-muted); }
.emo-btn:hover { opacity: 1; }
.emo-btn.on { opacity: 1; background: var(--emo-bg); border-color: var(--emo-c); transform: translateY(-1px); }
.emo-btn.on small { color: var(--emo-c); }
.emo-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 999px; font-size: .76rem; font-weight: 700;
}

/* ---------- 16. 차트 ---------- */
.chart-bars { display: flex; align-items: flex-end; gap: 12px; height: 178px; padding-top: 12px; }
.chart-bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; }
.chart-bars .bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.chart-bars .bar {
  width: 100%; max-width: 44px; margin: 0 auto;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  border-radius: 7px 7px 0 0; min-height: 4px; transition: height .5s var(--ease);
}
.chart-bars .bar.alt { background: linear-gradient(180deg, var(--accent), var(--accent-dark)); }
.chart-bars .bar-label { font-size: .76rem; color: var(--text-muted); font-weight: 600; }
.chart-bars .bar-val { font-size: .78rem; font-weight: 800; color: var(--text); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--text-muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }
.line-chart { width: 100%; height: 180px; }

/* ---------- 17. 테이블 ---------- */
/* 표는 카드에 꽉 채우지 않고 카드 거터(22px) 안쪽으로 들여 넣는다 —
   가장자리에 붙으면 카드 테두리와 표 테두리가 한 선으로 겹쳐 보이고,
   위쪽 필터 탭과도 맞닿아 어디까지가 탭이고 어디부터가 표인지 끊기지 않는다.
   스크롤 컨테이너에 radius를 주면 가로 스크롤바가 모서리를 가로질러 나가므로,
   라운드는 실제로 보이는 표 자신(머리 밴드·마지막 행)에 준다. */
.table-wrap { overflow-x: auto; padding: 14px 22px 22px; }
/* 상태 배지·전화번호가 좁은 열에서 한 글자씩 세로로 깨지지 않게 */
table.tbl .badge { white-space: nowrap; }
table.tbl td.nw, table.tbl th.nw { white-space: nowrap; }
/* 긴 보조 문구가 좁은 열에서 여러 줄로 접혀 그 행만 높아지는 것을 막는다 (전문은 title로) */
table.tbl .ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.tbl {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
table.tbl thead th:first-child { border-top-left-radius: var(--radius-sm); }
table.tbl thead th:last-child  { border-top-right-radius: var(--radius-sm); }
table.tbl tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius-sm); }
table.tbl tbody tr:last-child td:last-child  { border-bottom-right-radius: var(--radius-sm); }
table.tbl th, table.tbl td {
  padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border);
}
table.tbl th {
  font-size: .77rem; color: var(--text-muted); font-weight: 800;
  background: var(--surface-3); text-transform: uppercase; letter-spacing: .03em;
}
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: .12s var(--ease); }
table.tbl tbody tr:hover td { background: var(--primary-tint); }
table.tbl td.actions { white-space: nowrap; }

/* ---------- 18. 토스트 ---------- */
#toast-host {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--text); color: #fff; padding: 12px 20px;
  border-radius: 999px; font-size: .9rem; font-weight: 700;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px;
  animation: toastIn .3s var(--ease);
}
.toast.ok { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.toast.err { background: var(--danger); }
.toast svg { width: 17px; height: 17px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.94); } }

/* ---------- 19. 모달 ---------- */
#modal-host:empty { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(14,26,54,.55);
  backdrop-filter: blur(3px);
  z-index: 150; display: flex; align-items: center; justify-content: center;
  padding: 18px; animation: fadeIn .16s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } }
/* 새로 만든 공유 카드 강조 — 발급 직후 목록에서 잠깐 하이라이트 */
.card.just-created { animation: justCreated 2.4s var(--ease); }
@keyframes justCreated {
  0%   { box-shadow: 0 0 0 0 var(--primary-tint); border-color: var(--primary); }
  12%  { box-shadow: 0 0 0 4px var(--primary-tint); border-color: var(--primary); }
  70%  { box-shadow: 0 0 0 4px var(--primary-tint); border-color: var(--primary); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 490px;
  max-height: 90vh;
  /* 헤더·본문·푸터 3단 — 스크롤은 본문(.modal-body)만.
     모달 자체가 스크롤되면 스크롤바가 둥근 모서리를 가로질러 영역 밖으로 나가 보인다. */
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn .24s var(--ease);
}
.modal.wide { max-width: 700px; }
.preview-modal .summary-sheet { box-shadow: none; }

/* 둘러보기 가이드 (셀프 온보딩) */
.tour-tip {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px;
  width: min(440px, calc(100vw - 28px)); z-index: 200;
  background: var(--surface); border: 1px solid var(--primary-100);
  border-radius: var(--radius-lg); box-shadow: 0 14px 50px rgba(27, 42, 92, .28);
  padding: 16px 18px 14px; animation: tourIn .22s var(--ease);
}
@keyframes tourIn { from { opacity: 0; transform: translate(-50%, 14px); } }
.tour-tip .tour-step { font-size: .7rem; font-weight: 800; letter-spacing: .08em; color: var(--primary); }
.tour-tip h3 { font-size: 1.06rem; margin: 5px 0 7px; padding-right: 26px; }
.tour-tip p { font-size: .9rem; color: var(--text-muted); line-height: 1.72; margin: 0; }
/* 진행 막대 — 몇 단계 남았는지 보이면 끝까지 따라오기 쉬워진다 */
.tour-tip .tour-prog { height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 8px 0 10px; }
.tour-tip .tour-prog-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width .25s var(--ease); }
.tour-tip .tour-alt { margin-top: 12px; width: 100%; justify-content: center; }
/* 짚어준 요소를 카드가 가리게 되면 위쪽 자리로 옮긴다 (tour.js place()) */
.tour-tip.at-top { top: calc(74px + env(safe-area-inset-top, 0px)); bottom: auto; }
.tour-tip .tour-x {
  position: absolute; right: 11px; top: 11px; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-muted); border-radius: 9px;
}
.tour-tip .tour-x:hover { background: var(--primary-soft); color: var(--primary); }
.tour-tip .tour-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 15px; }
.tour-pulse {
  outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 12px;
  animation: tourPulse 1.25s ease-in-out infinite; scroll-margin: 100px;
}
@keyframes tourPulse { 0%, 100% { outline-color: var(--primary); } 50% { outline-color: rgba(53, 102, 205, .15); } }
@media (max-width: 960px) { .tour-tip { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }
@media (prefers-reduced-motion: reduce) { .tour-pulse, .tour-tip { animation: none; } }

/* 메뉴별 튜토리얼 센터 */
.tut-prog-wrap { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.tut-prog { flex: 1; min-width: 0; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.tut-prog-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s var(--ease); }
.tut-prog-tx { flex: none; font-size: .78rem; font-weight: 800; color: var(--text-muted); }
.tut-group {
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; color: var(--text-muted);
  margin: 16px 0 7px;
}
.tut-group:first-of-type { margin-top: 0; }
.tut-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 13px; margin-bottom: 7px; min-height: 56px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .14s var(--ease), background .14s var(--ease);
}
.tut-row:hover, .tut-row:focus-visible { border-color: var(--primary); background: var(--primary-soft); }
.tut-row .tut-ic {
  flex: none; width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.tut-row .tut-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tut-row .tut-tx b { font-size: .92rem; line-height: 1.35; }
.tut-row .tut-tx > span { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }
.tut-row .tut-st {
  flex: none; display: flex; align-items: center; gap: 4px;
  font-size: .76rem; font-weight: 700; color: var(--text-muted);
}
.tut-row.done .tut-ic { background: var(--mood-4-bg); color: var(--ok); }
.tut-row.done .tut-st { color: var(--ok); }
@media (max-width: 560px) {
  .tut-row .tut-st-tx { display: none; }
  .tut-row .tut-tx > span { font-size: .78rem; }
}

/* 화면별 도움말 (?) */
.app-bar .app-help { flex: none; }
.help-intro { font-size: .92rem; color: var(--text-muted); line-height: 1.55; margin: 0 0 14px; }
.help-row { padding: 11px 0; border-top: 1px solid var(--border); }
.help-row:first-of-type { border-top: none; padding-top: 0; }
.help-row b { display: block; font-size: .95rem; color: var(--primary-dark); margin-bottom: 3px; }
.help-row span { font-size: .88rem; color: var(--text); line-height: 1.55; }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.modal-head {
  padding: 19px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 11px;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-head h3 { flex: 1; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
/* 버튼이 3개 이상이면 좁은 폭에서 폭 합이 푸터를 넘어, flex-end 기준으로 밀린
   첫 버튼(주로 「닫기」)이 왼쪽으로 잘려 나갔다(아스트로젠 디자인 의견 5).
   줄바꿈을 허용하고 좌우 여백을 줄여 어떤 버튼도 화면 밖으로 나가지 않게 한다. */
.modal-foot {
  padding: 15px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  position: sticky; bottom: 0; background: var(--surface);
}
.modal-foot .btn { flex: 0 1 auto; min-width: 0; }
@media (max-width: 420px) {
  .modal-foot { padding: 13px 16px; gap: 8px; }
}

/* ---------- 20. 기타 ---------- */
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.gap-sm { gap: 6px; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* 서브 설명 박스 — 예전에는 하늘색 배경(#e3f1f9)이 페이지 배경(#eef2fa)과
   명도차 1.03에 색조만 달라 경계가 어른거렸다(아스트로젠 디자인 의견 6).
   면을 흰 바탕으로 낮추고 왼쪽 색 띠로만 성격을 표시한다 — 박스감도 함께 줄어든다. */
.pill-info {
  background: var(--surface); color: #17608c;
  border: 1px solid var(--border); border-left: 3px solid #6aa9cd;
  border-radius: var(--radius-sm); padding: 12px 15px; font-size: .87rem;
  display: flex; gap: 10px; align-items: flex-start; line-height: 1.6;
}
.pill-info svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: #6aa9cd; }
.pill-info b { color: var(--text); }
.pill-warn { background: var(--surface); color: #8a5806; border-left-color: #d9a441; }
.pill-warn svg { color: #d9a441; }
.pill-ok { background: var(--surface); color: #126d48; border-left-color: #4bab85; }
.pill-ok svg { color: #4bab85; }

.callout {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 17px; background: var(--surface-3);
}
.help-list { font-size: .85rem; color: var(--text-muted); }
.help-list li { padding: 3px 0 3px 16px; position: relative; }
.help-list li::before { content: '·'; position: absolute; left: 4px; font-weight: 800; }

.kv { display: grid; grid-template-columns: 116px 1fr; gap: 10px 14px; font-size: .92rem; }
.kv dt { color: var(--text-muted); font-weight: 700; }
.kv dd { font-weight: 500; line-height: 1.55; }

.code-box {
  background: var(--surface-3); border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-family: 'Courier New', monospace; font-size: .88rem;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  word-break: break-all;
}
.access-code {
  font-size: 2rem; font-weight: 800; letter-spacing: .32em;
  color: var(--primary-dark); text-align: center;
  font-family: 'Pretendard', sans-serif;
}

.progress-track { height: 9px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 99px; transition: width .5s var(--ease);
}

/* =====================================================================
 * 21. 적응형 레이아웃 — 웹(데스크톱) / 앱(태블릿·모바일) 최적화
 *
 *  · 기본 CSS = 웹 모드 (사이드바 내비게이션, 다단 레이아웃)
 *  · ≤ 960px  = 앱 모드 (하단 탭바, 풀폭, 바텀시트 모달 — 네이티브 앱 경험)
 *  · ≤ 600px  = 모바일 (단일 컬럼, 큰 터치 영역)
 * ===================================================================== */
@keyframes sheetUp { from { transform: translateY(100%); } }

/* ---------- 와이드 데스크톱 ---------- */
@media (min-width: 1440px) {
  :root { --maxw: 1280px; }
}

/* ---------- 중간 데스크톱: 그리드 약간 축소 ---------- */
@media (max-width: 1120px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 태블릿 가로 — 히어로 일러스트를 줄여 텍스트와 겹치지 않게 */
  .hero-illust { width: min(430px, 34vw); }
}

/* ---------- 앱 모드 (태블릿·모바일 공통, ≤ 960px) ---------- */
@media (max-width: 960px) {
  /* 내비게이션: 사이드바 → 하단 탭바 */
  .sidebar { display: none; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
    background: rgba(255,255,255,.97); backdrop-filter: saturate(1.6) blur(12px);
    -webkit-backdrop-filter: saturate(1.6) blur(12px);
    border-top: 1px solid var(--border);
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; color: var(--text-faint); font-size: .68rem; font-weight: 700;
    min-height: 52px; justify-content: center;
  }
  .bottom-nav a svg, .bottom-nav button svg { width: 23px; height: 23px; }
  .bottom-nav a.active { color: var(--primary); }
  /* 아이 미등록 — 탭 구조는 그대로 두고 잠금 표시만 (등록 후 위치가 바뀌지 않게) */
  .bottom-nav button.locked { opacity: .45; position: relative; }
  .bottom-nav button.locked svg:last-child {
    position: absolute; top: 4px; right: 50%; margin-right: -17px;
    width: 11px; height: 11px;
  }

  /* 앱바 컴팩트 */
  .app-bar { padding: env(safe-area-inset-top, 0px) 14px 0; gap: 9px; }
  .app-bar .brand .wordmark span { display: none; }
  .child-switch .nm-full { display: none; }
  .usermenu .trigger .nm-full { display: none; }
  /* 터치 타깃 보강 (44px 가이드) */
  .child-switch { min-height: 42px; }
  .usermenu .trigger { min-height: 42px; }

  /* 콘텐츠 영역 — 하단 탭바 공간 확보 */
  .container { padding: 18px 16px 24px; }
  .app-foot { padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); }

  /* 그리드 */
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* 모달 → 바텀시트 (네이티브 앱 느낌) */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal.wide {
    max-width: 100%; width: 100%;
    border-radius: 22px 22px 0 0; max-height: 94vh;
    animation: sheetUp .3s var(--ease);
  }
  .modal-head { padding-top: 22px; }
  .modal-head::before {
    content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 42px; height: 5px; border-radius: 99px; background: var(--border-strong);
  }
  .modal-foot .btn { flex: 1; }
  /* iOS 홈 인디케이터와 겹침 방지 */
  .modal-foot { padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px)); }
  .drawer { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }

  /* 랜딩 — 일러스트는 모바일에서 텍스트 아래로 (감성 핵심이라 숨기지 않음) */
  .hero-illust {
    position: static; transform: none;
    width: min(430px, 92vw); margin: 22px auto -18px;
  }
  .hero-inner { padding: 56px 20px 60px; display: flex; flex-direction: column; }
  .hero h1 { font-size: 2rem; }
  .section { padding: 56px 0; }
  .mission { padding: 40px 28px; }
}

/* ---------- grid-2 는 좁아지면 단으로 ---------- */
@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; gap: 0; }
}

/* ---------- 모바일 (≤ 600px) ---------- */
@media (max-width: 600px) {
  body { font-size: 15px; }
  /* 단일 컬럼 — minmax(0,1fr) 로 자식 오버플로 차단 */
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .summary-cols { grid-template-columns: 1fr; }
  .container { padding: 16px 14px 24px; }

  .page-head h1 { font-size: 1.4rem; }
  .page-head { margin-bottom: 18px; }

  /* 랜딩 */
  .hero-inner { padding: 46px 16px 52px; }
  .hero h1 { font-size: 1.7rem; }
  .hero p { font-size: 1rem; }
  .hero .trust { gap: 10px 16px; }
  /* CTA 풀폭 스택 — 엄지 닿는 영역 확대 */
  .hero .cta { flex-direction: column; align-items: stretch; }
  .hero .cta .btn { width: 100%; }
  /* 랜딩 상단바 워드마크 — 한 줄 유지(부제 숨김) */
  .lp-bar { padding-left: 16px; padding-right: 16px; gap: 8px; }
  .lp-bar .brand { flex: 1; min-width: 0; }
  .lp-bar .wordmark { min-width: 0; }
  .lp-bar .wordmark b {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
  }
  .lp-bar .wordmark span { display: none; }
  .section { padding: 44px 0; }
  .section-head { margin-bottom: 32px; }
  .section-head h2 { font-size: 1.44rem; }
  .mission { padding: 30px 22px; }
  .mission h2 { font-size: 1.5rem; }
  .lp-section { padding: 0 16px; }

  /* 카드·시트 패딩 축소 */
  .card-pad, .card-body { padding: 17px; }
  .card-head { padding: 14px 17px; }
  .summary-sheet .sheet-top { padding: 20px; }
  .summary-sheet .sheet-body { padding: 20px; }
  .feature-card { padding: 20px; }

  /* 터치 영역 확대 (44px 가이드 준수) */
  .btn-sm { padding: 9px 14px; font-size: .86rem; min-height: 42px; }
  .btn-icon { width: 42px; height: 42px; }
  .chip { padding: 8px 14px; min-height: 40px; }
  .manual-tab { padding: 13px 15px; }
}

/* 아주 좁은 화면 — 랜딩 상단바는 로고만 (이름은 히어로 필에 노출)
   (워드마크에 인라인 display:flex 가 있어 !important 필요) */
@media (max-width: 470px) {
  .lp-bar .wordmark { display: none !important; }
}

/* ---------- 소형 폰 (≤ 380px) ---------- */
@media (max-width: 380px) {
  .access-code { font-size: 1.5rem; letter-spacing: .2em; }
  .hero h1 { font-size: 1.46rem; }
  .section-head h2 { font-size: 1.28rem; }
  .app-bar { padding: 0 11px; }
  .stat .value { font-size: 1.55rem; }
}

/* ---------- 큰 화면에서만 호버 효과 (터치기기 오작동 방지) ---------- */
@media (hover: none) {
  .card:hover, .child-card:hover, .obs-card:hover, .rec-card:hover,
  .feature-card:hover, .stat:hover { transform: none; }
}

/* 사이드 드로어 (모바일 전체메뉴) */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(14,26,54,.55);
  backdrop-filter: blur(3px); z-index: 120; animation: fadeIn .16s var(--ease);
}
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: 290px; max-width: 86vw;
  background: var(--surface); z-index: 121; padding: 18px 14px;
  box-shadow: var(--shadow-lg); overflow-y: auto; animation: drawerIn .26s var(--ease);
}
@keyframes drawerIn { from { transform: translateX(100%); } }

/* ---------- 23. 짧은 영상(릴스) 기록 ---------- */
/* 기록 모달 — 미디어(사진·영상) 통합 필드. 두 슬롯을 나란히 두어 동시 첨부 가능 */
.media-row { display: flex; gap: 12px; margin-top: 2px; }
.media-tile {
  width: 84px; height: 84px; border-radius: 10px; overflow: hidden;
  position: relative; flex: none; background: var(--surface-2);
}
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile.empty-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1px dashed var(--border-strong); background: var(--surface);
  color: var(--text-muted); font-size: .72rem; font-weight: 700; cursor: pointer; transition: .14s var(--ease);
}
.media-tile.empty-tile:hover { border-color: var(--primary); color: var(--primary); }
.media-tile:not(.empty-tile) { cursor: pointer; }
.media-tile-remove {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; border: none;
}
.media-tile-badge {
  position: absolute; left: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff;
  font-size: .62rem; font-weight: 700; line-height: 1; pointer-events: none;
}
.reels-cap { display: flex; flex-direction: column; align-items: center; gap: 11px; padding: 6px 0; }
.reels-frame {
  position: relative; width: 208px; max-width: 72vw; aspect-ratio: 9 / 16;
  border-radius: 18px; overflow: hidden; background: #0e1a2e;
  box-shadow: var(--shadow-md);
}
.reels-video { width: 100%; height: 100%; object-fit: cover; background: #0e1a2e; display: block; }
.reels-timer {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(14,26,46,.72); color: #fff; font-size: .76rem; font-weight: 800;
  padding: 3px 11px; border-radius: 999px;
}
.reels-progress {
  width: 208px; max-width: 72vw; height: 6px;
  background: var(--surface-2); border-radius: 99px; overflow: hidden;
}
.reels-progress > div {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--danger));
  transition: width .15s linear;
}
.reels-ctrl { display: flex; }
.rec-btn {
  width: 62px; height: 62px; border-radius: 50%; background: #fff;
  border: 4px solid var(--danger); display: grid; place-items: center; padding: 0;
  transition: transform .08s var(--ease);
}
.rec-btn:active { transform: scale(.94); }
.rec-btn::after {
  content: ''; width: 40px; height: 40px; border-radius: 50%;
  background: var(--danger); transition: .2s var(--ease);
}
.rec-btn.recording::after { width: 24px; height: 24px; border-radius: 7px; }
.reels-review { display: flex; flex-direction: column; align-items: center; }
.rec-clip-player { display: flex; justify-content: center; margin: 4px 0; }

/* 기록 검색·필터 툴바 (게시판 형태) */
.rec-toolbar {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 12px;
}
.rec-search {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 0 12px; min-height: 42px;
  color: var(--text-muted); transition: .14s var(--ease);
}
.rec-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.rec-search svg { flex: none; }
.rec-search-input {
  flex: 1; min-width: 0; border: none; background: none; outline: none;
  font: inherit; color: var(--text); padding: 9px 0; min-height: 42px;
}
.rec-search-input::placeholder { color: var(--text-faint); }
.rec-search-clear {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  background: none; color: var(--text-faint);
}
.rec-search-clear:hover { background: var(--surface-2); color: var(--primary); }
.rec-filterbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* 라운드(10px)+테두리 컨트롤이라 가로 스크롤바가 모서리를 가로지르고 버튼 높이까지 잠식한다.
   같은 가로 스크롤러인 칩 바(.ctx-chips)·카테고리 탭(.manual-tabs)과 동일하게 스크롤바를 숨긴다. */
.rec-filterbar .seg { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.rec-filterbar .seg::-webkit-scrollbar { display: none; }
.rec-filterbar .select.sm { min-height: 40px; padding: 6px 30px 6px 11px; font-size: .84rem; width: auto; }
.rec-filterbar #rec-reset { margin-left: auto; }
.rec-daterange { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rec-daterange .input { max-width: 168px; min-height: 40px; }
.rec-count { font-size: .82rem; margin-bottom: 10px; }
@media (max-width: 560px) {
  .rec-filterbar .seg { width: 100%; }
  .rec-filterbar #rec-reset { margin-left: 0; }
}

/* 기록 카드 — 영상 클립 썸네일은 제목·내용 아래에 큰 미리보기로 배치 (사진과 동일 구성) */
.rec-main { min-width: 0; }
.rec-clip-inline { position: relative; display: inline-block; margin-top: 8px; }
.clip-thumb {
  width: 132px; height: 180px; object-fit: cover; border-radius: 11px;
  background: #0e1a2e; display: block;
}
.clip-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; pointer-events: none;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.75));
}

/* ---------- 23-b. 음성 입력 버튼 ---------- */
.voice-btn { flex: none; }
.voice-btn.recording {
  background: var(--danger) !important;
  color: #fff !important;
  border-color: var(--danger) !important;
  animation: voicePulse 1.2s ease-in-out infinite;
}
@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214,88,78,.55); }
  50%      { box-shadow: 0 0 0 8px rgba(214,88,78,0); }
}

/* ---------- 24. 아이 프로필 헤더 ---------- */
.profile-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-photo { position: relative; flex: none; }
.photo-edit-btn {
  position: absolute; right: -3px; bottom: -3px;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  border: 3px solid var(--surface); box-shadow: var(--shadow);
  transition: background .15s var(--ease);
}
.photo-edit-btn:hover { background: var(--primary-dark); }
.photo-edit-btn svg { width: 15px; height: 15px; }
.profile-hero .meta { flex: 1; min-width: 170px; }
.profile-hero .meta h1 { font-size: 1.5rem; }
.profile-hero .actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 600px) {
  .profile-hero { gap: 14px; }
  .profile-hero .meta h1 { font-size: 1.3rem; }
  .profile-hero .actions { width: 100%; }
  .profile-hero .actions .btn { flex: 1; }
}

/* ---------- 25. Stellar Connect — 브랜드 가이드 반영 ---------- */
/* WHY 섹션 — 손 사진(원형) + 양육자 목소리 2단 구성
   히어로의 페리윙클이 옅게 이어지고, 사진의 웜 톤과 호응하는 글로우 */
.why-sec {
  position: relative; overflow: hidden;
  background:
    radial-gradient(620px 360px at 16% 34%, rgba(255,224,150,.16), transparent 62%),
    linear-gradient(180deg, #dde3f7 0%, #f0f3fc 46%, #ffffff 100%);
}
.why-sec .hero-spark {
  color: rgba(255,255,255,.95);
  filter: drop-shadow(0 0 6px rgba(124,134,220,.5));
}
.why-grid {
  display: grid; grid-template-columns: 5fr 7fr;
  gap: 56px; align-items: center;
}
.why-visual { text-align: center; position: relative; }
/* 손+별 일러스트 — 밤하늘 라운드 카드 (인트로 시안) */
.why-photo {
  position: relative; display: inline-block;
  width: min(440px, 86vw);
  border-radius: 26px;
  border: 6px solid rgba(255,255,255,.95);
  box-shadow:
    0 0 0 12px rgba(124,134,220,.10),
    0 26px 52px -18px rgba(31,42,92,.28);
  overflow: hidden;
}
.why-photo img { display: block; width: 100%; height: auto; }
/* 가장자리에서 손 모양이 액자 테두리에 뚝 잘려 보이지 않도록 안쪽으로 은은하게 흐림 처리 */
.why-photo::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 34px 10px rgba(255,255,255,.65);
}
.star-quote {
  margin-top: 18px; font-style: italic; font-weight: 700;
  font-size: 1.1rem; line-height: 1.6; color: #39477f; letter-spacing: .01em;
  position: relative;
}
.why-content .section-head {
  text-align: left; margin: 0 0 22px; max-width: none;
}
.quote-stack { display: grid; gap: 12px; }
.quote-stack .quote-card {
  padding: 17px 20px;
  display: grid; grid-template-columns: auto 1fr; column-gap: 13px;
}
.quote-stack .quote-card .qmark { grid-row: 1 / 3; font-size: 2rem; line-height: 1; }
.quote-stack .quote-card p { margin: 0; font-size: .96rem; }
.quote-stack .quote-card .who { grid-column: 2; margin-top: 6px; font-size: .78rem; }
@media (max-width: 880px) {
  .why-grid { grid-template-columns: 1fr; gap: 34px; }
  .why-content .section-head { text-align: center; }
  .why-photo { width: min(380px, 86vw); }
  .star-quote { font-size: 1.02rem; }
}

/* CONNECT — 별자리 경로 (드리미 파스텔 톤) */
.connect-sec {
  position: relative; overflow: hidden;
  background:
    radial-gradient(720px 420px at 88% 0%, rgba(108,99,221,.14), transparent 60%),
    radial-gradient(620px 380px at 6% 100%, rgba(45,161,149,.13), transparent 60%),
    linear-gradient(168deg, #eef2fc 0%, #dde6fa 52%, #ccd7f5 100%);
}
.connect-sec .hero-spark {
  color: rgba(255,255,255,.9);
  filter: drop-shadow(0 0 6px rgba(124,134,220,.6));
}
/* 폰 목업(실제 화면 구성) + 별자리 경로 2단 */
.connect-duo {
  display: flex; gap: 52px; align-items: center; justify-content: center;
  max-width: 980px; margin: 0 auto; flex-wrap: wrap;
}
.pm-col { flex: none; text-align: center; }
.pm-caption { margin-top: 14px; font-size: .8rem; font-weight: 600; color: #44518e; }
.phone-mock {
  width: 292px; padding: 11px; border-radius: 46px; margin: 0 auto;
  background: linear-gradient(165deg, #353b4e, #14171f);
  box-shadow: 0 34px 70px -20px rgba(31,42,92,.5), inset 0 1px 2px rgba(255,255,255,.18);
}
.pm-screen {
  position: relative; border-radius: 36px; overflow: hidden;
  background: var(--bg); text-align: left;
}
.pm-screen::before {              /* 다이내믹 아일랜드 */
  content: ''; position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 84px; height: 22px; border-radius: 99px; background: #14171f; z-index: 6;
}
.pm-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 40px 15px 9px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.pm-bar b { font-size: .8rem; letter-spacing: -.01em; }
.pm-bar .pm-bell { margin-left: auto; color: var(--text-muted); display: flex; }
.pm-greet { padding: 13px 15px 4px; font-weight: 800; font-size: .88rem; }
.pm-greet span {
  display: block; font-size: .68rem; color: var(--text-muted);
  font-weight: 600; margin-top: 2px;
}
.pm-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 7px; padding: 10px 13px 2px;
}
.pm-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
  padding: 9px 3px 8px; text-align: center; font-size: .62rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  box-shadow: var(--shadow-xs);
}
.pm-tile .pm-ico {
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
}
.pm-card {
  margin: 8px 13px 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 9px 12px; font-size: .68rem;
  display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-xs);
}
.pm-card b { font-size: .72rem; }
.pm-card span { color: var(--text-muted); font-weight: 600; }
.pm-card.pm-note { flex-direction: row; align-items: center; justify-content: space-between; }
.pm-note span:first-child { color: var(--text); font-weight: 700; }
.pm-note .pm-plus {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: linear-gradient(140deg, var(--brand-understand), var(--primary));
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: .8rem;
}
.pm-nav {
  display: flex; justify-content: space-around; margin-top: 10px;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 8px 6px 12px;
}
.pm-nav span {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .58rem; font-weight: 700; color: var(--text-faint);
}
.pm-nav span.on { color: var(--primary); }
@media (max-width: 760px) {
  .connect-duo { gap: 30px; }
  .phone-mock { width: 256px; border-radius: 42px; }
  .pm-screen { border-radius: 32px; }
}

.connect-path {
  position: relative; max-width: 620px; margin: 0 auto; padding: 8px 0 4px;
}
.connect-duo .connect-path { flex: 1 1 340px; max-width: 540px; margin: 0; }
.connect-path::before {           /* 중앙 별자리 연결선 — 점선 그라데이션 */
  content: ''; position: absolute; left: 50%; top: 26px; bottom: 26px;
  width: 3px; transform: translateX(-50%); border-radius: 99px;
  background: linear-gradient(180deg,
    var(--brand-understand), var(--brand-connect) 36%,
    var(--brand-grow) 68%, var(--brand-understand) 100%);
  opacity: .42;
  -webkit-mask-image: repeating-linear-gradient(180deg, #000 0 9px, transparent 9px 17px);
  mask-image: repeating-linear-gradient(180deg, #000 0 9px, transparent 9px 17px);
}
.connect-node {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 18px;
  width: calc(50% + 38px); margin: 4px 0 4px calc(50% - 38px);
  padding: 10px 0;
}
.connect-node.flip {
  flex-direction: row-reverse; text-align: right;
  margin: 4px calc(50% - 38px) 4px 0;
}
.connect-node .node-ico {
  width: 76px; height: 76px; border-radius: 50%; flex: none;
  background: rgba(255,255,255,.92);
  border: 1.5px solid #fff;
  display: grid; place-items: center; color: var(--nc, var(--primary));
  box-shadow: 0 12px 28px -10px rgba(31,42,92,.30),
              inset 0 0 0 7px rgba(255,255,255,.55);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.connect-node:hover .node-ico {
  transform: scale(1.06);
  box-shadow: 0 16px 34px -10px rgba(31,42,92,.36),
              inset 0 0 0 7px rgba(255,255,255,.55);
}
.connect-node .node-ico::after {  /* 노드 주위 은은한 링 */
  content: ''; position: absolute; width: 92px; height: 92px; border-radius: 50%;
  border: 1.5px solid var(--nc, var(--primary)); opacity: .18;
}
.connect-node .node-label b { display: block; font-size: 1.04rem; color: var(--brand-trust); }
.connect-node .node-label span { font-size: .85rem; font-weight: 600; color: #44518e; }
@media (max-width: 640px) {
  .connect-path::before { left: 37px; transform: none; }
  .connect-node, .connect-node.flip {
    flex-direction: row; text-align: left;
    width: 100%; margin: 4px 0; gap: 15px;
  }
  .connect-node .node-ico { width: 74px; height: 74px; }
}

/* CLOSING BAND — "세상을 연결하는 시작" */
.closing-band {
  position: relative; overflow: hidden;
  /* 드리미 파스텔 — 히어로와 수미상관 */
  background:
    radial-gradient(820px 380px at 50% -12%, rgba(108,99,221,.22), transparent 62%),
    radial-gradient(620px 340px at 100% 100%, rgba(45,161,149,.20), transparent 60%),
    linear-gradient(162deg, #eaeffd 0%, #d4ddf8 48%, #bcc9f1 100%);
  color: var(--text); border-radius: var(--radius-xl);
  padding: 70px 36px 64px; text-align: center;
  border: 1px solid #fff;
}
.closing-band .hero-spark {
  color: rgba(255,255,255,.9); z-index: 1;
  filter: drop-shadow(0 0 6px rgba(124,134,220,.6));
}
.closing-band h2 {
  color: var(--brand-trust); font-size: 2rem; line-height: 1.32;
  letter-spacing: -.03em; max-width: 580px;
  margin: 0 auto 16px; position: relative; z-index: 2;
}
.closing-band h2 .em {
  background: linear-gradient(92deg, var(--brand-understand), var(--primary) 55%, #1f8d81);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.closing-band p {
  color: #39477f; max-width: 540px; margin: 0 auto 24px;
  font-size: 1.04rem; line-height: 1.7;
  position: relative; z-index: 2;
}
.closing-band .closing-tag {
  display: inline-block; font-size: .8rem; font-weight: 800;
  letter-spacing: .12em; color: var(--primary-dark);
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.95); border-radius: 999px;
  padding: 9px 20px; position: relative; z-index: 2;
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
}
/* 클로징 밴드 안 CTA — 히어로와 동일한 버튼 언어 (틸 + 글래스) */
.closing-band .cta {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  margin: 0 0 14px; position: relative; z-index: 2;
}
.closing-band .btn-ghost {
  background: rgba(255,255,255,.66); border-color: rgba(255,255,255,.95);
  color: var(--primary-dark);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.closing-band .btn-ghost:hover { background: #fff; border-color: #fff; }
.closing-band .closing-hint {
  font-size: .86rem; color: #4d5a96; margin-bottom: 22px;
  position: relative; z-index: 2;
}
.closing-band .closing-hint b { color: var(--brand-trust); }
@media (max-width: 600px) {
  .closing-band .cta { flex-direction: column; align-items: stretch; }
  .closing-band .cta .btn { width: 100%; }
}
@media (max-width: 600px) {
  .closing-band { padding: 48px 22px 44px; border-radius: var(--radius-lg); }
  .closing-band h2 { font-size: 1.46rem; }
  .closing-band p { font-size: .96rem; }
}

/* ---------- 26-0. 가치 5카드 + 감성 필 (2차 양육자 리뷰 — 친근하고 편안하게) ---------- */
.gentle-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 1020px) { .gentle-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .gentle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gentle-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; padding: 24px 16px 20px; text-align: center;
  box-shadow: 0 4px 18px rgba(27, 42, 92, .06);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.gentle-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(27, 42, 92, .10); }
.gentle-card .g-ico {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
}
.gentle-card h3 { font-size: 1.02rem; margin-bottom: 6px; color: var(--primary-deep); }
.gentle-card p { font-size: .86rem; color: var(--text-muted); line-height: 1.6; }

.hero-pill, .soft-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-understand-soft); color: #45408f;
  border: 1px solid #d9d4f8; border-radius: 999px;
  padding: 10px 18px; font-size: .9rem; font-weight: 700; line-height: 1.45;
}
.hero-pill { margin: 2px 0 22px; position: relative; z-index: 2; }
.soft-pill {
  margin-top: 18px;
  background: var(--primary-soft); color: var(--primary-dark);
  border-color: var(--primary-100);
}
@media (max-width: 600px) {
  .hero-pill, .soft-pill { font-size: .82rem; padding: 9px 14px; }
}

/* ---------- 26. 브랜드 가치 섹션 (랜딩 — 신뢰·이해·연결·성장) ---------- */
.value-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(4, 1fr);
}
.value-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 30px 22px 26px;
  text-align: center; transition: .18s var(--ease);
  position: relative; overflow: hidden;
}
.value-card::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: var(--vc, var(--primary)); opacity: .9;
}
.value-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.value-card .value-dot {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px;
  background: var(--vc, var(--primary));
  box-shadow: 0 10px 22px -6px var(--vc, var(--primary));
  position: relative;
}
.value-card .value-dot::after {
  content: ''; position: absolute; inset: -7px; border-radius: 50%;
  border: 2px solid var(--vc, var(--primary)); opacity: .25;
}
.value-card .value-tag {
  font-size: 1.06rem; font-weight: 800; color: var(--vc, var(--primary));
  letter-spacing: -.01em;
}
.value-card h3 { font-size: .98rem; margin-top: 5px; }
.value-card p { font-size: .87rem; color: var(--text-muted); margin-top: 7px; line-height: 1.6; }
@media (max-width: 900px) { .value-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) {
  .value-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .value-card { padding: 22px 14px 18px; }
  .value-card .value-dot { width: 48px; height: 48px; margin-bottom: 12px; }
}

/* ---------- 27. 빠른 입력 (설명서 추천 칩 — 탭 한 번으로 추가) ---------- */
.quick-wrap {
  margin-top: 14px; padding: 13px 14px 11px;
  background: var(--surface-3); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}
.quick-cap {
  display: flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 800; color: var(--text-muted);
  margin-bottom: 9px; letter-spacing: -.01em;
}
.quick-cap svg { width: 13px; height: 13px; color: var(--accent); }
.quick-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip.quick {
  background: var(--surface); border: 1.5px solid var(--border-strong);
  color: var(--text); font-weight: 600; font-size: .84rem;
  padding: 7px 12px; cursor: pointer; white-space: normal; text-align: left;
}
.chip.quick b { color: var(--primary); font-weight: 800; margin-right: 2px; }
.chip.quick:hover {
  border-color: var(--primary); color: var(--primary-dark);
  background: var(--primary-tint);
}
.chip.quick:active { transform: scale(.97); }

/* 선택형 칩 (감각 특성 등 다중 선택) */
.chip.pick {
  background: var(--surface); border: 1.5px solid var(--border-strong);
  color: var(--text-muted); font-weight: 600; font-size: .84rem; cursor: pointer;
}
.chip.pick.on {
  background: var(--primary-soft); border-color: var(--primary);
  color: var(--primary-dark); font-weight: 700;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 7px; }

/* 글자수 카운터 (한 줄 소개) */
.char-count { font-size: .76rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.char-count.warn { color: var(--warn); font-weight: 700; }

/* ---------- 28. 공개 범위 선택 (정보 공개 레벨) ---------- */
.scope-pick { display: grid; gap: 9px; }
.scope-opt {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 13px 14px; transition: .14s var(--ease); background: var(--surface);
}
.scope-opt input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; margin-top: 2px; }
.scope-opt .s-body { flex: 1; min-width: 0; }
.scope-opt .s-title { font-weight: 800; font-size: .92rem; display: flex; align-items: center; gap: 7px; }
.scope-opt .s-desc { font-size: .82rem; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.scope-opt.on { border-color: var(--primary); background: var(--primary-tint); box-shadow: var(--shadow-xs); }
.scope-opt .badge { flex: none; }

/* ---------- 29. 응급 정보 우선 블록 (한 장 요약 상단) ---------- */
.summary-emergency {
  background: #fdf1ef; border: 1.5px solid #f3cdc8;
  border-radius: var(--radius); padding: 15px 18px 13px;
  margin-bottom: 20px; break-inside: avoid;
}
.summary-emergency .em-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: .95rem; color: var(--danger-ink);
  margin-bottom: 8px;
}
.summary-emergency .em-title svg { width: 17px; height: 17px; }
.summary-emergency ul li {
  padding: 5px 0; font-size: .9rem; line-height: 1.55;
  border-bottom: 1px dotted #f0d6d2;
}
.summary-emergency ul li:last-child { border-bottom: none; }
.summary-emergency .em-k {
  display: inline-block; font-weight: 800; font-size: .78rem;
  color: var(--danger-ink); background: #fbe2de; border-radius: 6px;
  padding: 1px 8px; margin-right: 7px; vertical-align: 1px;
}
.summary-emergency a.tel { font-weight: 800; color: var(--primary-dark); text-decoration: underline; }
.summary-emergency .em-safenote {
  display: flex; align-items: center; gap: 5px;
  margin-top: 8px; padding-top: 8px; border-top: 1px dotted #f0d6d2;
  font-size: .76rem; font-weight: 600; color: #8a6a64;
}

/* ---------- 30. 안심 갤러리 (미아 대비 최신 사진) ---------- */
.safe-gallery {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.safe-gallery .ph {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  aspect-ratio: 1; background: var(--surface-2); border: 1px solid var(--border);
}
.safe-gallery .ph img { width: 100%; height: 100%; object-fit: cover; }
.safe-gallery .ph .latest {
  position: absolute; left: 7px; top: 7px;
  font-size: .68rem; font-weight: 800; color: #fff;
  background: var(--accent); border-radius: 6px; padding: 2px 7px;
}
.safe-gallery .ph .date {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: .7rem; color: #fff; padding: 10px 8px 5px;
  background: linear-gradient(transparent, rgba(10,18,40,.72));
}
.safe-gallery .ph .del {
  position: absolute; right: 6px; top: 6px;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(10,18,40,.55); color: #fff;
  display: grid; place-items: center; opacity: 0; transition: .14s var(--ease);
}
.safe-gallery .ph:hover .del { opacity: 1; }
@media (hover: none) { .safe-gallery .ph .del { opacity: 1; } }

/* 오늘의 체크인 (대시보드 — 기분·수면·식사 + 복약) */
.med-kid > b { display: block; font-size: .88rem; margin-bottom: 5px; }
.med-kid + .med-kid { border-top: 1px dashed var(--border); margin-top: 10px; padding-top: 12px; }
#med-check-body .checkline { padding: 5px 0; }
#med-check-body .checkline span { display: inline-flex; align-items: center; gap: 6px; }
#med-check-body .checkline svg { color: var(--c-comm); }
#med-check-body .checkline input:checked + span {
  text-decoration: line-through; color: var(--text-faint);
}
.daily-row {
  display: flex; align-items: center; gap: 10px; padding: 4px 0; flex-wrap: wrap;
}
.daily-row .lbl {
  flex: none; width: 34px; font-size: .8rem; font-weight: 700; color: var(--text-muted);
}
.chip.pick.sm { padding: 5px 11px; font-size: .8rem; }

/* ---------- 31. 갤러리 (사진·영상 모아보기) ---------- */
.gal-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.gal-tile {
  position: relative; aspect-ratio: 1; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--border); cursor: pointer; padding: 0;
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}
.gal-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.gal-tile img, .gal-tile video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.gal-tile .gal-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(20,23,31,.55); color: #fff;
  display: grid; place-items: center; pointer-events: none;
}
.gal-tile .gal-badge {
  position: absolute; left: 7px; top: 7px;
  font-size: .64rem; font-weight: 800; color: #fff;
  background: rgba(53,102,205,.85); border-radius: 6px; padding: 2px 7px;
}
.gal-tile .gal-badge.safe { background: rgba(45,161,149,.88); }
.gal-tile .gal-badge.vid { left: auto; right: 7px; background: rgba(108,99,221,.88); }
.gal-tile .gal-date {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: .68rem; color: #fff; text-align: left; padding: 12px 8px 5px;
  background: linear-gradient(transparent, rgba(10,18,40,.72));
  pointer-events: none;
}
.gal-light { max-width: 100%; max-height: 64vh; border-radius: 14px; }
@media (max-width: 600px) {
  .gal-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 7px; }
}

/* 성장 플랜 */
/* 완료 항목을 opacity .55로 흐리면 실효 대비가 3.69까지 떨어져 글자가 안 읽힌다.
   '완료'는 취소선과 상태 세그먼트가 이미 말해 주므로 흐림은 최소로 (가독성 우선 의견) */
.item-row.plan-done .txt { opacity: .78; }
.item-row.plan-done .txt > div { text-decoration: line-through; }
.item-row .seg { padding: 3px; }
.item-row .seg button { padding: 5px 10px; font-size: .76rem; min-height: 32px; }

/* 친화 장소 */
.place-points { display: flex; flex-wrap: wrap; gap: 5px; }
.place-points .tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-soft); color: var(--accent-dark);
}
.place-card { height: 100%; }

/* 키링 카드 — 인쇄 전용 (화면에서는 숨겨 두고 print.css 가 노출) */
.keyring-print { position: absolute; left: -9999px; top: 0; }

/* 대시보드 아이 카드 — 한 줄 소개 */
.child-card .meta .oneline {
  font-size: .82rem; color: var(--primary-dark);
  margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 32. 홈 재구성 — 간단 프로필 + 복용 관리 + 기록 (웹·모바일) ---------- */
/* 아이 전환 칩 (2명 이상) */
.home-switch { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.home-switch-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px 5px 6px; border-radius: 999px;
  background: var(--surface); border: 1.5px solid var(--border-strong);
  font-weight: 700; font-size: .88rem; color: var(--text-muted);
  min-height: 40px; transition: .14s var(--ease);
}
.home-switch-chip:hover { border-color: var(--primary); }
.home-switch-chip .avatar { width: 28px; height: 28px; font-size: .74rem; }
.home-switch-chip.on { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-tint); }
.home-switch-chip.add { padding-left: 13px; border-style: dashed; }

/* 간단 프로필 */
/* 홈 프로필 — 아바타·이름·나이 / 소개글(2줄) / 반짝인 순간 강조 카드 / 사진 스트립 */
.home-profile { padding: 16px; margin-bottom: 16px; }
.hp-head { display: flex; gap: 12px; align-items: center; }
.hp-meta { flex: 1; min-width: 0; }
.hp-name { font-weight: 800; font-size: 1.2rem; line-height: 1.2; }
.hp-sub { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }
.hp-edit {
  flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--border); color: var(--text-muted); transition: .14s var(--ease);
}
.hp-edit:hover { border-color: var(--primary); color: var(--primary); }
/* 소개글 — 따뜻한 한마디, 잘리지 않게 2줄까지 */
.hp-intro {
  font-size: .9rem; color: var(--text); margin-top: 12px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* 반짝인 순간 — 탭 가능한 강조 카드('이해' 퍼플 tint) */
.hp-moment {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 11px 12px;
  border-radius: 12px; background: var(--brand-understand-soft); color: inherit;
}
.hp-moment-ico { flex: none; color: var(--brand-understand); display: inline-flex; }
.hp-moment-body { flex: 1; min-width: 0; }
.hp-moment-lab { display: block; font-size: .74rem; font-weight: 700; color: var(--brand-understand); }
.hp-moment-txt {
  display: block; font-size: .92rem; font-weight: 700; color: var(--text); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hp-moment-ago { font-weight: 400; color: var(--text-muted); font-size: .82rem; }
.hp-moment-arr { flex: none; color: var(--brand-understand); display: inline-flex; }
.hp-moment--empty { background: var(--surface-2); }
.hp-moment--empty .hp-moment-lab { color: var(--text-muted); }
.hp-moment--empty .hp-moment-txt { font-weight: 400; color: var(--text-muted); white-space: normal; }
/* 사진 스트립 — 라벨 없이, 마지막에 '전체' 타일 */
.hp-gallery-strip { display: flex; gap: 7px; margin-top: 12px; }
.hp-photo {
  flex: none; width: 58px; height: 58px; border-radius: 10px; overflow: hidden;
  display: block; background: var(--surface-2);
}
.hp-photo img { width: 100%; height: 100%; object-fit: cover; }
.hp-photo-more {
  display: grid; place-items: center; gap: 1px; text-align: center;
  border: 1px dashed var(--border-strong); background: var(--surface);
  color: var(--text-muted); font-size: .68rem; font-weight: 700;
}
.hp-photo-more:hover { border-color: var(--primary); color: var(--primary); }
/* 섹션 헤더 '전체 보기' 링크 (복용 관리·기록) */
.hp-link { font-size: .82rem; font-weight: 700; color: var(--primary); flex: none; }
.hp-link:hover { text-decoration: underline; }
.hp-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.hp-actions .btn { flex: 1; min-width: 132px; }

/* 홈 2단 그리드 (웹 ≥900px) / 1단 스택 (모바일) */
/* 복용 관리(위) → 기록(아래) 세로 1단 정렬 — 각 섹션 전체 폭 (2026-07-14 사용자 요청) */
.home-grid { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: start; }
.home-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.home-sec-head h2 { font-size: 1.1rem; }

/* Setlog식 빠른 기록 타일 */
/* 빠른 기록 타일 — 5개를 항상 한 줄에(모바일 포함). 모바일 컴팩트 → 데스크톱 여유 반응형 */
.quick-log {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px; margin-bottom: 14px;
}
/* 320px대(구형 폰)에서는 타일이 54px까지 좁아져 「행동 기록」이 두 줄로 접힌다
   → 3열로 바꿔 타일을 키운다(93px). 두 줄이 되는 것보다 두 행이 되는 편이 읽기 쉽다 */
@media (max-width: 359px) {
  .quick-log { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.quick-tile {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 11px 3px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  min-height: 74px; transition: .14s var(--ease); font: inherit; color: var(--text);
}
.quick-tile:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
/* 눌리는 느낌을 분명히 — 카드가 아니라 버튼임을 손끝으로도 알린다 */
.quick-tile:active { transform: scale(.96); background: var(--surface-2); }
.quick-tile:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.qt-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  position: relative; }
/* ⊕ 배지 — '새로 남긴다'는 행위를 아이콘 위에서 한 번 더 말해 준다.
   라벨 앞에 +를 붙이면 320px 폭에서 「행동 기록」이 두 줄로 접힌다.
   +는 SVG 대신 글자로 그린다 — 17px 배지 안에서 SVG는 크기 지정이 어긋났다. */
.qt-plus {
  position: absolute; right: -4px; top: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}
.qt-plus::before {
  content: '+'; font-size: 14px; font-weight: 800; line-height: 1;
  margin-top: -1px;
}
.qt-ico svg { width: 19px; height: 19px; }
.qt-label { font-size: .8rem; font-weight: 600; color: var(--text); line-height: 1.1; }
@media (min-width: 680px) {
  .quick-log { gap: 10px; }
  .quick-tile { padding: 16px 8px; gap: 10px; border-radius: var(--radius); min-height: 90px; }
  .qt-ico { width: 46px; height: 46px; border-radius: 14px; }
  .qt-ico svg { width: 22px; height: 22px; }
  .qt-label { font-size: .9rem; }
}

/* 기록 모달 — 기록 유형 버튼 선택 (드롭다운 대체) */
.type-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 7px; }
.type-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: .88rem; font-weight: 700; color: var(--text-muted); transition: .14s var(--ease);
}
.type-btn .type-ico { display: inline-flex; }
.type-btn:hover { border-color: var(--primary); }
.type-btn.on { border-color: var(--primary); background: var(--primary-tint); color: var(--primary-dark); box-shadow: var(--shadow-xs); }

/* 대상별 설명서 — 대상 선택 카드 */
.aud-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.aud-card {
  position: relative;
  text-align: left; padding: 16px; border-radius: var(--radius);
  border: 1.5px solid var(--border-strong); background: var(--surface);
  display: flex; gap: 13px; align-items: flex-start; cursor: pointer;
  transition: .14s var(--ease);
}
.aud-card:hover { border-color: var(--primary); background: var(--primary-tint); transform: translateY(-2px); }
.aud-card .aud-ico {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff;
}
.aud-card b { font-size: 1rem; }
.aud-card p { font-size: .82rem; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
@media (max-width: 560px) { .aud-grid { grid-template-columns: 1fr; } }
.aud-card.on { border-color: var(--primary); background: var(--primary-tint); box-shadow: var(--shadow-sm); }
.aud-edit-btn {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px;
  border-radius: 8px; background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--text-muted); z-index: 1;
}
.aud-edit-btn:hover { color: var(--primary); border-color: var(--primary); }
.aud-blockrow {
  display: flex; align-items: center; gap: 6px; padding: 7px 4px;
  border-bottom: 1px dashed var(--border);
}
.aud-blockrow:last-child { border-bottom: none; }
/* 공유 링크 전체 기록(히스토리) 모달 */
.hist-list { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; }
.hist-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.hist-main { flex: 1; min-width: 160px; }
.hist-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hist-row .btn { flex: none; }

/* 대상별 설명서 시트 — 인트로 + 대상 컬러 액센트 */
.aud-intro {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 14px; margin-bottom: 18px;
  font-size: .88rem; color: var(--text-muted); line-height: 1.5;
}
.aud-intro svg { flex: none; color: var(--primary); }
.aud-intro b { color: var(--text); }
.summary-sheet .sheet-top[style*="--aud"] {
  background: linear-gradient(135deg, var(--aud), color-mix(in srgb, var(--aud) 55%, #1b2a5c)) !important;
}

/* ---------- 2차 확장 ---------- */
/* 알림 벨 */
.app-bar .app-bell { position: relative; flex: none; }
.bell-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px;
  background: var(--danger); color: #fff; border-radius: 999px;
  font-size: .62rem; font-weight: 800; line-height: 16px; padding: 0 4px;
  text-align: center; pointer-events: none;
}
.bell-badge.hide { display: none; }
.notif-row {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 4px; border-bottom: 1px solid var(--border);
}
.notif-row:last-child { border-bottom: none; }
.notif-row.unread { background: var(--primary-tint); border-radius: 10px; padding: 12px 10px; }
.notif-row .notif-ico {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}

/* AI 설명서 초안 */
.ai-sug {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 15px; margin-bottom: 10px; background: var(--surface);
}
.ai-sug .ai-sug-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-size: .88rem; flex-wrap: wrap;
}
.ai-sug .ai-sug-head .dot { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.ai-sug .ai-src {
  margin-left: auto; font-size: .72rem; color: var(--brand-understand);
  background: var(--brand-understand-soft); border-radius: 999px; padding: 3px 9px;
  display: inline-flex; align-items: center; gap: 4px;
}
.ai-sug p { font-size: .92rem; line-height: 1.55; margin-bottom: 9px; }

/* 성장 타임라인 */
.tl-wrap { position: relative; padding-left: 6px; }
.tl-month {
  font-size: .8rem; font-weight: 800; color: var(--primary-dark);
  background: var(--primary-soft); display: inline-block;
  border-radius: 999px; padding: 5px 14px; margin: 6px 0 12px;
}
/* 성장 타임라인 전용 — 기록 게시판의 .tl-item(913행)과 클래스명이 겹쳐
   전역 오염되던 것을 .tl-wrap 아래로 스코프 (기록 카드에 새던 세로 막대·flex 제거) */
.tl-wrap .tl-item { display: flex; gap: 13px; position: relative; padding-bottom: 14px; margin-bottom: 0; }
.tl-wrap .tl-item::before {
  content: ''; position: absolute; left: 14px; top: 30px; bottom: -2px;
  width: 2px; height: auto; border: 0; border-radius: 0; box-shadow: none; background: var(--border);
}
.tl-wrap .tl-item:last-of-type::before { display: none; }
.tl-dot {
  width: 30px; height: 30px; border-radius: 50%; flex: none; z-index: 1;
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px var(--surface-3);
}
.tl-card {
  flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 15px; cursor: pointer;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.tl-card:hover { border-color: var(--primary-100); box-shadow: var(--shadow-sm); }
.tl-card.mile { background: var(--brand-grow-soft); border-color: transparent; cursor: default; }
.tl-card .tl-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: .78rem; }
.tl-card p { font-size: .86rem; color: var(--text-muted); margin-top: 3px; }

/* 케어팀 */
.team-card { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }

/* 안전구역 칩 삭제 버튼 */
.zone-x {
  border: none; background: rgba(255,255,255,.25); color: inherit;
  width: 18px; height: 18px; border-radius: 50%; font-size: .68rem;
  line-height: 1; cursor: pointer; margin-left: 2px;
}

/* 좁은 화면 — 항목 행(미래 준비 상태 세그 등)이 넘치면 컨트롤을 다음 줄로 랩
   (375에서 '준비/진행 중/완료'+삭제가 10px 넘쳐 가로 스크롤 발생하던 결함) */
@media (max-width: 640px) {
  .item-row { flex-wrap: wrap; }
  .item-row .txt { flex: 1 1 180px; min-width: 0; }
  .item-row .seg button { padding: 5px 8px; font-size: .74rem; }
}

/* 접근성: 모션 최소화 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 순위 막대 — 운영 현황에서 '무엇이 많은가'를 가로로 줄 세운다 */
.rank-bars { display: flex; flex-direction: column; gap: 9px; }
.rank-row { display: grid; grid-template-columns: minmax(0, 116px) 1fr auto; gap: 10px; align-items: center; }
.rank-label {
  font-size: .84rem; color: var(--text-muted); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.rank-fill { height: 100%; border-radius: 5px; background: var(--primary); transition: width .3s var(--ease); }
.rank-val { font-size: .84rem; font-weight: 800; color: var(--text); min-width: 34px; text-align: right; }
@media (max-width: 620px) {
  .rank-row { grid-template-columns: minmax(0, 90px) 1fr auto; }
}
/* 라벨이 길면(반려 사유 등) 막대 위 한 줄로 올려 잘리지 않게 한다 */
.rank-bars.stack { gap: 12px; }
.rank-bars.stack .rank-item { display: flex; flex-direction: column; gap: 5px; }
.rank-bars.stack .rank-label { white-space: normal; line-height: 1.45; color: var(--text); }
.rank-bars.stack .rank-row { grid-template-columns: 1fr auto; }

/* 미래 준비 — 카테고리 색을 태그 자체에 (아스트로젠 디자인 의견 8).
   예전에는 체크 불릿 색만으로 구분해, 무슨 영역인지 알 수 없었다. */
.area-tag {
  display: inline-flex; align-items: center;
  font-size: .7rem; font-weight: 800; padding: 3px 9px; border-radius: 999px;
  white-space: nowrap;
  /* 영역색을 그대로 글자에 쓰면 연한 배경 위에서 3.0 남짓이라 AA에 못 미친다
     → 검정을 42% 섞어 어둡게(4.5:1 이상), 배경·테두리만 영역색을 옅게 유지 */
  color: color-mix(in srgb, var(--area) 58%, #12203a);
  background: color-mix(in srgb, var(--area) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--area) 30%, #fff);
}


