/* 모바일 전용 - 뼈대 배치 (헤더 / 본문 / 하단 탭바) */

/* ================= 상단 헤더 ================= */
.m-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: rgba(10, 13, 20, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.m-header__party {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  max-width: 42vw;
  flex-shrink: 0;
}
.m-header__party-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-header__party i { font-size: 10px; color: var(--text-muted); }

.m-header__title {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-header__actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.m-icon-btn {
  width: var(--touch);
  height: var(--touch);
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 16px;
  transition: background 0.15s, color 0.15s;
}
.m-icon-btn:active {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
}

/* ================= 본문 ================= */
.m-view {
  padding: calc(var(--header-h) + 14px) 14px calc(var(--tabbar-h) + var(--safe-b) + 20px);
  min-height: 100%;
}

/* 화면 안의 구역 제목 */
.m-section {
  margin-bottom: 22px;
}
.m-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 2px;
}
.m-section__title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
}
.m-section__title i { color: var(--text-dark); font-size: 13px; }
.m-section__more {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  padding: 6px 2px;
}

/* ================= 하단 탭바 ================= */
.m-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(15, 19, 26, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}

.m-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-dark);
  font-size: 10.5px;
  font-weight: 600;
  transition: color 0.15s;
  position: relative;
}
.m-tab i { font-size: 18px; }
.m-tab.is-active { color: var(--gold); }
.m-tab.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 26px;
  height: 2.5px;
  border-radius: 0 0 3px 3px;
  background: var(--gold);
}
.m-tab:active { color: var(--text-muted); }

/* ================= 아래에서 올라오는 패널 ================= */
.m-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.m-sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }

.m-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 260;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-sheet);
  border-top: 1px solid var(--border-strong);
  border-radius: 20px 20px 0 0;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: var(--safe-b);
}
.m-sheet.is-open { transform: translateY(0); }

.m-sheet__handle {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--text-dark);
  margin: 9px auto 2px;
  flex-shrink: 0;
}
.m-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 4px 18px;
  flex-shrink: 0;
}
.m-sheet__title { font-size: 16px; font-weight: 700; }
.m-sheet__body {
  padding: 6px 16px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ================= 알림 문구 ================= */
.m-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  transform: translate(-50%, 12px);
  z-index: 280;
  max-width: 86vw;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(27, 35, 48, 0.96);
  border: 1px solid var(--border-strong);
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-toast.is-open { opacity: 1; transform: translate(-50%, 0); }
