/* 회원·트레이너 화면 공용 */
:root {
  --ink: #0c0c0d; --paper: #fff; --stone: #f3f3f4; --line: #e2e2e5; --muted: #6b6d72; --blue: #1010c8; --blue-soft: #ececfb;
  --warn: #b4410f; --warn-soft: #fdf0e8; --ok: #0f6e3a; --ok-soft: #e8f5ed; --gut: 16px;
  --sans: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--stone); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; min-height: 100vh; }
body.no-scroll { overflow: hidden; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.ex { font-family: Archivo, var(--sans); font-stretch: 125%; font-weight: 900; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1; }
.wm { font-family: Cinzel, serif; font-weight: 500; letter-spacing: 0.2em; font-size: 14px; text-decoration: none; white-space: nowrap; }

.demo-band { background: var(--ink); color: #fff; font-size: 12px; text-align: center; padding: 6px var(--gut); }
.bar-top { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px var(--gut); }
.bar-top .who { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.link-btn { background: none; border: 0; padding: 4px 0; font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.wrap { max-width: 760px; margin: 0 auto; padding: 18px var(--gut) 110px; }
.wrap.wide { max-width: 1120px; }
.tabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 49px; z-index: 25; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; min-height: 46px; padding: 0 16px; background: none; border: 0; border-bottom: 2px solid transparent; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab .n { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; background: var(--blue); color: #fff; font-size: 11px; margin-left: 4px; padding: 0 5px; }

h2.h { font-size: 19px; letter-spacing: -0.02em; margin: 26px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
h2.h:first-child { margin-top: 4px; }
h2.h small { font-size: 12px; font-weight: 500; color: var(--muted); }
.card { background: #fff; border: 1px solid var(--line); padding: 16px; }
.card + .card { margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { background: #fff; border: 1px dashed #cfd0d4; padding: 22px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.pre { white-space: pre-wrap; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px; font-weight: 700; font-size: 15px; border: 1px solid var(--ink); background: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.line { background: #fff; }
.btn.danger { background: #fff; border-color: var(--warn); color: var(--warn); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.row-btns { display: flex; gap: 8px; margin-top: 14px; }
.row-btns .btn { flex: 1; }

/* 입력 */
label.f { display: block; margin-top: 14px; }
label.f > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
label.f > span em { font-style: normal; font-weight: 500; color: var(--muted); margin-left: 4px; }
.in { width: 100%; min-height: 46px; border: 1px solid #cfd0d4; background: #fff; padding: 10px 12px; font-size: 16px; border-radius: 0; -webkit-appearance: none; appearance: none; }
textarea.in { min-height: 88px; resize: vertical; line-height: 1.55; }
.in:focus { border-color: var(--ink); outline: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--blue); flex: none; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.err { color: var(--warn); font-size: 13px; margin-top: 10px; min-height: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 38px; padding: 0 13px; border: 1px solid #cfd0d4; background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.pain[aria-pressed="true"] { background: var(--warn); border-color: var(--warn); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border: 1px solid var(--line); background: #fff; line-height: 18px; }
.tag.blue { background: var(--blue-soft); border-color: var(--blue-soft); color: var(--blue); }
.tag.warn { background: var(--warn-soft); border-color: var(--warn-soft); color: var(--warn); }
.tag.ok { background: var(--ok-soft); border-color: var(--ok-soft); color: var(--ok); }
.tag.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* 로그인 */
.gate { max-width: 440px; margin: 0 auto; padding: 32px var(--gut) 80px; }
.gate h1 { font-size: 26px; letter-spacing: -0.03em; line-height: 1.3; }
.gate .lead { color: var(--muted); margin-top: 8px; font-size: 14px; }
.seg { display: flex; margin-top: 22px; border: 1px solid var(--ink); }
.seg button { flex: 1; min-height: 44px; background: #fff; border: 0; font-weight: 700; cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--ink); color: #fff; }

/* 수업 카드 */
.lesson { display: grid; gap: 8px; }
.lesson-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lesson-when { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; }
.lesson-when small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.pain-box { background: var(--warn-soft); padding: 10px 12px; font-size: 13.5px; }
.pain-box b { color: var(--warn); font-size: 12px; display: block; margin-bottom: 4px; }
.log-box { background: var(--stone); padding: 12px; font-size: 14px; }
.log-box b { display: block; font-size: 12px; color: var(--blue); margin-bottom: 3px; }
.log-box + .log-box { margin-top: 6px; }

/* 시간 고르기 */
.days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.day { flex: 0 0 64px; min-height: 66px; border: 1px solid #cfd0d4; background: #fff; cursor: pointer; display: grid; place-items: center; padding: 6px 0; line-height: 1.2; }
.day b { font-size: 17px; }
.day span { font-size: 11px; color: var(--muted); }
.day[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.day[aria-pressed="true"] span { color: #c9cacd; }
.day:disabled { opacity: .35; cursor: default; }
.times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.time { min-height: 44px; border: 1px solid #cfd0d4; background: #fff; font-weight: 700; cursor: pointer; }
.time[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.step { margin-top: 22px; }
.step-h { display: flex; gap: 8px; align-items: baseline; font-weight: 800; font-size: 16px; margin-bottom: 10px; }
.step-h .ex { color: var(--blue); font-size: 13px; }
.notice { background: var(--stone); padding: 14px; font-size: 14px; white-space: pre-wrap; line-height: 1.7; }
input[type=range] { width: 100%; accent-color: var(--warn); }

/* 식단 */
.meal { display: grid; grid-template-columns: 76px 1fr; gap: 12px; }
.meal.nophoto { grid-template-columns: 1fr; }
.meal img { width: 76px; height: 76px; object-fit: cover; background: var(--stone); cursor: zoom-in; }
.meal-h { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.meal-h b { font-size: 14px; }
.reply { margin-top: 8px; border-left: 3px solid var(--blue); padding: 4px 0 4px 10px; font-size: 14px; }
.reply b { font-size: 11.5px; color: var(--blue); display: block; }
.reply.wait { border-left-color: var(--line); color: var(--muted); font-size: 13px; }
.photo-pick { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.photo-pick img { width: 64px; height: 64px; object-fit: cover; }

/* 숫자 칸 */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi { background: #fff; border: 1px solid var(--line); padding: 14px; }
.kpi b { display: block; font-family: Archivo, var(--sans); font-stretch: 125%; font-weight: 900; font-size: 30px; line-height: 1; }
.kpi b small { font-size: 14px; color: var(--muted); font-weight: 800; }
.kpi span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.kpi.alert b { color: var(--warn); }
.kpi.blue b { color: var(--blue); }

/* 회원 목록 */
.mrow { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; background: #fff; border: 1px solid var(--line); padding: 13px 14px; cursor: pointer; text-align: left; width: 100%; }
.mrow + .mrow { margin-top: -1px; }
.mrow:hover { background: #fafafb; }
.mrow-name { font-weight: 800; font-size: 15.5px; }
.mrow-meta { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.mrow-meta b { color: var(--ink); font-weight: 700; }

/* 일정 */
.wk-day { background: #fff; border: 1px solid var(--line); margin-top: 8px; }
.wk-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 800; }
.wk-h.off { color: var(--muted); }
.slot { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-top: 1px solid var(--stone); background: #fff; text-align: left; cursor: pointer; font-size: 14px; }
.slot:first-of-type { border-top: 0; }
.slot .t { width: 52px; font-weight: 800; flex: none; }
.slot.open .s { color: var(--muted); }
.slot.blocked { background: repeating-linear-gradient(135deg, #fff, #fff 6px, #f3f3f4 6px, #f3f3f4 12px); }
.slot.blocked .s { color: var(--muted); }
.hours-row { display: grid; grid-template-columns: 54px 1fr 1fr; gap: 8px; align-items: center; margin-top: 8px; }
.hours-row label { display: flex; align-items: center; gap: 6px; font-weight: 700; }

/* 공부 기록 관리 */
.st-row { display: grid; gap: 4px; }
.st-row h3 { font-size: 15.5px; }
.st-row .meta { font-size: 12.5px; color: var(--muted); }
.photo-now { width: 100%; aspect-ratio: 4 / 5; max-width: 240px; background: #8f9297 center / cover no-repeat; display: grid; place-items: center; color: #e6e6e8; font-size: 13px; }
.save-bar { position: sticky; bottom: 0; background: rgba(243,243,244,.96); padding: 10px 0 14px; margin-top: 16px; }

/* 작은 창 */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(12,12,13,0); display: flex; align-items: flex-end; justify-content: center; transition: background .2s; }
.sheet-wrap.in { background: rgba(12,12,13,.45); }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: #fff; padding: 22px var(--gut) calc(24px + env(safe-area-inset-bottom)); transform: translateY(24px); opacity: 0; transition: transform .2s, opacity .2s; overscroll-behavior: contain; }
.sheet.wide { max-width: 860px; }
.sheet-wrap.in .sheet { transform: none; opacity: 1; }
.sheet-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; background: none; font-size: 18px; cursor: pointer; }
.sheet h3 { font-size: 20px; letter-spacing: -0.02em; padding-right: 40px; }
.confirm-msg { font-size: 16px; font-weight: 600; padding: 8px 30px 4px 0; line-height: 1.55; }
.sheet .photo-big { width: 100%; max-height: 70vh; object-fit: contain; background: var(--stone); }

.toast-box { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 200; display: grid; justify-items: center; gap: 6px; pointer-events: none; padding: 0 var(--gut); }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; font-size: 14px; font-weight: 600; transition: opacity .3s, transform .3s; max-width: 100%; }
.toast.bad { background: var(--warn); }
.toast.out { opacity: 0; transform: translateY(6px); }
.banner { background: var(--blue-soft); color: var(--blue); padding: 12px 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }

@media (min-width: 760px) {
  :root { --gut: 24px; }
  .sheet-wrap { align-items: center; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; align-items: start; }
  .times { grid-template-columns: repeat(4, 1fr); }
}
