@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #e8eaed;
  --surface:   #ffffff;
  --surface2:  #f3f4f6;

  --border:    #d1d5db;
  --border-lt: #e5e7eb;

  --text:      #111827;
  --sub:       #4b5563;
  --hint:      #9ca3af;

  /* 홀수날 — 보라 */
  --purple:    #6d28d9;
  --purple-lt: #ede9fe;
  --purple-dk: #5b21b6;

  /* 짝수날 — 초록 */
  --green:     #059669;
  --green-bg:  #ecfdf5;
  --green-bd:  #6ee7b7;

  /* 그룹 — 파랑(slate-blue) */
  --group:     #1d4ed8;
  --group-lt:  #eff6ff;
  --group-dk:  #1e40af;
  --group-bd:  #93c5fd;

  --red:       #dc2626;
  --red-bg:    #fef2f2;

  --radius:    12px;
  --radius-sm: 8px;

  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.1);
}

body {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }

.view { display: none; }
.view.active { display: block; }
.hidden { display: none !important; }

/* ===== 버튼 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 7px 18px;
  transition: filter .14s, opacity .14s, transform .1s;
  white-space: nowrap;
}
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn:not(:disabled):hover { filter: brightness(1.08); }
.btn:not(:disabled):active { transform: scale(.96); }

.btn-primary { background: var(--purple); color: #fff; }
.btn-outline  { background: var(--surface); border: 1.5px solid var(--border); color: var(--sub); }
.btn-outline:not(:disabled):hover { border-color: var(--purple); color: var(--purple); }
.btn-ghost    { background: transparent; border: 1.5px solid rgba(255,255,255,.4); color: #fff; }
.btn-ghost:not(:disabled):hover { background: rgba(255,255,255,.12); }
.btn-danger   { background: var(--red); color: #fff; }

.btn-full { width: 100%; padding: 13px; font-size: 0.95rem; margin-top: 10px; }
.btn-sm   { padding: 5px 14px; font-size: 0.76rem; }

.btn-save {
  background: var(--purple);
  color: #fff;
  padding: 5px 12px;
  font-size: 0.74rem;
  border-radius: 50px;
}
.btn-save:disabled { background: var(--border); color: var(--hint); }

.btn-join {
  background: var(--purple);
  color: #fff;
  padding: 5px 12px;
  font-size: 0.74rem;
  border-radius: 50px;
  min-width: 52px;
}
.btn-join.joined { background: var(--red); }
.btn-join.join-self { background: var(--border); color: var(--hint); cursor: default; }

.btn-add-day {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  color: var(--hint);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, color .15s;
  box-shadow: var(--shadow);
}
.btn-add-day:hover { border-color: var(--purple); color: var(--purple); }
.btn-add-day::before { content: ''; }

/* ===== 인증 화면 ===== */
.auth-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 16px 60px;
  background: var(--bg);
}
.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--purple);
  margin-bottom: 28px;
}
.auth-card {
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border-lt);
  padding: 38px 34px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}
.auth-card h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 26px;
  color: var(--text);
}
.auth-link {
  text-align: center;
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--sub);
}

/* ===== 폼 ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sub);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.form-group input {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface2);
  border: 1.5px solid var(--border-lt);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.93rem;
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.form-group input::placeholder { color: var(--hint); }
.form-group input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(109,40,217,.1);
  background: var(--surface);
}
.form-group input[readonly] { opacity: .7; cursor: default; }
.req { color: var(--red); }
.hint { font-size: 0.73rem; color: var(--hint); margin-top: 5px; display: block; line-height: 1.5; }
.grp-pw-hint {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.6;
  display: block;
}
.grp-pw-hint p { margin: 0; }
.join-phone-hint {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #c2410c;
  line-height: 1.8;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1.5px solid #fdba74;
  border-left: 4px solid #ea580c;
  border-radius: 8px;
  padding: 10px 12px;
}

.group-input-row { display: flex; gap: 8px; }
.group-input-row input { flex: 1; }
.group-list {
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.group-list.hidden { display: none; }
.group-item {
  padding: 11px 15px;
  cursor: pointer;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-lt);
  color: var(--text);
  transition: background .12s;
}
.group-item:last-child { border-bottom: none; }
.group-item:hover { background: var(--purple-lt); color: var(--purple); }
.group-item.new-group { color: var(--purple); font-weight: 700; }

.group-pw-display { display: flex; gap: 8px; }
.group-pw-display input { flex: 1; }

.settings-info {
  background: var(--group-lt);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.9;
}
.settings-info strong { color: var(--group); }
.settings-divider {
  border: none;
  border-top: 1px solid var(--border-lt);
  margin: 18px 0;
}
.settings-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 12px;
}
.hint-inline { font-size: 0.75rem; font-weight: 400; color: var(--hint); text-transform: none; letter-spacing: 0; }

/* ===== 그룹 추가 블록 ===== */
.grp-add-block {
  background: var(--surface2);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  padding: 14px 14px 14px;
  margin-bottom: 4px;
}
.grp-add-block .form-group input {
  background: var(--surface);
  border-color: var(--border);
}
.grp-add-block .form-group input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(109,40,217,.1);
}
.grp-add-block-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 10px;
}
.grp-or-divider {
  display: flex;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--hint);
  font-size: 0.78rem;
}
.grp-or-divider::before,
.grp-or-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border-lt);
}

/* ===== 새 그룹 생성 섹션 ===== */
.new-group-section {
  background: var(--group-lt);
  border: 2px solid var(--group-bd);
  border-radius: var(--radius);
  padding: 16px 16px 4px;
  margin: 12px 0 16px;
}
.new-group-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--group);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.new-group-section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--group);
  border-radius: 2px;
}

/* ===== 카드 상단 그룹 헤더 바 ===== */
.card-group-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-lt);
  gap: 10px;
}
/* 홀수날 — 보라 헤더 */
.day-card.odd  .card-group-bar {
  background: linear-gradient(160deg, #7c3aed 0%, #5b21b6 100%);
  border-bottom: 1px solid rgba(0,0,0,.12);
}
/* 짝수날 — 초록 헤더 */
.day-card.even .card-group-bar {
  background: linear-gradient(160deg, #10b981 0%, #047857 100%);
  border-bottom: 1px solid rgba(0,0,0,.12);
}

.card-group-bar.overridden { opacity: .88; }

.card-group-bar-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}
.card-bar-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.card-bar-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.card-date-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.card-date-label strong { font-size: 1.4rem; font-weight: 900; }
.card-day-name { font-size: 1rem; font-weight: 700; color: rgba(255,255,255,.9); }
.card-odd-even-badge {
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.card-odd-even-badge.odd  { background: rgba(255,255,255,.22); color: #fff; }
.card-odd-even-badge.even { background: rgba(255,255,255,.22); color: #fff; }
.card-group-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,.95);
  white-space: nowrap;
  flex-shrink: 0;
}
.card-group-route {
  font-size: 0.72rem;
  color: rgba(255,255,255,.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.btn-group-change {
  flex-shrink: 0;
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.5);
  border-radius: 50px;
  color: #fff;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
  transition: background .14s;
  white-space: nowrap;
}
.btn-group-change:hover { background: rgba(255,255,255,.32); }

/* ===== 그룹 선택 모달 리스트 ===== */
.gp-item {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  transition: background .12s;
  border-bottom: 1px solid var(--border-lt);
}
.gp-item:last-child { border-bottom: none; }
.gp-item:hover { background: var(--purple-lt); color: var(--purple); }
.gp-item.active { color: var(--purple); }
.gp-route {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--hint);
  margin-top: 2px;
}

.gp-empty {
  padding: 20px 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--hint);
}

/* ===== 카드 경로 표시 ===== */
.card-route {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--purple);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  margin-top: 2px;
  text-transform: none;
  letter-spacing: 0;
}

/* ===== 그룹 경로 수정 ===== */
.route-edit-row {
  background: var(--surface2);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.route-edit-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 10px;
}

/* ===== 스케줄 헤더 장소명 ===== */
.sch-place-addr {
  font-size: 0.62rem;
  color: var(--hint);
  word-break: break-all;
  overflow-wrap: break-word;
  line-height: 1.3;
}
.sch-place-line {
  display: block;
  text-align: center;
  width: 100%;
  word-break: break-all;
  overflow-wrap: break-word;
  line-height: 1.4;
}
.sch-place-link {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.sch-place-link:hover { opacity: 0.75; }
.sch-place-main {
  font-size: 0.78rem;
  font-weight: 700;
  word-break: break-all;
  overflow-wrap: break-word;
  color: var(--group);
  text-transform: none;
  letter-spacing: 0;
}
.sch-place {
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--hint);
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

/* ===== 그룹 관리 화면 ===== */
.my-group-card {
  border: 1.5px solid var(--border-lt);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  background: var(--surface2);
}
.my-group-card.current {
  border-color: var(--group);
  background: var(--group-lt);
}
.my-group-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.my-group-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.my-group-pw {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sub);
}
.grp-set-default-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.83rem;
  color: var(--sub);
  cursor: pointer;
}
.grp-set-default-row input[type="checkbox"] { accent-color: var(--group); cursor: pointer; }

.my-group-pw-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-lt);
}
.my-group-pw-label {
  font-size: 0.72rem;
  color: var(--hint);
  font-weight: 500;
  flex-shrink: 0;
}
.my-group-pw-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sub);
  letter-spacing: 0.03em;
}
.my-group-card-meta {
  margin: 2px 0 4px;
}
.my-group-admin-name {
  font-size: 0.75rem;
  color: var(--sub);
  font-weight: 500;
}
.my-group-btn-row {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
/* ===== 그룹관리 탭 레이아웃 ===== */
#view-groups { display: none; flex-direction: column; height: 100vh; overflow: hidden; }
#view-groups.active { display: flex; }
.grp-tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 2px solid var(--border-lt);
  flex-shrink: 0;
}
.grp-tab {
  flex: 1;
  padding: 10px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--hint);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color .14s, border-color .14s;
  white-space: nowrap;
}
.grp-tab.active {
  color: var(--purple);
  border-bottom-color: var(--purple);
}
.grp-tab-panel { flex: 1; overflow-y: auto; }
.grp-scroll { padding: 16px; }
.grp-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  background: var(--surface);
  border: 2px dashed var(--border-lt);
  border-radius: var(--radius);
  margin: 16px;
}
.grp-empty-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  filter: grayscale(0.3);
}
.grp-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}
.grp-empty-desc {
  font-size: 0.82rem;
  color: var(--hint);
  line-height: 1.6;
  margin: 0;
}
.grp-form-wrap { max-width: 480px; margin: 0 auto; }
.grp-join-map-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--border-lt);
  margin-bottom: 14px;
}
.grp-join-map { height: 220px; width: 100%; }
.grp-join-map-info {
  padding: 10px 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.btn-group-map {
  flex-shrink: 0;
  background: transparent;
  border: 1.5px solid #2563eb;
  border-radius: 50px;
  color: #2563eb;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  transition: background .14s, color .14s;
  white-space: nowrap;
}
.btn-group-map:hover { background: #2563eb; color: #fff; }
/* 그룹 경로 모달 */
.group-route-info { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.grp-route-row { display: flex; align-items: flex-start; gap: 10px; }
.grp-route-label {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.72rem;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 2px;
}
.grp-route-label-origin { background: #ede9fe; color: #6d28d9; border: 1px solid #c4b5fd; }
.grp-route-label-dest   { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.grp-route-detail { display: flex; flex-direction: column; gap: 2px; }
.grp-route-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.grp-route-addr { font-size: 0.75rem; color: var(--hint); }
/* 그룹 경로 지도 오버레이 라벨 */
.grp-map-label {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.grp-map-label-origin { background: #ede9fe; color: #6d28d9; border: 1.5px solid #c4b5fd; }
.grp-map-label-dest   { background: #d1fae5; color: #065f46; border: 1.5px solid #6ee7b7; }
/* ====================== */

.btn-group-edit {
  flex-shrink: 0;
  background: transparent;
  border: 1.5px solid var(--group);
  border-radius: 50px;
  color: var(--group);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  transition: background .14s, color .14s;
  white-space: nowrap;
}
.btn-group-edit:hover { background: var(--group); color: #fff; }
.btn-group-leave {
  flex-shrink: 0;
  background: transparent;
  border: 1.5px solid var(--red);
  border-radius: 50px;
  color: var(--red);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  transition: background .14s, color .14s;
  white-space: nowrap;
}
.btn-group-leave:hover { background: var(--red); color: #fff; }
.btn-group-transfer {
  flex-shrink: 0;
  background: transparent;
  border: 1.5px solid #d97706;
  border-radius: 50px;
  color: #d97706;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  transition: background .14s, color .14s;
  white-space: nowrap;
}
.btn-group-transfer:hover { background: #d97706; color: #fff; }
.my-group-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.my-group-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--group);
  color: #fff;
  border-radius: 50px;
  padding: 2px 8px;
}
.my-group-route {
  font-size: 0.78rem;
  color: var(--hint);
  margin-bottom: 12px;
}
.grp-loc-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
}
.grp-loc-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.grp-loc-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--group);
  background: var(--group-lt);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}
.grp-loc-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.grp-loc-link {
  color: var(--group);
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.grp-loc-link:hover { color: var(--group-dk); }
.grp-loc-addr {
  font-size: 0.75rem;
  color: var(--hint);
}
.my-group-actions { margin-top: 10px; }

.admin-badge {
  background: var(--purple) !important;
  color: #fff !important;
}

/* 권한 위임 모달 */
.transfer-desc {
  font-size: 0.88rem;
  color: var(--sub);
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.6;
}
.transfer-member-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.transfer-member-item {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.transfer-member-item:hover { background: var(--surface2); }
.transfer-member-item.selected {
  border-color: var(--purple);
  background: var(--purple-lt);
}
.transfer-member-name { font-size: 0.9rem; font-weight: 600; }

/* ===== 그룹원 없음 ===== */
.sch-empty {
  padding: 16px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--hint);
}

.form-error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(220,38,38,.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 10px;
}

/* ===== 이메일 인증 ===== */
.verify-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.verify-input-row input { flex: 1; }
.verify-timer {
  font-size: 0.75rem;
  color: var(--red);
  font-weight: 600;
  margin-top: 4px;
}
.verify-ok {
  font-size: 0.78rem;
  color: #059669;
  font-weight: 700;
  margin-top: 6px;
}

/* ===== 헤더 ===== */
.app-header {
  background: var(--purple-dk);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(91,33,182,.3);
}
.header-inner {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  max-width: 900px;
  margin: 0 auto;
  gap: 6px;
}
/* ===== 헤더 요청 배지 ===== */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-req-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}
.req-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 50px;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}
.req-badge-admin {
  background: #fef3c7;
  color: #b45309;
  border-color: #fbbf24;
}
.req-badge-admin:hover { background: #fde68a; }
.req-badge-mine {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #c4b5fd;
}
.req-badge-mine:hover { background: #ddd6fe; }

.header-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-nav { display: flex; gap: 8px; }
.header-logo { font-size: 1.05rem; font-weight: 800; color: #fff; white-space: nowrap; }
.user-info   { font-size: 0.88rem; font-weight: 600; color: rgba(255,255,255,.9); white-space: nowrap; }
.user-info-clickable {
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 50px;
  transition: background .15s;
}
.user-info-clickable:hover { background: rgba(255,255,255,.18); }
.car-badge {
  background: rgba(255,255,255,.2);
  color: #fff;
  border-radius: 50px;
  padding: 2px 9px;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 700;
  margin-left: 3px;
}

/* ===== 카드 목록 ===== */
.card-list {
  max-width: 900px;
  margin: 0 auto;
  padding: 22px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 다음주 구분선 */
.next-week-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--hint);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 4px 0;
}
.next-week-sep::before,
.next-week-sep::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ===== 날짜 카드 ===== */
.day-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: none;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 1px 0 rgba(255,255,255,.8) inset,   /* 상단 하이라이트 */
    0 6px 0 0 rgba(0,0,0,.22),             /* 바닥 두께감 */
    0 8px 20px rgba(0,0,0,.12);            /* 주변 확산 그림자 */
  transition: box-shadow .18s, transform .15s;
}
.day-card:hover {
  transform: translateY(-2px);
}
.day-card.odd {
  border: 2px solid #7c3aed;
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 6px 0 0 #4c1d95,
    0 8px 24px rgba(109,40,217,.25);
}
.day-card.even {
  border: 2px solid #10b981;
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 6px 0 0 #065f46,
    0 8px 24px rgba(5,150,105,.22);
}
.day-card.odd:hover {
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 8px 0 0 #4c1d95,
    0 12px 28px rgba(109,40,217,.30);
}
.day-card.even:hover {
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 8px 0 0 #065f46,
    0 12px 28px rgba(5,150,105,.28);
}
.day-card-inner { display: flex; }

/* 스케줄 */
.schedule-col { flex: 1; overflow-x: auto; }

.sch-header {
  display: flex;
  background: #d8d0f5;
  border-top: 2px solid var(--purple);
  border-bottom: 2px solid var(--purple);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.day-card.even .sch-header {
  background: #d6f0e8;
  border-top-color: var(--green);
  border-bottom-color: var(--green);
  color: var(--green);
}
.day-card.even .sch-row.me.active.driving {
  background: linear-gradient(90deg, rgba(37,99,235,.12) 0%, rgba(37,99,235,.04) 100%);
  border-left: 3px solid #2563eb;
  outline-color: #2563eb;
}
.sch-header .sch-cell { padding: 8px 5px; }
.sch-header .sch-time {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  line-height: 1.4;
}

.sch-row {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border-lt);
  min-height: 50px;
  transition: background .12s;
}
.sch-row.active         { background: #fff; }
.sch-row.active:hover   { background: #f8f9ff; }
.sch-row.disabled       { background: var(--surface2); }
.sch-row.me.active      { background: #f0f4ff; }
.sch-row.me.active:hover{ background: #e8eeff; }
.sch-row.me.active.driving {
  background: linear-gradient(90deg, rgba(37,99,235,.12) 0%, rgba(37,99,235,.04) 100%);
  border-left: 3px solid #2563eb;
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  border-radius: 6px;
  position: relative;
  z-index: 1;
}

.sch-cell {
  padding: 6px 5px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* ===== 6-컬럼 고정 레이아웃 ===== */
.sch-driver    { flex: 0 0 10%;  min-width: 0; flex-direction: column; gap: 3px; padding-left: 20px; }
.sch-col-origin { flex: 0 0 30%; min-width: 0; }
.sch-col-mid   { flex: 0 0 5%;  }
.sch-col-dest  { flex: 0 0 30%; min-width: 0; }
.sch-col-save  { flex: 0 0 5%;  min-width: 0; flex-direction: column; align-items: center; gap: 2px; font-size: 0.6rem; }
.sch-note      { flex: 0 0 20%; min-width: 0; max-width: 20%; flex-direction: row; align-items: flex-start; flex-wrap: wrap; gap: 4px; padding: 6px 5px; align-content: flex-start; }
.sch-col-nodrive { flex: 0 0 70%; min-width: 0; display: flex; align-items: center; justify-content: center; }

/* 헤더 장소 컬럼: 텍스트 줄바꿈 허용 */
.sch-header .sch-col-origin,
.sch-header .sch-col-dest {
  flex-direction: column;
  align-items: center;
  text-align: center;
  word-break: break-all;
  overflow-wrap: break-word;
  padding: 8px 4px;
}

.driver-name { font-weight: 700; font-size: 1.05rem; color: var(--text); white-space: nowrap; }
.driver-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
}
.badge-odd  { background: var(--purple-lt); color: var(--purple); }
.badge-even { background: var(--green-bg);  color: var(--green); }
.sch-row.disabled .driver-badge { opacity: .5; }

.no-drive {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--hint);
}
.col-unset {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--hint);
  text-align: center;
  white-space: nowrap;
}

.save-stamp {
  font-size: 0.6rem;
  color: var(--hint);
  text-align: center;
  line-height: 1.3;
  min-height: 14px;
}
.sch-row.disabled .driver-name { color: var(--hint); }
.sch-row.me .driver-name::after {
  content: "It's me";
  display: block;
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--purple);
  background: rgba(109,40,217,.12);
  border-radius: 4px;
  padding: 2px 7px;
  margin-top: 3px;
  text-align: center;
}

/* 시간 버튼 */
.time-btn {
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  min-width: 62px;
  transition: filter .12s, transform .1s;
}
.time-btn:not(:disabled) {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.time-btn:not(:disabled):hover { filter: brightness(1.12); }
.time-btn:not(:disabled):active { transform: scale(.95); }
.time-btn:disabled {
  background: var(--border);
  color: var(--hint);
  cursor: not-allowed;
}
.time-btn.empty { background: transparent; border: 1.5px dashed var(--border); color: var(--hint); }
.time-btn.empty::before { content: '--:--'; }
.time-btn.empty:not(:disabled) { outline: 2px solid var(--red); outline-offset: 2px; }

/* 동행 목록 */
.join-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
}
.join-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--green-bg);
  border: 1px solid var(--green-bd);
  border-radius: 6px;
  padding: 3px 5px;
}
.join-item.is-me {
  background: var(--red-bg);
  border-color: #fca5a5;
}
.join-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}
.join-item.is-me .join-name { color: var(--red); }
.join-time {
  font-size: 0.58rem;
  color: var(--hint);
  white-space: nowrap;
}
.btn-join-cancel {
  font-size: 0.62rem;
  padding: 1px 5px;
  border: 1px solid var(--red);
  border-radius: 3px;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.5;
  width: 100%;
}
.btn-join-cancel:hover { background: var(--red); color: #fff; }
.join-na {
  font-size: 0.8rem;
  color: var(--hint);
}

/* 탈퇴 멤버 행 */
.sch-row.left-member {
  opacity: 0.55;
  background: var(--surface2);
}
.left-name {
  text-decoration: line-through;
  color: var(--hint);
}
.left-badge {
  background: #9ca3af;
  color: #fff;
  border-radius: 50px;
  font-size: 0.62rem;
  padding: 1px 7px;
  font-weight: 600;
}
.left-time {
  text-decoration: line-through;
  color: var(--hint);
  font-size: 0.8rem;
}

/* + 버튼 */
.add-day-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 8px 16px 48px;
}

/* ===== 시간 선택 모달 ===== */
/* ===== 토스트 알림 ===== */
.toast-msg {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  z-index: 9999;
  pointer-events: none;
  animation: toast-in .2s ease;
}
.toast-msg.hidden { display: none; }
.toast-success { background: #059669; }
.toast-error   { background: var(--red); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border-lt);
  padding: 28px 22px 22px;
  width: 288px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.modal-box h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 20px;
  text-align: center;
  color: var(--text);
}

.time-picker-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 20px;
  position: relative;
}
.time-picker-wrap::before,
.time-picker-wrap::after {
  content: '';
  position: absolute;
  left: 8px; right: 8px;
  height: 1.5px;
  background: var(--purple);
  pointer-events: none;
  z-index: 2;
}
.time-picker-wrap::before { top: calc(50% - 22px); }
.time-picker-wrap::after  { top: calc(50% + 22px); }

.drum-col {
  width: 78px;
  height: 154px;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--surface2);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.drum-col::-webkit-scrollbar { display: none; }
.drum-spacer { height: 55px; }

.drum-item {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--hint);
  scroll-snap-align: center;
  cursor: pointer;
  user-select: none;
  transition: color .1s, font-size .1s;
  border-radius: 6px;
}
.drum-item:not(.selected):hover { color: var(--sub); background: var(--border-lt); }
.drum-item.selected { color: var(--purple); font-size: 1.45rem; font-weight: 800; }

.colon { font-size: 1.6rem; font-weight: 800; color: var(--sub); line-height: 1; }

.modal-actions { display: flex; gap: 8px; }
.modal-actions .btn { flex: 1; padding: 11px 8px; }

.confirm-message {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.6;
  white-space: pre-line;
}

/* ===== 반응형 ===== */
@media (max-width: 600px) {
  .card-list     { padding: 12px 8px 0; gap: 14px; }
  /* 카드 바 */
  .card-group-bar { padding: 10px 12px; gap: 8px; }
  .card-date-label { font-size: 0.95rem; }
  .card-date-label strong { font-size: 1.25rem; }
  .card-bar-bottom { margin-top: 1px; }
  .card-group-name { font-size: 0.78rem; }
  .card-group-route { font-size: 0.68rem; }
  .btn-group-change { font-size: 0.68rem; padding: 4px 10px; }
  /* 스케줄 */
  .sch-header .sch-cell { font-size: 0.62rem; padding: 6px 3px; }
  .time-btn      { min-width: 46px; padding: 4px 3px; font-size: 0.72rem; }
  .btn-save      { padding: 3px 5px; font-size: 0.65rem; }
  .btn-join      { padding: 4px 6px; font-size: 0.68rem; min-width: 40px; }
  .driver-name   { font-size: 0.78rem; }
  .driver-badge  { font-size: 0.6rem; }
  .save-stamp    { font-size: 0.58rem; }
  .auth-card     { padding: 28px 20px; }
  /* 스케줄 장소 헤더 */
  .sch-place-main { font-size: 0.68rem; }
  .sch-place-addr { font-size: 0.56rem; }
  .sch-place-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }
  .sch-header .sch-col-origin,
  .sch-header .sch-col-dest { overflow: hidden; }
  /* 모바일 컬럼: 10% / 40% / 10%(저장) / 40%, 동행은 아래 */
  .sch-driver    { flex: 0 0 10%; }
  .sch-col-origin { flex: 0 0 40%; order: 1; }
  .sch-col-mid   { display: none; }
  .sch-col-dest  { flex: 0 0 40%; order: 3; }
  .sch-col-save  { flex: 0 0 10%; order: 2; }
  .sch-col-nodrive { flex: 0 0 90%; }
  .sch-note-header { display: none; }
  .sch-header, .sch-row { flex-wrap: wrap; }
  .sch-note {
    order: 10;
    flex: 0 0 100%;
    max-width: 100%;
    border-top: 1px solid var(--border-lt);
    justify-content: flex-start;
    padding: 4px 5px 4px calc(10% + 4px);
    min-height: 0;
  }
  .sch-note:empty { display: none; }
  .sch-note .join-na { display: none; }
}
@media (max-width: 380px) {
  .save-stamp { display: none; }
}

/* ===== 경로 구경하기 ===== */
#view-explore { display: none; flex-direction: column; height: 100vh; }
#view-explore.active { display: flex; }

.explore-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.explore-map {
  flex: 1;
  min-height: 0;
}
.explore-list {
  width: 300px;
  flex-shrink: 0;
  overflow-y: auto;
  background: var(--bg);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 1px solid var(--border-lt);
}
.explore-empty { font-size: .85rem; color: var(--hint); padding: 16px; text-align: center; }

/* 그룹 카드 */
.exlc-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.exlc-card:hover { box-shadow: var(--shadow-md); }
.exlc-card.active { border-color: var(--purple); }
.exlc-card.dimmed { opacity: 0.38; }
.exlc-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  margin-top: 1px;
}
.exlc-body { flex: 1; min-width: 0; }
.exlc-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.exlc-grpname {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
}
.exlc-admin {
  font-size: .72rem;
  font-weight: 500;
  color: var(--hint);
  white-space: nowrap;
  flex-shrink: 0;
}
.exlc-admin-link {
  cursor: pointer;
  color: var(--purple);
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.exlc-admin-link:hover { opacity: 0.75; }

/* ===== 동행 요청 모달 ===== */
.join-req-group {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--purple);
  margin-bottom: 12px;
}
/* 요청자 정보 박스 */
.join-req-info-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #f8f7ff;
  border: 1px solid #ddd6fe;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.join-req-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.83rem;
}
.join-req-info-label {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  background: #ede9fe;
  color: var(--purple);
  padding: 2px 7px;
  border-radius: 4px;
  min-width: 40px;
  text-align: center;
}
.join-req-info-value {
  color: var(--text);
  font-weight: 500;
}
/* 비고 textarea */
.join-req-memo-area {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color .2s, box-shadow .2s;
  background: #fafaf9;
  font-family: inherit;
  color: var(--text);
  box-sizing: border-box;
}
.join-req-memo-area:focus {
  outline: none;
  border-color: var(--purple);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
.join-req-memo-area::placeholder {
  color: #b0aec8;
  font-size: 0.8rem;
}
.join-req-notice {
  font-size: 0.72rem;
  color: var(--hint);
  margin-top: 12px;
  text-align: center;
  line-height: 1.5;
}
.join-req-notice-warn {
  color: var(--red);
  font-weight: 700;
}

/* ===== 그룹장 요청 확인 팝업 ===== */
.admin-req-info { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.admin-req-row  { display: flex; align-items: baseline; gap: 10px; font-size: 0.88rem; }
.admin-req-label {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--purple-lt);
  color: var(--purple);
  padding: 2px 7px;
  border-radius: 4px;
  min-width: 44px;
  text-align: center;
}
.admin-req-memo {
  white-space: pre-wrap;
  background: #f8f7ff;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.82rem;
  color: #374151;
  flex: 1;
}
.hint-inline {
  font-size: 0.72rem;
  color: var(--hint);
  font-weight: 400;
  margin-left: 4px;
}
.admin-req-count {
  font-size: 0.75rem;
  color: var(--hint);
  text-align: right;
  margin-top: 4px;
}

/* ===== 요청 관리 모달 ===== */
.req-mgmt-box {
  width: min(480px, 96vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.req-mgmt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.req-mgmt-header h3 { margin: 0; font-size: 1rem; }
.btn-close-x {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--hint);
  padding: 4px 8px;
  border-radius: 6px;
}
.btn-close-x:hover { background: var(--bg); }
.req-mgmt-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  background: var(--card);
}
.req-mgmt-tab {
  flex: 1;
  padding: 10px 0;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--hint);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.req-mgmt-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.req-mgmt-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.req-mgmt-loading, .req-mgmt-empty {
  text-align: center;
  color: var(--hint);
  font-size: 0.85rem;
  padding: 32px 0;
}
.req-mgmt-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.req-mgmt-card-history { opacity: 0.85; }
.req-mgmt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.req-mgmt-grp {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}
.req-mgmt-date {
  font-size: 0.72rem;
  color: var(--hint);
}
.req-mgmt-row {
  display: flex;
  gap: 8px;
  font-size: 0.82rem;
}
.req-mgmt-label {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--hint);
  background: var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  min-width: 40px;
  text-align: center;
  align-self: flex-start;
}
.req-mgmt-memo {
  white-space: pre-wrap;
  color: #374151;
  font-size: 0.82rem;
}
.req-mgmt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.req-mgmt-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
}
.req-mgmt-badge-pending { background: #fef9c3; color: #92400e; }
.req-mgmt-badge-ok      { background: #dcfce7; color: #166534; }
.req-mgmt-badge-ng      { background: #fee2e2; color: #991b1b; }
.exlc-route { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.exlc-place {
  display: flex; align-items: center; gap: 3px;
  font-size: .75rem; font-weight: 600; color: var(--sub);
}
.exlc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.exlc-dot.dest-dot {
  background: transparent;
  border: 2px solid;
}
.exlc-arrow { font-size: .7rem; color: var(--hint); }
.exlc-no-route { font-size: .72rem; color: var(--hint); font-style: italic; }
.exlc-hint { font-size: .68rem; color: var(--hint); margin-top: 3px; }
.btn-kakaomap {
  display: inline-block;
  margin-top: 6px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--group);
  border: 1.5px solid var(--group-bd);
  border-radius: 50px;
  padding: 3px 10px;
  text-decoration: none;
  transition: background .14s, color .14s;
  white-space: nowrap;
}
.btn-kakaomap:hover { background: var(--group); color: #fff; text-decoration: none; }
.exlc-btn-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.exlc-btn-row .btn-kakaomap { margin-top: 0; }
.btn-join-request {
  font-size: .72rem;
  font-weight: 600;
  color: var(--purple);
  border: 1.5px solid var(--purple);
  border-radius: 50px;
  padding: 3px 10px;
  background: transparent;
  cursor: pointer;
  transition: background .14s, color .14s;
  white-space: nowrap;
  font-family: inherit;
}
.btn-join-request:hover { background: var(--purple); color: #fff; }
.btn-already-member {
  font-size: .72rem;
  font-weight: 600;
  color: var(--hint);
  border: 1.5px solid var(--border-lt);
  border-radius: 50px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* 지도 커스텀 마커 */
.xmk {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
}
.xmk-loc-label {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
  margin-bottom: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.xmk-body {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 900;
  line-height: 1;
  box-sizing: border-box;
}
.xmk:hover .xmk-body { transform: scale(1.15); transition: transform .12s; }
.xmk-tip {
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid;
}
.xmk-tt {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
  white-space: nowrap;
  z-index: 300;
  pointer-events: none;
  min-width: 130px;
  text-align: left;
}
.xmk-tt::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #fff;
}
.xmk-tt-label { font-size: .68rem; font-weight: 800; margin-bottom: 3px; }
.xmk-tt-name  { font-size: .82rem; font-weight: 700; color: var(--text); }
.xmk-tt-addr  { font-size: .7rem;  color: var(--hint); margin-top: 2px; word-break: keep-all; max-width: 200px; white-space: normal; }

/* 모바일: 지도 위 리스트 아래 수직 배치 */
@media (max-width: 600px) {
  .explore-body { flex-direction: column; }
  .explore-map  { height: 48vh; flex: none; }
  .explore-list { width: 100%; border-left: none; border-top: 1px solid var(--border-lt); flex: 1; }
}

/* ===== 위치 선택 모달 ===== */
.loc-modal-box {
  width: min(540px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 20px 20px;
}

.loc-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.loc-search-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
}
.loc-search-row input:focus { border-color: var(--group); }

.loc-search-results {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 10px;
  background: var(--surface);
}
.loc-result-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-lt);
  transition: background .15s;
}
.loc-result-item:last-child { border-bottom: none; }
.loc-result-item:hover { background: var(--group-lt); }
.loc-result-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.loc-result-addr {
  font-size: 0.78rem;
  color: var(--sub);
  margin-top: 2px;
}
.loc-no-result {
  padding: 14px;
  text-align: center;
  color: var(--hint);
  font-size: 0.85rem;
}

.loc-map {
  width: 100%;
  height: 260px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  background: var(--surface2);
}

.loc-view-addr {
  font-size: 0.82rem;
  color: var(--sub);
  text-align: center;
  padding: 8px 4px 0;
  line-height: 1.4;
}
.loc-view-owner {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--purple);
  text-align: center;
  padding: 6px 4px 0;
}

.loc-name-row {
  margin-bottom: 16px;
}
.loc-name-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sub);
  margin-bottom: 6px;
}
.loc-name-row input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
}
.loc-name-row input:focus { border-color: var(--group); }

.loc-current-addr {
  font-size: 0.75rem;
  color: var(--hint);
  margin-top: 4px;
  padding-left: 2px;
}

.loc-map-hint {
  font-size: 0.78rem;
  color: var(--hint);
  text-align: center;
  margin: 8px 0 4px;
}

.loc-picked-section {
  background: var(--group-lt);
  border: 1.5px solid var(--group-bd);
  border-radius: var(--radius-sm);
  padding: 12px 14px 4px;
  margin: 10px 0 4px;
}
.loc-picked-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.loc-picked-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--group);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.btn-text-sm {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--red);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* 출발지/목적지 입력 행 */
.loc-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.loc-input-row input {
  flex: 1;
}
