/* === 공통 === */
* { box-sizing: border-box; }

/* `display: grid` 가 [hidden] 의 기본 display:none 을 덮어쓰는 문제 차단. */
[hidden] { display: none !important; }
:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --border: #d0d7de;
  --text: #1f2328;
  --muted: #6e7781;
  --primary: #1f6feb;
  --primary-strong: #1a5fcc;
  --danger: #cf222e;
  --ok: #1a7f37;
  --ok-bg: #dafbe1;
  --pill-bg: #eaeef2;
  --header-h: 52px;
  --tabbar-h: 60px;
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-top: env(safe-area-inset-top);
}

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; }
.muted { color: var(--muted); font-size: 13px; }

/* === 부팅 splash === */
.splash-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
}
.splash-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--pill-bg);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: splash-spin 0.8s linear infinite;
}
@keyframes splash-spin { to { transform: rotate(360deg); } }

/* === 로그인 풀스크린 === */
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.login-card h1 {
  margin: 0 0 4px;
  font-size: 22px;
}
.login-card input {
  width: 100%;
  padding: 10px 12px;
  margin: 16px 0 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}
.login-card input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: transparent;
}
.login-card button {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}
.login-card button:hover { background: var(--primary-strong); }

.google-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  background: white !important;
  color: #1f2328 !important;
  border: 1px solid var(--border) !important;
  font-weight: 500;
}
.google-btn:hover { background: #f6f8fa !important; }
.google-btn svg { display: block; }

.result {
  background: #0d1117;
  color: #c9d1d9;
  padding: 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-top: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 28px;
  max-height: 40vh;
  overflow: auto;
}

/* === 앱 셸 === */
.app-view {
  min-height: 100vh;
  padding-top: calc(var(--header-h) + var(--safe-top));
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  background: var(--bg);
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 8px;
  z-index: 10;
}
.app-header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.app-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-btn {
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.icon-btn:active { background: var(--pill-bg); }

.app-main {
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
}

/* === 하단 탭 === */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 10;
}
.tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  font-size: 11px;
  padding: 6px 4px;
}
.tab svg { color: currentColor; }
.tab[aria-selected="true"] { color: var(--primary); }
.tab:active { background: var(--pill-bg); }

/* === 카드 / 공용 === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.card h2 {
  margin: 0 0 8px;
  font-size: 15px;
}
.card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}
.placeholder {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
  /* 앱 셸 내부에서 가용 높이 중앙 배치 */
  min-height: calc(100vh - var(--header-h) - var(--tabbar-h) - var(--safe-top) - var(--safe-bottom) - 32px);
  display: flex;
  align-items: center;
  justify-content: center;
}
button.ghost {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
button.ghost:active { background: #ffeef0; }

/* === 로딩 스피너 (확장 content.css 의 .wc-spinner 와 동일 스타일) === */
@keyframes wc-spin { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }
@keyframes wc-fade-in { from { opacity: 0; } to { opacity: 1; } }

.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  animation: wc-fade-in 0.2s ease-out;
  /* 앱 셸 내부에서 헤더~탭바 사이 가용 높이를 꽉 채워 정중앙 배치 */
  min-height: calc(100vh - var(--header-h) - var(--tabbar-h) - var(--safe-top) - var(--safe-bottom) - 32px);
}
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 4px solid var(--pill-bg);
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  border-radius: 50%;
  animation: wc-spin 0.9s linear infinite;
  box-sizing: border-box;
}
.loading-text {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* 인라인 로딩 오버레이 (카드/섹션 내부용) */
.loading-inline {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 5;
  border-radius: inherit;
  animation: wc-fade-in 0.15s ease-out;
}
.loading-inline .loading-spinner {
  width: 28px;
  height: 28px;
  border-width: 3px;
}
.loading-inline .loading-text {
  font-size: 12px;
}

/* === 오늘의 근무 (팀 근태) === */
.team-today {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px 6px;
}
.team-today-date {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  padding: 6px 0 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.team-today-info {
  font-size: 11px;
  color: var(--muted);
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--border);
}

.team-grid {
  display: grid;
}
.team-row {
  display: grid;
  grid-template-columns: minmax(48px, 1fr) 72px 56px 52px 52px;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-bottom: 1px solid #eef0f3;
  font-size: 13px;
}
/* admin 모드 — 퇴근 컬럼 추가 (6칸) */
.team-grid-admin .team-row {
  grid-template-columns: minmax(48px, 1fr) 64px 52px 48px 48px 48px;
}
.team-row:last-child { border-bottom: 0; }

.team-row-head {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.team-row-head .team-cell { font-weight: 500; }

.team-row-me {
  background: #f0f6ff;
  border-radius: 6px;
}
.team-row-me .team-cell-name { color: var(--primary); font-weight: 600; }

.team-cell {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-cell-name { font-weight: 500; text-align: left; }
.team-cell-empno {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.team-cell-code { text-align: center; }
.team-cell-bgn,
.team-cell-chk,
.team-cell-out {
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--text);
}

/* 헤더 셀도 데이터와 동일한 정렬 */
.team-row-head .team-cell:nth-child(1) { text-align: left; }
.team-row-head .team-cell:nth-child(2),
.team-row-head .team-cell:nth-child(3),
.team-row-head .team-cell:nth-child(4),
.team-row-head .team-cell:nth-child(5),
.team-row-head .team-cell:nth-child(6) { text-align: center; }

/* 근무코드 chip — 확장 팀 근태와 비슷한 색상감 */
.team-chip {
  display: inline-block;
  min-width: 44px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: #eef4ff;
  color: #1f6feb;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.team-chip.chip-day    { background: #eef4ff; color: #1f6feb; }
.team-chip.chip-leave  { background: #fff4e5; color: #b45309; }
.team-chip.chip-off    { background: #f1f1f1; color: #57606a; }
.team-chip.chip-default{ background: #eaeef2; color: #57606a; }

/* === 날짜 네비게이션 (오늘 근무 / 팀원 근태 공용) — prev / 날짜 / next / "오늘" 가로 한 줄 === */
.team-date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 2px 12px;
}
.team-date-label {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}
.team-dow { font-weight: 500; color: var(--muted); margin-left: 2px; }
.team-dow-sun { color: var(--danger); }
.team-dow-sat { color: var(--primary); }
.team-today-btn {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  border: 0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 4px;
  white-space: nowrap;
}
.team-today-btn:active { background: var(--primary-strong); }
.team-today-btn[disabled],
.team-today-btn--active {
  background: var(--pill-bg);
  color: var(--muted);
  cursor: default;
}

/* === 모바일 좁은 폭 === */
@media (max-width: 360px) {
  .tab span { font-size: 10px; }
  .team-row { grid-template-columns: minmax(40px, 1fr) 64px 50px 46px 46px; gap: 3px; }
  .team-cell-empno { font-size: 11px; }
  .cal-grid { font-size: 11px; }
}

/* === 나의 근무 — 월간 캘린더 === */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 0 12px;
}
.cal-title {
  font-size: 17px;
  font-weight: 600;
  min-width: 100px;
  text-align: center;
}
.cal-nav {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
}
.cal-nav:active { background: var(--pill-bg); }
.cal-nav:disabled { opacity: 0.3; cursor: default; }
.cal-today-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  margin-left: 4px;
}
.cal-today-btn:active { background: var(--pill-bg); }
.cal-today-btn--active { color: var(--primary); border-color: var(--primary); background: #f0f6ff; }
.cal-today-btn:disabled { cursor: default; }

/* 새로고침 버튼 — cal-nav 와 동일 크기, 클릭 시 회전 애니메이션 */
.cal-refresh { color: var(--muted); }
.cal-refresh:active { color: var(--primary); }
.cal-refresh.is-loading svg { animation: wc-spin 0.8s linear infinite; }

.cal-grid-wrap { position: relative; border-radius: 10px; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  user-select: none;
}
.cal-th {
  padding: 8px 2px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.cal-th-sun { color: var(--danger); }
.cal-th-sat { color: var(--primary); }

.cal-td {
  min-height: 56px;
  padding: 4px 3px;
  border-bottom: 1px solid #eef0f3;
  border-right: 1px solid #eef0f3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.cal-td:nth-child(7n) { border-right: 0; }
.cal-td-other {
  color: #c8ccd0;
  background: #fafbfc;
}
.cal-td-today { background: #f0f6ff; }
.cal-td-today .cal-date {
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 사용자가 클릭한 선택 셀 — 오늘과 별개로 표시 (오늘+선택 도 자연스럽게 보이도록 outline 사용) */
.cal-td[data-key] { cursor: pointer; }
.cal-td-selected { box-shadow: inset 0 0 0 2px var(--primary); border-radius: 6px; }
.cal-td-sun .cal-date { color: var(--danger); }
.cal-td-sat .cal-date { color: var(--primary); }
.cal-date {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

/* 근태 칩 */
.cal-chip {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 4px;
  border-radius: 3px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre-line;
  text-align: center;
  line-height: 1.3;
}
/* 칩에만 배경 적용 — me-next-* 등 다른 컨텍스트에선 글자색만 쓰도록 .cal-chip 스코프. */
.cal-chip.cal-work    { background: #eef4ff; color: #1f6feb; }
.cal-chip.cal-leave   { background: #fff4e5; color: #b45309; }
.cal-chip.cal-hwff    { background: #ddf4ff; color: #0969da; }
.cal-chip.cal-holiday { background: #ffeef0; color: #cf222e; }
.cal-chip.cal-plan    { background: #eaeef2; color: #57606a; }

/* 퇴근 태깅 칩 (admin 전용, 캘린더 셀 내) */
.cal-chip.cal-chip-out {
  background: #f0e6ff;
  color: #7c3aed;
  font-size: 9px;
}

/* === 팀원 근태 — 팀원 칩 선택 바 === */
.member-chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0 12px;
}
.member-chip {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.member-chip:active { background: var(--pill-bg); }
.member-chip--active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.member-chip--active:active { background: var(--primary-strong); }

/* === 설정 === */
.settings-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #eef0f3;
  font-size: 14px;
}
.settings-row:last-child { border-bottom: 0; }
.settings-label { color: var(--muted); font-size: 13px; }
.settings-value { font-weight: 500; }

/* === 변경 신청 — 카트 === */
.cart-list { padding: 0; }
.cart-item {
  padding: 12px 16px;
  border-bottom: 1px solid #eef0f3;
}
.cart-item:last-child { border-bottom: 0; }
.cart-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.cart-item-name { font-weight: 500; font-size: 14px; }
.cart-item-time {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  background: #eef4ff;
  padding: 2px 8px;
  border-radius: 4px;
}
.cart-item-dates {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* === 나의 근무 — 오늘 hero 카드 (월간 캘린더 위) === */
.me-today {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
  border-radius: 14px;
  padding: 18px 20px 20px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(31, 111, 235, 0.18);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.me-today-date {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.92;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
  min-height: 1em;
}
.me-today-time {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.15;
  white-space: nowrap;
  word-break: keep-all;
}
.me-today-tilde {
  display: inline-block;
  margin: 0 6px;
  font-weight: 400;
  opacity: 0.85;
}
.me-today-code {
  font-size: 13px;
  opacity: 0.95;
  margin-top: 10px;
  word-break: keep-all;
  line-height: 1.4;
}
.me-today-meta {
  font-size: 12px;
  opacity: 0.78;
  margin-top: 6px;
  min-height: 1em;
}
.me-today-tag {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

/* === 나의 근무 — 다음 일정 카드 === */
.me-next {
  padding: 14px 16px 8px;
}
.me-next-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
/* 3-column grid: 날짜(고정) | 코드+명칭(flex, 우측정렬) | 시간(고정 우측) */
/* 3-column grid: 날짜(고정) | 코드+명칭(우측정렬, 최소폭 보장) | 시간(고정 우측, 최소폭 보장).
   desc/time 컬럼에 min-width 를 줘서 ATND_N 길이가 달라도 시간 컬럼 시작 x 가 일정. */
.me-next-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  padding: 11px 2px;
  border-bottom: 1px solid #eef0f3;
  font-size: 14px;
  gap: 10px;
}
.me-next-row:last-child { border-bottom: 0; }
.me-next-date {
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.me-next-dow-sun { color: var(--danger); }
.me-next-dow-sat { color: var(--primary); }
.me-next-time {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
  font-size: 13px;
  /* "00:00~00:00" 패턴 = 11자 — 약간의 여유로 100px 잡아 시작 x 일정. */
  min-width: 100px;
  background: transparent;
}
.me-next-time-empty { color: var(--muted); }
.me-next-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: var(--pill-bg);
  color: var(--muted);
}
.me-next-tag.cal-leave   { background: #fff4e5; color: #b45309; }
.me-next-tag.cal-half    { background: #fff7e0; color: #9a6700; }
.me-next-tag.cal-hwff    { background: #ddf4ff; color: #0969da; }
.me-next-tag.cal-holiday { background: #ffeef0; color: #cf222e; }
.me-next-tag.cal-plan    { background: #eaeef2; color: #57606a; }

/* 코드 + 명칭 (시간 분리됨, 시간은 me-next-time) */
.me-next-desc {
  font-size: 13px;
  color: var(--text);
  text-align: right;
  word-break: keep-all;
  line-height: 1.4;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent;
  white-space: nowrap;
}
.me-next-desc.cal-work,
.me-next-time.cal-work    { color: var(--primary); }
.me-next-desc.cal-leave,
.me-next-time.cal-leave   { color: #b45309; }
.me-next-desc.cal-half,
.me-next-time.cal-half    { color: #9a6700; }
.me-next-desc.cal-hwff,
.me-next-time.cal-hwff    { color: #0969da; }
.me-next-desc.cal-holiday,
.me-next-time.cal-holiday { color: #cf222e; }
.me-next-desc.cal-plan,
.me-next-time.cal-plan    { color: #57606a; }

@media (max-width: 360px) {
  .me-today-time { font-size: 32px; letter-spacing: 0.5px; }
  .me-today { padding: 16px 14px 18px; }
}

/* === 변경 신청 — 빠른 변경 스타일 === */

/* 선택된 날짜 셀 */
.cal-td-selected {
  background: #dbeafe !important;
  box-shadow: inset 0 0 0 2px var(--primary);
  border-radius: 4px;
}
.cal-td-selected .cal-date {
  color: var(--primary);
  font-weight: 700;
}
/* 과거 날짜 비활성 */
.cal-td-past {
  opacity: 0.4;
  pointer-events: none;
}

/* 카트에 이미 담긴 날짜 칩 */
.cal-chip-cart {
  background: #dafbe1;
  color: var(--ok);
  font-size: 9px;
  font-weight: 600;
}

/* 시간 버튼 바 */
.apply-timebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin: 12px 0;
}
.apply-timebar-info {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  text-align: center;
}
.apply-timebar-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.apply-time-btn {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 52px;
  text-align: center;
}
.apply-time-btn:disabled { opacity: 0.4; cursor: default; }
.apply-time-btn:not(:disabled):active { background: var(--pill-bg); }
.apply-time-btn.apply-time--active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.apply-time-leave {
  border-color: #f0c060;
}
.apply-time-leave.apply-time--active {
  background: #b45309;
  border-color: #b45309;
}
.apply-timebar-actions {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
.apply-add-btn {
  padding: 10px 32px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  background: var(--primary);
  color: white;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.apply-add-btn:disabled { opacity: 0.4; cursor: default; }
.apply-add-btn:not(:disabled):active { background: var(--primary-strong); }

/* 카트 섹션 */
.apply-cart-section { margin-top: 4px; }
.apply-cart-section h2 { margin-bottom: 4px; }
.apply-cart-person {
  border-bottom: 1px solid #eef0f3;
  padding: 8px 0;
}
.apply-cart-person:last-child { border-bottom: 0; }
.apply-cart-me { background: #f8fbff; border-radius: 6px; padding: 8px 8px; }
.apply-cart-person-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.apply-cart-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}
.apply-cart-date {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 44px;
}
.apply-cart-time {
  color: var(--primary);
  font-weight: 500;
  flex: 1;
}
.apply-cart-remove {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--danger);
  cursor: pointer;
  font-size: 12px;
  flex-shrink: 0;
}
.apply-cart-remove:active { background: #ffeef0; }

/* === 관리자 — 환경 전환 토글 === */
.env-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.env-chip {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.env-chip:active { background: var(--pill-bg); }
.env-chip--active {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f6ff;
}
.env-chip[data-env="prd"].env-chip--active {
  border-color: var(--danger);
  color: var(--danger);
  background: #ffeef0;
}
.env-current {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
}

/* 선택 삭제 버튼 */
.apply-time-del {
  background: #ffeef0;
  color: var(--danger);
  border-color: var(--danger);
}
.apply-time-del:not(:disabled):active { background: #ffcdd2; }

/* 저장 버튼 */
.apply-save-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  background: var(--primary);
  color: white;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.apply-save-btn:disabled {
  background: var(--pill-bg);
  color: var(--muted);
  cursor: default;
}
.apply-save-btn:not(:disabled):active { background: var(--primary-strong); }

/* === 로그인 풀스크린 모달 === */
#loginModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  animation: wc-fade-in 0.2s ease-out;
}
.login-modal-spinner {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-right-color: #fff;
  border-radius: 50%;
  animation: wc-spin 0.9s linear infinite;
}
.login-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}
.login-modal-msg {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  line-height: 1.5;
}
.login-modal-id {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

/* === PWA 설치 배너 === */
.install-banner {
  position: fixed;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
  left: 12px;
  right: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 20;
  animation: wc-fade-in 0.25s ease-out;
}
.install-banner span {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}
.install-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  background: var(--primary);
  color: white;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.install-btn:active { background: var(--primary-strong); }
.install-dismiss {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}
