/* 사용자 가안(2026-10-10 Baby Sage)의 '내 프로필'·'프로필 수정'. A안 팝업의 배치(사이드바 = 프로필 옆 비모달 팝업,
   컴팩트 = 하단 시트)와 항목·순서는 그대로 두고 모양·치수만 가안을 따른다. 색은 tokens.css 의 --sage-* 만 쓴다.
   가안은 550px 독립 미리보기라 사이드바 팝업(400px)에서는 같은 비율로 조금 줄였고, 하단 시트는 가안의 휴대폰 값을 쓴다.
   포커스 표시는 가안의 옅은 #84aa8b(흰 면 2.6) 대신 앱 공통 --focus(6.29)를 쓴다. B 전역 팔레트/버튼 규칙과 섞지 않는다. */

/* ── 내 프로필(#modal-my-info) ── */
#modal-my-info {
  position: fixed; width: 400px; max-width: calc(100vw - 16px); max-height: min(70dvh, 560px);
  margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--sage-border); border-radius: var(--sage-radius); background: var(--sage-paper); color: var(--sage-ink);
  box-shadow: var(--sage-shadow), 0 8px 24px rgb(38 52 43 / .08);
  font-family: Pretendard, sans-serif; letter-spacing: -.028em; text-align: left;
}
#profile-panel-scrim { background: var(--scrim); }
#modal-my-info:not(.hidden) { transition: opacity var(--move), transform var(--move); }
body.profile-sheet-open { overflow: hidden; }
#modal-my-info.profile-preview-compact {
  width: 100%; max-width: none; max-height: calc(var(--visual-viewport-height, 100dvh) - 24px - var(--safe-top));
  border-radius: var(--sage-radius) var(--sage-radius) 0 0; border-bottom: 0; padding-bottom: var(--safe-bottom);
}
#modal-my-info .ui-icon { width: 24px; height: 24px; font-size: 24px; stroke-width: 1.8; flex: none; }
#modal-my-info .a-profile-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 72px; padding: 18px 14px 6px 24px; }
#modal-my-info .a-profile-head h2 { margin: 0; font-size: 26px; font-weight: 760; line-height: 1.3; letter-spacing: -.055em; color: var(--sage-ink); }
#modal-my-info [data-close-profile-panel] {
  position: relative; display: grid; place-items: center; width: 45px; height: 45px; padding: 0; border: 0; border-radius: var(--r-item);
  background: transparent; color: var(--sage-close); flex: none; transition: background-color var(--move);
}
#modal-my-info [data-close-profile-panel] .ui-icon { width: 25px; height: 25px; font-size: 25px; }
#modal-my-info [data-close-profile-panel]:hover { background: var(--sage-softer); }
#modal-my-info .pp-id { display: flex; align-items: center; gap: 18px; padding: 8px 24px 20px; }
#modal-my-info .pp-id > div { flex: 1; min-width: 0; display: grid; gap: 5px; }
#myinfo-avatar {
  display: grid; place-items: center; flex: none; width: 76px; height: 76px; border-radius: 50%;
  background: var(--sage-avatar); color: var(--sage-avatar-ink); font-size: 35px; font-weight: 700;
  background-size: cover; background-position: center;
}
#myinfo-name { font-size: 23px; font-weight: 750; line-height: 1.23; letter-spacing: -.055em; overflow-wrap: anywhere; }
#myinfo-sub { font-size: 16px; line-height: 1.45; color: var(--sage-secondary); overflow-wrap: anywhere; }
#modal-my-info .pp-facts { display: grid; grid-template-columns: 84px minmax(0, 1fr); column-gap: 8px; align-items: baseline; margin: 0; padding: 0 24px 14px; }
#modal-my-info .pp-facts > div { display: contents; }
#modal-my-info .pp-facts > div.hidden { display: none; }
#modal-my-info .pp-facts :is(dt, dd) { padding: 10px 0; }
#modal-my-info .pp-facts dt { font-size: 14px; color: var(--sage-muted); }
#modal-my-info .pp-facts dd { margin: 0; min-width: 0; font-size: 16px; font-weight: 525; line-height: 1.5; overflow-wrap: anywhere; }
#myinfo-studentid { font-variant-numeric: tabular-nums; }
#modal-my-info .pp-class-switch { padding: 0 24px 16px; }
#modal-my-info .pp-class-switch label { display: grid; gap: 8px; min-width: 0; }
#modal-my-info .pp-class-switch .school-field-label { color: var(--sage-muted); font-size: 14px; }
#modal-my-info .pp-class-switch select {
  width: 100%; min-width: 0; min-height: 51px; margin: 0; padding: 0 14px; border: 1px solid var(--sage-field-line); border-radius: 12px;
  background: var(--sage-field); color: var(--sage-ink); font-size: 15px;
}
#modal-my-info .pp-act { padding: 0 24px 22px; }
#modal-my-info #btn-open-profile-edit {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 24px;
  border: 1px solid var(--sage-btn-line); border-radius: 15px; background: var(--sage-paper); color: var(--sage-ink);
  font-size: 16px; font-weight: 720; line-height: 1.35; transition: background-color var(--move), border-color var(--move);
}
#modal-my-info #btn-open-profile-edit:hover { background: var(--sage-btn-hover); border-color: var(--sage-field-focus); }
#modal-my-info .a-profile-menu { display: grid; padding: 8px 16px; border-top: 1px solid var(--sage-line); }
#modal-my-info .a-profile-menu button {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 56px; padding: 6px 8px; border: 0; border-radius: 12px;
  background: transparent; color: var(--sage-ink-2); font-size: 16px; font-weight: 670; line-height: 1.35; text-align: left;
  transition: background-color var(--move), color var(--move);
}
#modal-my-info .a-profile-menu button.hidden { display: none; }
#modal-my-info .a-profile-menu button:hover { background: var(--sage-row-hover); }
#modal-my-info .a-profile-menu .ui-icon { color: var(--sage-icon); }
/* 가안의 두 묶음(명부·로그아웃 / 회원 탈퇴) 사이 구분선 — 패널 끝까지 닿는다. */
#modal-my-info .a-profile-menu hr { height: 1px; margin: 8px -16px; border: 0; background: var(--sage-line); }
#modal-my-info .a-profile-menu .a-profile-danger { min-height: 60px; }
#modal-my-info .a-profile-menu .a-profile-danger:hover, #modal-my-info .a-profile-menu .a-profile-danger:hover .ui-icon { color: var(--sage-error); }
#modal-my-info .a-profile-menu .a-profile-danger:hover { background: var(--sage-error-soft); }
#modal-my-info :is(button, select):focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
/* 하단 시트 — 가안의 휴대폰 값(제목 26·아바타 82·이름 25·줄 64/70). */
#modal-my-info.profile-preview-compact .a-profile-head { min-height: 76px; padding: 20px 12px 6px 21px; }
#modal-my-info.profile-preview-compact .pp-id { gap: 17px; padding: 8px 21px 22px; }
#modal-my-info.profile-preview-compact #myinfo-avatar { width: 82px; height: 82px; font-size: 38px; }
#modal-my-info.profile-preview-compact #myinfo-name { font-size: 25px; }
#modal-my-info.profile-preview-compact #myinfo-sub { font-size: 15px; }
#modal-my-info.profile-preview-compact .pp-facts { grid-template-columns: 85px minmax(0, 1fr); padding: 0 21px 14px; }
#modal-my-info.profile-preview-compact .pp-facts :is(dt, dd) { padding: 11px 0; }
#modal-my-info.profile-preview-compact :is(.pp-act, .pp-class-switch) { padding-left: 21px; padding-right: 21px; }
#modal-my-info.profile-preview-compact #btn-open-profile-edit { min-height: 58px; font-size: 17px; }
#modal-my-info.profile-preview-compact .a-profile-menu { padding: 8px 13px; }
#modal-my-info.profile-preview-compact .a-profile-menu button { min-height: 64px; gap: 18px; font-size: 17px; }
#modal-my-info.profile-preview-compact .a-profile-menu hr { margin: 8px -13px; }
#modal-my-info.profile-preview-compact .a-profile-menu .a-profile-danger { min-height: 70px; }
@media (max-width: 370px) {
  #modal-my-info.profile-preview-compact .pp-id { gap: 14px; }
  #modal-my-info.profile-preview-compact #myinfo-name { font-size: 23px; }
  #modal-my-info.profile-preview-compact .pp-facts { grid-template-columns: 70px minmax(0, 1fr); }
}

/* ── 프로필 수정 화면(#section-profile-edit) — 2026-10-10 사용자 지시로 팝업이 아닌 별도 화면이다(일반 사이트처럼).
   쪽 머리는 다른 화면과 같은 .screen-intro(앞에 뒤로 가기), 본문은 가안 '프로필 수정'의 카드 안 모양 그대로다. ── */
#section-profile-edit .profile-edit-intro { justify-content: flex-start; align-items: center; flex-wrap: nowrap; gap: 8px; }
#section-profile-edit .profile-edit-intro > div { min-width: 0; }
#section-profile-edit .profile-edit-back { flex: none; margin-left: -8px; }
#section-profile-edit .profile-edit-back .ui-icon { font-size: 22px; }
#section-profile-edit .sage-edit {
  width: min(100%, 640px); padding: 24px 24px 22px; border: 1px solid var(--sage-border); border-radius: var(--sage-radius);
  background: var(--sage-paper); color: var(--sage-ink); box-shadow: var(--sage-shadow); letter-spacing: -.028em;
}
#section-profile-edit .sage-edit-identity { display: flex; align-items: center; gap: 20px; margin: 0 0 22px; }
#section-profile-edit .sage-avatar-editor { position: relative; flex: none; width: 88px; height: 88px; padding: 0; border: 0; border-radius: 50%; background: none; }
#profile-photo-preview {
  display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%; overflow: hidden;
  background-color: var(--sage-avatar); color: var(--sage-avatar-ink); font-size: 40px; font-weight: 700;
  background-size: cover; background-position: center;
}
#section-profile-edit .sage-camera {
  position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%;
  background: var(--sage-paper); border: 1px solid var(--sage-btn-line); color: var(--sage-accent); box-shadow: 0 2px 6px rgb(38 63 43 / .07);
}
#section-profile-edit .sage-edit-copy { min-width: 0; }
#section-profile-edit .sage-edit-heading { margin: 0 0 5px; font-size: 22px; font-weight: 750; line-height: 1.3; letter-spacing: -.05em; }
#section-profile-edit .sage-helper { margin: 0; font-size: 13px; line-height: 1.55; color: var(--sage-muted); }
#section-profile-edit .sage-text-btn {
  display: inline-flex; align-items: center; min-height: 36px; margin: 2px 0 -6px -8px; padding: 0 8px; border: 0; border-radius: var(--r-btn);
  background: none; font-size: 13px; font-weight: 700; color: var(--sage-accent);
}
#section-profile-edit .sage-text-btn.hidden { display: none; }
#section-profile-edit .sage-text-btn--danger { color: var(--sage-error); }
#section-profile-edit .sage-text-btn--danger:hover { background: var(--sage-error-soft); }
#section-profile-edit .sage-sep { margin: 0 0 14px; border: 0; border-top: 1px solid var(--sage-line); }
#section-profile-edit .sage-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 0 13px; }
#section-profile-edit .sage-field { display: block; min-width: 0; margin: 0 0 16px; }
#section-profile-edit .sage-field.hidden { display: none; }
#section-profile-edit .sage-label { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--sage-ink); }
#section-profile-edit .sage-hint { font-size: 11px; font-weight: 500; color: var(--sage-muted); white-space: nowrap; }
#section-profile-edit .sage-input {
  width: 100%; min-width: 0; height: auto; min-height: 51px; margin: 0; padding: 12px 14px; border: 1px solid var(--sage-field-line); border-radius: 12px;
  background: var(--sage-field); color: var(--sage-ink); font-size: 15px; box-shadow: none; outline: none;
  transition: border-color var(--move), box-shadow var(--move);
}
#section-profile-edit .sage-input:focus { border-color: var(--sage-field-focus); box-shadow: var(--sage-field-ring); background: var(--sage-field); }
#section-profile-edit .sage-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
#section-profile-edit .sage-input[readonly] { background: var(--sage-readonly); border-color: var(--sage-readonly-line); color: var(--sage-muted); cursor: default; }
#section-profile-edit .sage-input[readonly]:focus { box-shadow: none; border-color: var(--sage-readonly-line); }
#section-profile-edit .sage-input[aria-invalid="true"] { border-color: var(--sage-error); }
#section-profile-edit .subject-chips { margin: 0 0 10px; }
/* 생일(월·일) 공개 — js/privacy-settings.js 가 생년월일 칸 뒤에 붙인다. 입력칸과 같은 테두리 상자로 묶는다. */
#section-profile-edit [data-birthday-profile] { margin: -4px 0 16px; padding: 4px 14px; border: 1px solid var(--sage-field-line); border-radius: 12px; background: var(--sage-field); }
#section-profile-edit [data-birthday-profile][hidden] { display: none; }
#section-profile-edit [data-birthday-profile] .list-item.list-item { padding: 10px 0; border-bottom: 0; gap: 12px; }
#section-profile-edit [data-birthday-profile] .meal-settings-note { margin: 0 0 8px; font-size: 12px; color: var(--sage-muted); }
#section-profile-edit [data-birthday-profile] .meal-settings-note:empty { display: none; }
#section-profile-edit .sage-explain { display: flex; align-items: flex-start; gap: 6px; margin: 2px 0 10px; font-size: 12px; line-height: 1.55; color: var(--sage-muted); }
#section-profile-edit .sage-explain .ui-icon { width: 15px; height: 15px; margin-top: 2px; flex: none; }
#section-profile-edit .sage-error { min-height: 18px; margin: 0 0 6px; font-size: 12px; line-height: 1.5; color: var(--sage-error); }
/* 저장 줄 — 양식 끝(일반 화면이라 본문과 함께 스크롤된다). */
#section-profile-edit .sage-buttons { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 6px; }
#section-profile-edit .sage-btn {
  min-height: 53px; padding: 0 16px; border: 1px solid var(--sage-btn-line); border-radius: var(--r-item); background: var(--sage-paper);
  color: var(--sage-ink); font-size: 15px; font-weight: 720; transition: background-color var(--move), border-color var(--move);
}
#section-profile-edit .sage-btn:hover { background: var(--sage-row-hover); }
#section-profile-edit .sage-btn--primary { background: var(--sage-primary); border-color: var(--sage-primary); color: #fff; }
#section-profile-edit .sage-btn--primary:hover { background: var(--sage-primary-hover); border-color: var(--sage-primary-hover); }
#section-profile-edit .sage-btn:disabled { opacity: .55; cursor: not-allowed; }
#section-profile-edit :is(.sage-avatar-editor, .sage-text-btn, .sage-btn):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 699.98px) {
  #section-profile-edit .sage-edit { width: 100%; padding: 20px 18px 18px; border-radius: var(--r-card); }
  #section-profile-edit #profile-photo-preview, #section-profile-edit .sage-avatar-editor { width: 82px; height: 82px; }
  #section-profile-edit .sage-edit-identity { gap: 17px; }
}
@media (max-width: 370px) {
  #section-profile-edit .sage-columns { grid-template-columns: 1fr; }
  #section-profile-edit .sage-edit-heading { font-size: 20px; }
}
