/* 클럽 출석 — 회원 화면 (cx-design 1.5.1 토큰만 사용. hex/rgb 직접 쓰지 않는다) */

.mb [hidden] { display: none; }

.mb { background: var(--cx-bg); min-height: 100vh; }

/* 상단바 */
.mb-brand { display: inline-flex; align-items: center; gap: var(--cx-sp-2); }
.mb-logo { width: 26px; height: 26px; fill: var(--cx-primary); stroke: var(--cx-primary); }

/* 페이지 틀: 모바일 우선, 기본 폭 1,200px */
.mb-page {
  max-width: var(--cx-container);
  margin: 0 auto;
  padding: var(--cx-sp-5) var(--cx-gutter) calc(var(--cx-sp-12) + var(--cx-sp-10));
}

/* ── 처음 여는 중 (저장된 로그인 확인 전) ── */
.mb-boot { display: flex; flex-direction: column; gap: var(--cx-sp-3); max-width: 560px; }
.mb-boot__line  { display: block; width: 40%; height: 14px; }
.mb-boot__title { display: block; width: 60%; height: 28px; margin-bottom: var(--cx-sp-3); }
.mb-boot__card  { display: block; width: 100%; height: 160px; border-radius: var(--cx-r-lg); }

/* ── 로그인 ── */
.mb-auth { display: flex; justify-content: center; padding-top: var(--cx-sp-8); }
.mb-auth__card { width: 100%; max-width: 420px; padding: var(--cx-sp-8) var(--cx-sp-6); }
.mb-auth__head { margin-bottom: var(--cx-sp-6); }
.mb-auth__head .cx-muted { margin-top: var(--cx-sp-2); }
.mb-auth__foot { text-align: center; margin-top: var(--cx-sp-2); }
.mb-auth__error { margin-top: var(--cx-sp-4); }
.mb-pin { letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }
.mb-link { border: 0; background: none; padding: 0; color: var(--cx-primary-text); font: inherit; font-weight: var(--cx-fw-semibold); cursor: pointer; text-decoration: underline; }

/* ── 인사 줄 ── */
.mb-hello { margin-bottom: var(--cx-sp-5); }
.mb-hello__date { color: var(--cx-text-2); font-size: var(--cx-fs-sm); margin-bottom: var(--cx-sp-1); }

/* 위쪽 탭은 넓은 화면에서만, 좁은 화면은 아래 탭바 */
.mb-tabs { display: none; margin-bottom: var(--cx-sp-5); }

.mb-grid { display: grid; gap: var(--cx-sp-4); }
.mb-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--cx-sp-3); margin-bottom: var(--cx-sp-4); }
.mb-stats .cx-stat__value { font-size: var(--cx-fs-2xl); }
.mb-gap { margin-top: var(--cx-sp-4); }
.mb-actions { display: flex; gap: var(--cx-sp-2); margin-top: var(--cx-sp-4); flex-wrap: wrap; }
.mb-actions .cx-btn { flex: 1 1 140px; }

/* ── 현장 출석 카드 ── */
.mb-check { display: flex; flex-direction: column; gap: var(--cx-sp-3); }
.mb-place { display: flex; align-items: center; gap: var(--cx-sp-2); color: var(--cx-text-2); font-size: var(--cx-fs-sm); }
.mb-place svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--cx-primary); stroke-width: 1.8; }
.mb-check__btn { min-height: 56px; font-size: var(--cx-fs-lg); border-radius: var(--cx-r-lg); }
.mb-check__meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--cx-sp-2); padding-top: var(--cx-sp-3); border-top: var(--cx-border-w) solid var(--cx-border); }
.mb-check__meta div { display: flex; flex-direction: column; gap: var(--cx-sp-1); }
.mb-check__meta b { font-size: var(--cx-fs-xl); font-variant-numeric: tabular-nums; }
.mb-check__meta span { font-size: var(--cx-fs-xs); color: var(--cx-text-2); }
.mb-check[data-state="done"] { border-color: var(--cx-success); }
.mb-check[data-state="done"] .mb-check__btn { background: var(--cx-success-soft); color: var(--cx-success); border-color: transparent; }

/* ── 캘린더 ── */
.mb-cal__nav { display: inline-flex; align-items: center; gap: var(--cx-sp-1); }
.mb-cal__title { min-width: 96px; text-align: center; font-weight: var(--cx-fw-bold); font-variant-numeric: tabular-nums; }
.mb-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--cx-sp-1); }
.mb-cal__dow { margin-bottom: var(--cx-sp-1); }
.mb-cal__dow span { text-align: center; font-size: var(--cx-fs-xs); color: var(--cx-text-3); font-weight: var(--cx-fw-semibold); padding: var(--cx-sp-1) 0; }
.mb-cal__dow .is-sun { color: var(--cx-danger); }
.mb-cal__dow .is-sat { color: var(--cx-primary-text); }

.mb-day-cell {
  position: relative; aspect-ratio: 1; min-height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: var(--cx-border-w) solid transparent; border-radius: var(--cx-r-md);
  background: transparent; color: var(--cx-text); font: inherit; font-size: var(--cx-fs-sm);
  font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background var(--cx-dur-fast) var(--cx-ease);
}
.mb-day-cell:hover { background: var(--cx-surface-2); }
.mb-day-cell.is-empty { visibility: hidden; }
.mb-day-cell.is-sun, .mb-day-cell.is-holiday { color: var(--cx-danger); }
.mb-day-cell.is-sat { color: var(--cx-primary-text); }
.mb-day-cell.is-today { border-color: var(--cx-primary); color: var(--cx-primary-text); font-weight: var(--cx-fw-bold); }
.mb-day-cell.is-mine { background: var(--cx-primary); color: var(--cx-on-primary); font-weight: var(--cx-fw-bold); }
.mb-day-cell.is-picked { box-shadow: 0 0 0 2px var(--cx-surface), 0 0 0 4px var(--cx-accent); }
.mb-day-cell.has-others::after {
  content: ""; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: var(--cx-r-full); background: var(--cx-accent);
}
.mb-day-cell.is-mine.has-others::after { background: var(--cx-on-primary); }

.mb-legend { display: flex; gap: var(--cx-sp-4); margin-top: var(--cx-sp-3); font-size: var(--cx-fs-xs); color: var(--cx-text-2); }
.mb-legend span { display: inline-flex; align-items: center; gap: var(--cx-sp-1); }
.mb-legend i { display: inline-block; width: 10px; height: 10px; border-radius: var(--cx-r-full); }
.mb-legend__mine { background: var(--cx-primary); }
.mb-legend__others { background: var(--cx-accent); }

/* 고른 날짜 */
.mb-day { margin-top: var(--cx-sp-4); padding-top: var(--cx-sp-4); border-top: var(--cx-border-w) solid var(--cx-border); display: flex; flex-direction: column; gap: var(--cx-sp-3); }
.mb-day__head { display: flex; justify-content: space-between; align-items: center; }
.mb-day__label { font-size: var(--cx-fs-sm); color: var(--cx-text-2); font-weight: var(--cx-fw-semibold); margin-top: var(--cx-sp-2); }
.mb-chips { display: flex; flex-wrap: wrap; gap: var(--cx-sp-2); max-height: 360px; overflow-y: auto; }
.mb-chip { padding: var(--cx-sp-1) var(--cx-sp-3); border-radius: var(--cx-r-full); background: var(--cx-surface-2); font-size: var(--cx-fs-sm); font-weight: var(--cx-fw-semibold); }
.mb-chips .cx-caption { padding: var(--cx-sp-1) 0; }

.mb-skel { display: block; width: 100%; height: 20px; }

/* ── 목록 ── */
.mb-list { list-style: none; margin: 0; padding: 0; }
.mb-list li { display: flex; justify-content: space-between; align-items: center; padding: var(--cx-sp-3) 0; border-bottom: var(--cx-border-w) solid var(--cx-border); font-variant-numeric: tabular-nums; }
.mb-list li:last-child { border-bottom: 0; }
.mb-list .mb-list__sub { color: var(--cx-text-2); font-size: var(--cx-fs-sm); }
.mb-list .cx-empty { padding: var(--cx-sp-6) 0; border: 0; }

/* ── 배지 ── */
.mb-badge-group + .mb-badge-group { margin-top: var(--cx-sp-4); }
.mb-badge-group__title { font-size: var(--cx-fs-sm); color: var(--cx-text-2); font-weight: var(--cx-fw-semibold); margin-bottom: var(--cx-sp-2); }
.mb-badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--cx-sp-2); }
.mb-badge {
  display: flex; flex-direction: column; align-items: center; gap: var(--cx-sp-1);
  padding: var(--cx-sp-3) var(--cx-sp-1); border-radius: var(--cx-r-md);
  border: var(--cx-border-w) solid var(--cx-border); text-align: center;
}
.mb-badge__goal { font-size: var(--cx-fs-xl); font-weight: var(--cx-fw-bold); line-height: var(--cx-lh-tight); font-variant-numeric: tabular-nums; }
.mb-badge__lab { font-size: var(--cx-fs-xs); color: var(--cx-text-2); }
.mb-badge.is-earned { background: var(--cx-primary-soft); border-color: var(--cx-primary); }
.mb-badge.is-earned .mb-badge__goal { color: var(--cx-primary-text); }
.mb-badge.is-locked .mb-badge__goal { color: var(--cx-text-3); }

/* ── 셔틀콕 작은 지표 ── */
.mb-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--cx-sp-2); margin-bottom: var(--cx-sp-2); }
.mb-mini > div { display: flex; flex-direction: column; gap: var(--cx-sp-1); padding: var(--cx-sp-3); border-radius: var(--cx-r-md); background: var(--cx-surface-2); }
.mb-mini__v { font-size: var(--cx-fs-xl); font-weight: var(--cx-fw-bold); font-variant-numeric: tabular-nums; }
.mb-mini__l { font-size: var(--cx-fs-xs); color: var(--cx-text-2); }

/* ── 아래 탭바 (좁은 화면) ── */
.mb-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--cx-z-sticky);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: var(--cx-sp-1) var(--cx-sp-2) calc(var(--cx-sp-1) + env(safe-area-inset-bottom));
  background: var(--cx-surface); border-top: var(--cx-border-w) solid var(--cx-border);
}
.mb-bottom[hidden] { display: none; }
.mb-bottom button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; border: 0; background: transparent; color: var(--cx-text-3);
  font: inherit; font-size: var(--cx-fs-xs); font-weight: var(--cx-fw-semibold); cursor: pointer;
}
.mb-bottom svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mb-bottom button[aria-current="page"] { color: var(--cx-primary); }

/* ── 공지 ── */
.mb-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 var(--cx-sp-1);
  border-radius: var(--cx-r-full); background: var(--cx-danger); color: var(--cx-on-danger);
  font-size: var(--cx-fs-xs); font-weight: var(--cx-fw-bold); line-height: 1; vertical-align: 1px;
}
.mb-bottom__icon { position: relative; display: inline-flex; }
.mb-count--dot { position: absolute; top: -4px; right: -10px; }

.mb-banner {
  display: flex; align-items: center; gap: var(--cx-sp-3); width: 100%; margin-bottom: var(--cx-sp-4);
  padding: var(--cx-sp-3) var(--cx-sp-4); border: var(--cx-border-w) solid var(--cx-primary); border-radius: var(--cx-r-lg);
  background: var(--cx-primary-soft); color: var(--cx-text); font: inherit; text-align: left; cursor: pointer;
}
.mb-banner__text { flex: 1; min-width: 0; font-weight: var(--cx-fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-banner__go { color: var(--cx-primary-text); font-size: var(--cx-fs-xl); line-height: 1; }

.mb-notices { list-style: none; margin: 0; padding: 0; }
.mb-notice { border-bottom: var(--cx-border-w) solid var(--cx-border); }
.mb-notice:last-child { border-bottom: 0; }
.mb-notice__head {
  display: flex; align-items: center; gap: var(--cx-sp-2); width: 100%; padding: var(--cx-sp-4) 0;
  border: 0; background: none; color: var(--cx-text); font: inherit; text-align: left; cursor: pointer;
}
.mb-notice__title { flex: 1; min-width: 0; }
.mb-notice__date { flex: none; color: var(--cx-text-3); font-size: var(--cx-fs-xs); font-variant-numeric: tabular-nums; }
.mb-notice__new { flex: none; width: 8px; height: 8px; border-radius: var(--cx-r-full); background: var(--cx-danger); }
.mb-notice.is-unread .mb-notice__title { font-weight: var(--cx-fw-bold); }
.mb-notice.is-read .mb-notice__title { color: var(--cx-text-2); }
.mb-notice__body {
  margin: 0 0 var(--cx-sp-4); padding: var(--cx-sp-4); border-radius: var(--cx-r-md); background: var(--cx-surface-2);
  overflow-wrap: anywhere; line-height: var(--cx-lh-base); font-size: var(--cx-fs-sm);
}
.mb-notice__body a { color: var(--cx-primary-text); }
.mb-notice__meta { display: block; margin-top: var(--cx-sp-3); color: var(--cx-text-3); font-size: var(--cx-fs-xs); }

/* 공지 검색 · 태그 */
.mb-nsearch { position: relative; margin-bottom: var(--cx-sp-3); }
.mb-nsearch svg { position: absolute; left: var(--cx-sp-3); top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--cx-text-3); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.mb-nsearch .cx-input { padding-left: calc(var(--cx-sp-3) + 26px); }
.mb-ntags { display: flex; gap: var(--cx-sp-2); overflow-x: auto; padding-bottom: var(--cx-sp-1); margin-bottom: var(--cx-sp-2); scrollbar-width: none; }
.mb-ntags::-webkit-scrollbar { display: none; }
.mb-ntags:empty { display: none; }
.mb-tag {
  flex: none; display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--cx-sp-3);
  border: var(--cx-border-w) solid var(--cx-border); border-radius: var(--cx-r-full); background: var(--cx-surface);
  color: var(--cx-text-2); font: inherit; font-size: var(--cx-fs-sm); font-weight: var(--cx-fw-semibold); cursor: pointer; white-space: nowrap;
}
.mb-tag[aria-pressed="true"] { background: var(--cx-primary); border-color: var(--cx-primary); color: var(--cx-on-primary); }
.mb-tag__n { margin-left: var(--cx-sp-1); font-size: var(--cx-fs-xs); opacity: .7; }
.mb-nresult { margin: var(--cx-sp-1) 0 var(--cx-sp-2); }
.mb-notice__tags { display: flex; flex-wrap: wrap; gap: var(--cx-sp-1); margin: calc(-1 * var(--cx-sp-2)) 0 var(--cx-sp-3); }
.mb-notice__tag { border: 0; background: none; padding: 0; color: var(--cx-primary-text); font: inherit; font-size: var(--cx-fs-xs); font-weight: var(--cx-fw-semibold); cursor: pointer; }
.mb-notices mark { background: var(--cx-warning-soft); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ── 넓은 화면 ── */
@media (min-width: 768px) {
  .mb-page { padding-bottom: var(--cx-sp-12); }
  .mb-tabs { display: inline-flex; }
  .mb-bottom, .mb-bottom[hidden] { display: none; }
  .mb-stats { grid-template-columns: repeat(4, 1fr); }
  .mb-grid { grid-template-columns: 1fr 1fr; gap: var(--cx-sp-5); align-items: start; }
  /* 넓은 화면에서 정사각형이면 칸이 너무 커진다 → 높이 고정 */
  .mb-day-cell { aspect-ratio: auto; height: 48px; }
}
@media (min-width: 992px) {
  .mb-grid--attend { grid-template-columns: 360px 1fr; }
  .mb-check { position: sticky; top: calc(56px + var(--cx-sp-5)); }
  .mb-day-cell { height: 56px; font-size: var(--cx-fs-md); }
}
