/* Hamburger drawer, shared by every screen. Values come from tokens.css. */
/* The menu is a full screen of its own in the page frame (the whole phone screen, the 480px frame on PC),
   sliding in from the right like a page, with ← and the logo on top. */
.menu { position: fixed; top: 0; bottom: 0; left: 0; right: 0; z-index: 20; max-width: var(--page-max); margin: 0 auto; overflow: hidden; overflow: clip; }  /* clip: can never be scrolled sideways */
.menu-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column;
  width: 100%;
  padding: env(safe-area-inset-top) 0 max(var(--space-6), env(safe-area-inset-bottom));
  overflow-y: auto;
  background: var(--color-page);
  color: var(--color-text-primary);
  transform: translateX(100%);
  transition: transform var(--duration);
}
.menu.open .menu-panel { transform: none; }
/* Same bar as the page header: ← where the page's ← sits, the logo in the middle. */
.menu-top {
  display: grid; grid-template-columns: var(--tap) 1fr var(--tap); align-items: center; flex: none;
  height: var(--header-height);
  padding: 0 calc(var(--gutter) - (var(--tap) - var(--icon)) / 2);
  margin-bottom: var(--space-2);
}
.menu-close {
  display: grid; place-content: center;
  width: var(--tap); height: var(--tap);
  padding: 0; border: 0; background: none; cursor: pointer;
}
.menu-brand { margin: 0; text-align: center; font-size: var(--text-title-3); line-height: 1.4; font-weight: var(--weight-bold); }
.menu-close img { display: block; width: var(--icon); height: var(--icon); }
.menu-account { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-2) 24px var(--space-5); }  /* 320px처럼 좁으면 카카오 버튼이 아랫줄로 내려가요(화면 밖으로 안 나가게) */
.menu-avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--char-background); }
.menu-who { display: grid; font-size: var(--text-body); font-weight: var(--weight-bold); }
.menu-who span { font-size: var(--text-caption); font-weight: var(--weight-regular); color: var(--color-text-tertiary); }
/* › 줄(사주 보관함 · 리포트 | 초대하기 · 문어도사 일지): 상자 없이 아이콘 + 이름 + 오른쪽 ›(gray-500). 높이 56 */
/* 메뉴 판은 세로 flex라 화면이 짧으면 줄·상자가 눌려 납작해져요: 모두 flex: none으로 제 높이를 지켜요(넘치면 판이 스크롤) */
.menu-rows, .menu-list, .menu-divider, .menu-account { flex: none; }
.menu-rows { margin: 0; padding: 0; list-style: none; }
.menu-row {
  width: 100%; border: 0; background: none; font-family: inherit; text-align: left; cursor: pointer;  /* 로그아웃 줄은 <button> */
  display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 0 24px; box-sizing: border-box;
  color: var(--color-text-primary); font-size: var(--text-body); font-weight: var(--weight-bold); text-decoration: none;
}
.menu-row:hover { background: var(--color-hover); }
.menu-row img { display: block; width: var(--icon); height: var(--icon); flex: none; }  /* ic-saved.svg: 대화형 입력 상단 바의 보관함 아이콘과 같음 */
.menu-row::after {
  content: ""; flex: none; width: 20px; height: 20px; margin-left: auto; background: var(--gray-500);
  -webkit-mask: url("/src/assets/icons/ic-chevron-right.svg") center / contain no-repeat; mask: url("/src/assets/icons/ic-chevron-right.svg") center / contain no-repeat;
}
.menu-row em { margin-left: auto; font-size: var(--text-caption); font-style: normal; font-weight: var(--weight-bold); color: var(--color-text-accent); }  /* 초대하기 "무료 복채 증정" */
.menu-row:has(em)::after { margin-left: var(--space-1); }
.menu-rows li[hidden] { display: none; }
.menu-kakao {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
  height: 44px; padding: 0 var(--space-4); border-radius: var(--radius-md);
  background: var(--kakao); color: var(--kakao-ink);
  font-size: var(--text-caption); font-weight: var(--weight-bold); text-decoration: none; white-space: nowrap;
}
/* 글자 목록(.menu-list): › 없이 15 보통 글자, 줄 높이 36. 메뉴에서는 2026-11-18부터 안 씀(개인정보처리방침·이용약관은 홈 푸터로) */
.menu-list { margin: 0; padding: 0; list-style: none; }
.menu-rows + .menu-list { margin-top: var(--space-8); }
.menu-list a, .menu-list button {
  display: flex; align-items: center; width: 100%; min-height: 36px; padding: 0 24px; box-sizing: border-box;
  border: 0; background: none; color: var(--color-text-primary); text-align: left;
  font: inherit; font-size: var(--text-body-sm); font-weight: var(--weight-regular); text-decoration: none; cursor: pointer;
}
.menu-list a:hover, .menu-list button:hover { background: var(--color-hover); }
.menu-divider { height: 1px; margin: var(--space-2) 24px; background: var(--color-divider); }
/* 회원탈퇴: 맨 아래 작은 회색 밑줄 글자 버튼(.link.subtle) 하나 */
.menu-foot { margin-top: auto; padding: var(--space-8) 24px 0; }
.menu-withdraw { min-height: 0; margin: 0; padding: 0; font-size: var(--text-caption); }

/* Login bottom sheet over a dimmed page (src/login-sheet.js), inside the page frame */
.sheet { position: fixed; top: 0; bottom: 0; left: 0; right: 0; z-index: 30; max-width: var(--page-max); margin: 0 auto; overflow: hidden; overflow: clip; }
.sheet-scrim { position: absolute; inset: 0; background: var(--color-scrim); opacity: 0; transition: opacity var(--duration); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: calc(100% - var(--space-10)); overflow-y: auto;
  padding: var(--space-6) var(--gutter) max(var(--space-6), env(safe-area-inset-bottom));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--color-page); color: var(--color-text-primary);
  transform: translateY(100%); transition: transform .25s ease;
}
.sheet.open .sheet-scrim { opacity: 1; }
.sheet.open .sheet-panel { transform: none; }
.sheet-close {
  position: absolute; top: var(--space-3); right: calc(var(--gutter) - (var(--tap) - var(--icon)) / 2);
  display: grid; place-content: center; width: var(--tap); height: var(--tap);
  padding: 0; border: 0; background: none; cursor: pointer;
}
.sheet-close img { display: block; width: var(--icon); height: var(--icon); }
/* Starts below the close button (top 12px + 40px tap area, then 8px), so the face never sits beside it. */
.sheet-bubble { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); margin: calc(var(--space-3) + var(--tap) + var(--space-2) - var(--space-6)) 0 48px; text-align: center; }
.sheet-face { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--char-background); }
.sheet-bubble p { margin: 0; padding: 12px 16px; border-radius: var(--radius-lg); background: var(--char-background); font-weight: var(--weight-medium); }
.sheet-consent { display: flex; margin-bottom: 16px; font-size: var(--text-body-sm); line-height: 22px; }  /* checkbox: .md-check (controls.css) */
.sheet-consent a { color: inherit; }
.sheet-kakao {
  display: grid; place-content: center; min-height: 54px; border-radius: var(--radius-sm);
  background: var(--kakao); color: var(--kakao-ink); font-weight: var(--weight-bold); text-decoration: none;
}
.sheet-kakao[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
/* Info box: two short notes in a grey 8px-rounded box, above the Kakao button */
.sheet-info {
  margin: 0 0 var(--space-5); padding: var(--space-3) 14px; border: 1px solid var(--color-border); border-radius: 8px;
  font-size: var(--text-footnote); line-height: 1.6; color: var(--color-text-tertiary); text-align: center;
}
.sheet-info p { margin: 0; }
/* Consent after login (src/consent-sheet.js): the checkbox and the 동의하고 시작하기 button */
.sheet-agree { width: 100%; }
/* 동의 전 "동의하고 시작하기"는 비활성 주 버튼(src/base.css .primary[aria-disabled="true"]: 회색 바탕 + 흐린 글자) */
.sheet-consent.shake { animation: sheet-shake .35s; }
@keyframes sheet-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.menu.instant .menu-panel, .sheet.instant .sheet-scrim, .sheet.instant .sheet-panel { transition: none; }
@media (prefers-reduced-motion: reduce) { .menu-panel, .sheet-scrim, .sheet-panel { transition: none; } }


/* 상단 바 오른쪽 보관함 아이콘(☰ 대신, 누르면 /saved/ 로 바로): 나의 운명 펼쳐보기·오늘의 운세·인생 지도·우리 궁합. 크기는 ☰·← 와 같음 */
.saved-btn { display: grid; place-content: center; width: var(--tap); height: var(--tap); color: inherit; text-decoration: none; }
.saved-btn img { display: block; width: var(--icon); height: var(--icon); }

/* 사주 보관함에서 사람 고르기 바텀시트(src/person-sheet.js). 우리 궁합 사람 고르기 시트(.match-sheet, match.css)와 같은 모양:
   제목 20 굵게 → 한 줄 14 → 사람 상자(gray-100, radius-md, 관계 칩·이름 17, 성별·생일 14, 지금 사람은 "보는 중") → 주 버튼(폭 가득). */
html.person-sheet-lock, html.person-sheet-lock body { overflow: hidden; }
.person-sheet .sheet-scrim { touch-action: none; }
.person-sheet .sheet-panel { overscroll-behavior: contain; }
.person-sheet h2 { margin: var(--space-2) 0 0; padding-right: var(--tap); color: var(--color-text-primary); font-size: var(--text-title-2); font-weight: var(--weight-bold); }
.person-sheet .sheet-sub { margin: var(--space-1) 0 var(--space-3); color: var(--color-text-tertiary); font-size: var(--text-caption); word-break: keep-all; }
.person-sheet .person-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.person-sheet .person { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); width: 100%; min-height: 68px; padding: var(--space-3) var(--space-4); border: 0; border-radius: var(--radius-md); background: var(--gray-100); font: inherit; color: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.person-sheet .person:active { background: var(--gray-200); }
.person-sheet .person b { display: flex; align-items: center; flex-wrap: wrap; color: var(--color-text-primary); font-size: var(--text-title-3); font-weight: var(--weight-bold); }
.person-sheet .person small { display: block; color: var(--color-text-tertiary); font-size: var(--text-caption); }
.person-sheet .person .saved-rel { display: inline-block; margin-left: var(--space-2); vertical-align: 2px; padding: 2px var(--space-2); border-radius: var(--radius-pill); background: var(--color-page); color: var(--color-text-secondary); font-size: var(--text-micro); font-style: normal; font-weight: var(--weight-medium); }  /* 사주 보관함의 관계 칩(.saved-rel, sub.css)과 같음: sub.css를 안 쓰는 화면에서도 */
.person-sheet .person .saved-rel.me { background: var(--color-brand-tint); color: var(--color-brand-deep); }
.person-sheet .person .mark { color: var(--color-text-brand); font-size: var(--text-caption); font-weight: var(--weight-bold); white-space: nowrap; }
.person-sheet .person[aria-pressed="true"] b { color: var(--color-text-brand); }
/* 복채로 이미 연 사람(src/person-sheet.js opened): 우리 궁합 시트의 "왼쪽에 있어요"(match.css)와 같은 딤, 오른쪽 "열어 봤어요" 14 text-tertiary */
.person-sheet .person[disabled] { opacity: .4; cursor: default; }
.person-sheet .person[disabled]:active { background: var(--gray-100); }
.person-sheet .person[disabled] .mark { color: var(--color-text-tertiary); font-weight: var(--weight-medium); }
.person-opened-note { margin: var(--space-3) 0 0; color: var(--color-text-tertiary); font-size: var(--text-caption); text-align: center; }
.person-sheet .sheet-add { display: flex; align-items: center; justify-content: center; width: 100%; margin-top: var(--space-4); min-height: var(--button-height); }

/* 상단 바 오른쪽 공유하기 아이콘(오늘의 운세·인생 지도·우리 궁합 결과). 사주 명식 결과(saju.css .share-btn)와 같은 크기 */
.share-btn { display: grid; place-content: center; width: var(--tap); height: var(--tap); padding: 0; border: 0; background: none; cursor: pointer; }
.share-btn[hidden] { display: none; }
.share-btn img { display: block; width: var(--icon); height: var(--icon); }

/* 복채(src/menu.js bokchaeRow): 내 계정 아래 회색 상자. 왼쪽 동전 + "N개 복채", 오른쪽 진갈색 작은 알약 "복채 충전" */
.menu-bokchae {
  display: flex; flex: none; align-items: center; justify-content: space-between; gap: var(--space-3); height: 64px; margin: 0 24px var(--space-2); padding: 0 var(--space-3) 0 var(--space-5); box-sizing: border-box;
  border-radius: var(--radius-md); background: var(--gray-100); color: var(--color-text-primary); text-decoration: none;
}
.menu-bokchae[hidden] { display: none; }
.menu-bokchae-count { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-body); }
.menu-bokchae-count strong { font-size: var(--text-title-3); }
.menu-bokchae-chip { display: inline-flex; align-items: center; height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-sm); background: var(--color-button); font-size: var(--text-caption); font-weight: var(--weight-bold); color: var(--color-text-inverse); }
