:root {
  --primary: #ff6b4a;
  --primary-dark: #e5502f;
  --bg: #fbf7f2;
  --card: #ffffff;
  --border: #ece3da;
  --text: #2c2521;
  --muted: #8a7f74;
  --available: #ffb199;
  --soft-bg: #f6f1ea;
  --soft-bg-2: #f1ece5;
  --tab-bg: #eee9e2;
  --accent-soft: #fff0ea;
  --accent-soft-2: #ffe3d8;
  --teal: #0f766e;
  --teal-soft: #e6f4f1;
  --success-bg: #e9f9ee;
  --success-text: #1e7e34;
  --error-bg: #fdecea;
  --error-text: #c0392b;
  --warn-text: #a55b21;
  --disabled-bg: #d8cfc6;
  --shadow: rgba(0, 0, 0, 0.03);
  --overlay-bg: rgba(30, 22, 15, 0.6);
  --on-primary: #ffffff;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --primary: #ff7a5c;
  --primary-dark: #ff9c7d;
  --bg: #17140f;
  --card: #221d17;
  --border: #3a3127;
  --text: #f3ece3;
  --muted: #b0a294;
  --available: #8a3f28;
  --soft-bg: #2a231b;
  --soft-bg-2: #30281f;
  --tab-bg: #2a231b;
  --accent-soft: #3a2418;
  --accent-soft-2: #4a2a1c;
  --teal: #5fd1c1;
  --teal-soft: #133a35;
  --success-bg: #1c3324;
  --success-text: #7ee2a8;
  --error-bg: #3a1f1c;
  --error-text: #ff8a80;
  --warn-text: #f0b46a;
  --disabled-bg: #4a4136;
  --shadow: rgba(0, 0, 0, 0.4);
  --overlay-bg: rgba(0, 0, 0, 0.72);
  --on-primary: #1d130e;
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #ff7a5c;
  --primary-dark: #ff9c7d;
  --bg: #17140f;
  --card: #221d17;
  --border: #3a3127;
  --text: #f3ece3;
  --muted: #b0a294;
  --available: #8a3f28;
  --soft-bg: #2a231b;
  --soft-bg-2: #30281f;
  --tab-bg: #2a231b;
  --accent-soft: #3a2418;
  --accent-soft-2: #4a2a1c;
  --teal: #5fd1c1;
  --teal-soft: #133a35;
  --success-bg: #1c3324;
  --success-text: #7ee2a8;
  --error-bg: #3a1f1c;
  --error-text: #ff8a80;
  --warn-text: #f0b46a;
  --disabled-bg: #4a4136;
  --shadow: rgba(0, 0, 0, 0.4);
  --overlay-bg: rgba(0, 0, 0, 0.72);
  --on-primary: #1d130e;
  color-scheme: dark;
}


* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-dark);
  text-decoration: none;
}
.logo:hover { opacity: .85; }

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px var(--shadow);
}

/* Room roles and the shared travel ledger */
/* 멤버 관리: 인당 한 줄 (이름 왼쪽, 역할·위임·추방 오른쪽) */
.member-list li { align-items: center; gap: 8px; }
.member-list .member-name { flex: 1; min-width: 3.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 역할 드롭다운이 있는 줄은 같은 내용의 역할 배지를 숨김 */
.member-list li:has(.member-actions) .member-name .badge { display: none; }
.member-actions { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; margin-left: auto; }
.member-actions select { width: auto; min-width: 0; flex: 0 1 auto; margin: 0; padding: 4px 6px; }
.member-actions button.small { margin: 0; min-height: 32px; padding: 4px 7px; font-size: 12px; white-space: nowrap; }
.danger { color: var(--error-text); }
.help-guide { display: block; margin: 24px auto; }
[hidden] { display: none !important; }
#expenseTripSelect, #packingTripSelect { display: block; width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); font: inherit; margin: 8px 0 16px; }
#quickGuide { width: min(540px, calc(100vw - 32px)); max-height: 85vh; overflow: auto; border: 1px solid var(--border); border-radius: 22px; padding: 28px; color: var(--text); box-shadow: 0 24px 80px #30202033; }
#quickGuide::backdrop { background: #241e1a88; }
.guide-steps { padding-left: 22px; }
.guide-steps li { margin: 20px 0; }
.guide-steps p { color: var(--muted); line-height: 1.6; margin: 6px 0; }
#quickGuide input[type="checkbox"], .packing-list input[type="checkbox"] { width: auto; margin: 0 8px 0 0; }
#quickGuide .block { margin-top: 20px; }
.expense-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 20px 0 28px; }
.expense-summary article { border: 1px solid var(--border); border-radius: 18px; padding: 22px; background: var(--card); }
.expense-summary article > strong { display: block; font-size: 30px; margin: 14px 0; color: var(--text); }
.expense-summary article > p { color: var(--muted); line-height: 1.6; }
.expense-date { margin: 12px 0; border-bottom: 1px solid var(--border); padding: 12px 0; }
.expense-date > summary { cursor: pointer; font-weight: 600; }
.empty-state { text-align: center; padding: 40px 12px; color: var(--muted); line-height: 1.8; }
.packing-progress { display: flex; justify-content: space-between; margin-top: 20px; gap: 12px; }
#packingContent progress { width: 100%; height: 10px; accent-color: #bb5b43; margin: 16px 0; }
.packing-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.packing-filters [aria-pressed="true"] { color: var(--error-text); background: var(--accent-soft); border-color: var(--primary); }
.packing-list { list-style: none; padding: 8px 16px; border: 1px solid var(--border); border-radius: 14px; }
.packing-list li { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.packing-list label { flex: 1; display: flex; align-items: center; overflow-wrap: anywhere; }
.packing-list select { width: 100px; margin: 0; padding: 6px; }
.packing-list .packed { text-decoration: line-through; color: var(--muted); }
@media (max-width: 480px) { .expense-summary { gap: 8px; } .expense-summary article { padding: 14px; } .expense-summary article > strong { font-size: 24px; } .packing-list { padding: 6px 10px; } .packing-list select { width: 76px; } }
.room-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 20px; padding: 6px; background: var(--tab-bg); border-radius: 14px; }
.room-tabs button { margin: 0; padding: 13px 4px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); box-shadow: none; font-weight: 600; }
.room-tabs button[aria-selected="true"] { background: var(--card); color: var(--primary-dark); box-shadow: 0 2px 6px #33221112; }
.room-tabs button:focus-visible { outline: 3px solid #c96b49; outline-offset: 2px; }
[role="tabpanel"][hidden] { display: none !important; }
#roomActionStatus:empty { display: none; }
#tripManagement { margin-top: 18px; }
/* 여행 안쪽 메뉴: 진행 중인 여행 이름 + 장소·준비·코스·정산·준비물 */
.trip-subnav { margin: -12px 0 20px; padding: 12px 14px 10px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 14px 14px; background: var(--card); }
.trip-subnav-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 10px; }
.trip-subnav-title .desc { margin: 0; font-size: 13px; }
.room-subtabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; border-bottom: 1px solid var(--border); }
.room-subtabs button { margin: 0; padding: 10px 2px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-weight: 600; box-shadow: none; white-space: nowrap; }
.room-subtabs button:hover { background: transparent; color: var(--text); }
.room-subtabs button[aria-selected="true"] { border-bottom-color: var(--primary); color: var(--primary-dark); }
.room-subtabs button:focus-visible { outline: 3px solid #c96b49; outline-offset: -3px; }
@media (max-width: 480px) { .room-tabs { gap: 2px; padding: 4px; } .room-tabs button { padding: 10px 2px; font-size: 12px; } .trip-subnav { padding: 10px 10px 8px; } .room-subtabs { gap: 2px; } .room-subtabs button { padding: 9px 0; font-size: 13px; } }
/* 준비 탭 맨 위: 정해진 여행지 + 코스 보기 */
.decided-destination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.decided-destination p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kakao-login-link { display: block; padding: 13px 18px; margin: 12px 0; border-radius: 10px; background: #fee500; color: #191919; text-align: center; text-decoration: none; font-weight: 600; }
.kakao-login-link[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.journey-history { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin: 12px 0; }
.journey-history > summary { cursor: pointer; font-weight: 600; }
.voided-record { opacity: .55; }
.finance-section fieldset { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; }
.finance-inline select { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); font: inherit; }
#kakaoSocialPanel code { overflow-wrap: anywhere; }
.refund { color: var(--success-text); }
.finance-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.finance-heading h2 { margin: 0; font-size: 18px; }
.finance-heading button { flex-shrink: 0; }
.finance-status { color: var(--primary-dark); font-size: 14px; }
.finance-status:empty { display: none; }
.finance-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.finance-stats > div { background: var(--bg); border-radius: 12px; padding: 14px 12px; overflow-wrap: anywhere; }
.finance-stats span, .finance-stats small { display: block; color: var(--muted); font-size: 12px; }
.finance-stats strong { display: block; font-size: 19px; margin: 7px 0; }
.finance-section { padding: 4px 14px 16px; }
.finance-inline { display: flex; align-items: flex-end; gap: 10px; }
.finance-inline label { flex: 1; }
.finance-inline button { margin-bottom: 12px; }
.finance-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.finance-form h3, .finance-form > button, .finance-wide { grid-column: 1 / -1; }
.finance-form h3 { font-size: 15px; margin: 0; }
.finance-form input, .finance-form select { margin-bottom: 0; width: 100%; }
.finance-form input:not([type="checkbox"]), .finance-form select, .finance-inline input, .member-actions select {
  display: block; width: 100%; padding: 11px 12px; margin-top: 6px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--card);
  color: var(--text); font: inherit; font-size: 14px; min-height: 42px;
}
.member-actions select { width: auto; margin-top: 0; min-height: 32px; padding: 4px 4px 4px 8px; font-size: 12px; }
.finance-inline button { margin-bottom: 0; }
.finance-form label, .finance-inline label { font-size: 13px; display: block; }
.finance-form fieldset { min-width: 0; border: 1px solid var(--border); border-radius: 10px; }
.finance-form legend { font-size: 13px; }
.expense-participants { display: flex; flex-wrap: wrap; gap: 12px; padding: 6px; }
.expense-participants label { display: flex; align-items: center; gap: 6px; }
.expense-participants input { width: auto; margin: 0; }
.finance-people, .finance-records, .nudge-feed { list-style: none; padding: 0; margin: 12px 0; }
.finance-people li, .finance-records li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.finance-people small, .finance-records small, .nudge-feed small, .finance-table small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; font-weight: 400; }
.finance-person-state { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.badge.unpaid { color: var(--error-text); background: var(--accent-soft); }
.badge.paid { color: var(--success-text); background: var(--success-bg); }
.nudge-feed li { font-size: 14px; background: var(--accent-soft); border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.finance-table-wrap { overflow-x: auto; }
.finance-table { width: 100%; min-width: 530px; border-collapse: collapse; font-size: 13px; }
.finance-table td, .finance-table th { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--border); }
.finance-table thead { color: var(--muted); }
.finance-table button { display: block; margin-top: 8px; }
#roomFinance .nested-collapsible { margin-top: 12px; }
@media (max-width: 480px) {
  .finance-stats { grid-template-columns: 1fr; }
  .finance-stats > div { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; }
  .finance-stats strong { margin: 0; }
  .finance-stats small { width: 100%; }
  .finance-form { grid-template-columns: 1fr; }
  .finance-section { padding-left: 8px; padding-right: 8px; }
  .finance-inline { align-items: stretch; flex-direction: column; }
  .finance-people li { align-items: flex-start; flex-direction: column; }
}

.collapsible-card {
  padding: 0;
  overflow: hidden;
}
.collapsible-card > summary,
.nested-collapsible > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.collapsible-card > summary {
  padding: 20px 24px;
}
.collapsible-card > summary::-webkit-details-marker,
.nested-collapsible > summary::-webkit-details-marker { display: none; }
.collapsible-card > summary h2,
.nested-collapsible > summary h3 { margin: 0; }
.collapsible-card > summary::after,
.nested-collapsible > summary::after {
  content: '접기';
  flex-shrink: 0;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
}
.collapsible-card:not([open]) > summary::after,
.nested-collapsible:not([open]) > summary::after { content: '펼치기'; }
.collapsible-card[open] > summary {
  border-bottom: 1px solid var(--border);
}
.collapsible-card-content { padding: 20px 24px 24px; }

h1 { font-size: 24px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 12px; }
p.desc { color: var(--muted); margin: 0 0 20px; line-height: 1.5; }

input[type=text], input[type=password] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 12px;
  background: var(--card);
  color: var(--text);
}

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  background: var(--primary);
  color: var(--on-primary);
  transition: background .15s ease;
}
button:hover { background: var(--primary-dark); }
button.secondary {
  background: var(--card);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
}
button.secondary:hover { background: var(--accent-soft); }
button:disabled { background: var(--disabled-bg); cursor: not-allowed; }
button.block { width: 100%; }
button.small { padding: 6px 12px; font-size: 13px; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tabs button { flex: 1; }

.error-msg {
  color: var(--error-text);
  background: var(--error-bg);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 12px;
}
.success-msg {
  color: var(--success-text);
  background: var(--success-bg);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 12px;
}

.room-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.room-list-item:last-child { border-bottom: none; }
.room-list-item:hover { color: var(--primary-dark); }
.badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--soft-bg-2);
  color: var(--muted);
  margin-left: 8px;
}
.badge.host { background: var(--accent-soft); color: var(--primary-dark); }

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.invite-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--soft-bg);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  margin-top: 8px;
}
.invite-code {
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary-dark);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
}
.day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  background: var(--card);
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.day-cell.selected {
  background: var(--available);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}
.day-cell .count {
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.day-cell .count:hover { background: rgba(0, 0, 0, 0.06); }
.day-cell.selected .count { color: #fff; }
.day-cell .best-label {
  margin-bottom: 1px;
  padding: 2px 5px;
  border-radius: 6px;
  background: #c2410c;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.day-cell.empty { visibility: hidden; cursor: default; }
/* 확정 일정: 내가 고른 날(주황 채움)과 겹쳐도 보이도록 청록 테두리로 표시 */
.day-cell.trip-range { box-shadow: inset 0 0 0 2px var(--teal); }
.day-cell.trip-range:not(.selected) { background: var(--teal-soft); color: var(--teal); }
.day-cell.final { box-shadow: inset 0 0 0 3px var(--teal); font-weight: 700; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -4px 0 10px; color: var(--muted); font-size: 12px; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.calendar-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.calendar-legend .legend-mine { background: var(--available); border: 1px solid var(--primary); }
.calendar-legend .legend-final { background: var(--teal-soft); box-shadow: inset 0 0 0 2px var(--teal); }
.calendar-legend .legend-best { padding: 2px 5px; border-radius: 6px; background: #c2410c; color: #fff; font-size: 10px; font-weight: 800; }
.date-voters { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 13px; line-height: 1.6; }
.date-voters strong { margin-right: 6px; }

.month-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 700;
}

.member-list { list-style: none; padding: 0; margin: 0; }
.member-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.member-list li:last-child { border-bottom: none; }
.dresscode-tag {
  color: var(--primary-dark);
  font-weight: 600;
}

.region-result {
  text-align: center;
  padding: 20px 0;
}
.region-result .region-name {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 6px;
}
.region-result .dresscode-final {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--primary-dark);
  font-weight: 700;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag {
  background: var(--soft-bg);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.preference-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.preference-option {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.preference-option input { display: none; }
.preference-option.selected {
  border-color: var(--primary);
  background: var(--accent-soft);
  color: var(--primary-dark);
}
.custom-preference-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2px 0 14px;
}
.custom-preference-field > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.custom-preference-field input[type=text] { margin-bottom: 0; }
.custom-preference-field small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.custom-preference-field .interpreted-preference {
  color: var(--primary-dark);
  font-weight: 700;
}

.trip-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.trip-settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.trip-settings-grid label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.trip-settings-grid input,
.trip-settings-grid select {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
}
.trip-settings-wide { grid-column: 1 / -1; }
.trip-settings-saved { margin: 12px 0 0; }
.trip-settings-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--soft-bg);
  font-size: 13px;
}
.trip-settings-summary span { color: var(--muted); }

.recommendation-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.recommendation-heading .desc { margin-bottom: 14px; }
.source-badge {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--soft-bg-2);
  color: var(--muted);
  font-size: 11px;
}
.recommendation-notice {
  margin-bottom: 14px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--warn-text);
  font-size: 13px;
  line-height: 1.45;
}
.trip-period-result {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.route-context {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 13px;
}
.route-context span,
.route-context small { color: var(--muted); line-height: 1.4; }
.route-context small { color: var(--warn-text); }
.course-map-actions {
  margin: 0 0 18px;
}
.course-map-panel { margin-top: 12px; }
.course-map-panel[hidden] { display: none; }
.course-map-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.course-map-filter[hidden] { display: none; }
.course-map-filter button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.course-map-filter button:hover { background: var(--soft-bg); }
.course-map-filter button.active {
  border-color: var(--primary);
  background: var(--accent-soft);
  color: var(--primary-dark);
}
.course-day-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.course-map {
  width: 100%;
  height: 420px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--soft-bg);
}
.course-map .error-msg { margin: 12px; }
.course-map-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
/* 지도 위 번호 마커: 테두리 색이 날짜 색(인라인) */
button.course-map-marker,
button.course-map-home {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 6px;
  border: 3px solid var(--text);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 2px 6px var(--shadow);
  font-weight: 800;
  line-height: 1;
}
button.course-map-marker { min-width: 34px; height: 28px; font-size: 12px; }
/* 숙소는 동그라미 없이 집 이모지만 */
button.course-map-home { width: auto; height: auto; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 30px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
button.course-map-marker:hover { background: var(--soft-bg); }
button.course-map-home:hover { background: transparent; transform: scale(1.1); }
.course-map-bubble {
  position: relative;
  bottom: 24px;
  display: grid;
  gap: 3px;
  width: max-content;
  max-width: min(240px, 70vw);
  padding: 10px 30px 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 4px 14px var(--shadow);
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
}
.course-map-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--card);
  transform: translateX(-50%) rotate(45deg);
}
.course-map-bubble strong { font-size: 14px; }
.course-map-bubble span,
.course-map-bubble small { color: var(--muted); }
.course-map-bubble a { color: var(--primary-dark); font-weight: 700; text-decoration: none; }
.course-map-bubble button {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
  padding: 2px 7px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}
.course-map-bubble button:hover { background: var(--soft-bg); }
.course-legs {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}
.course-legs > summary {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.course-legs > summary span { color: var(--muted); font-weight: 500; }
.course-legs-day { padding: 0 12px 10px; }
.course-legs-day[hidden] { display: none; }
.course-legs-day > strong { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.course-legs ol { display: grid; gap: 4px; margin: 6px 0 0; padding-left: 20px; }
.course-legs a {
  color: var(--primary-dark);
  font-size: 12px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .course-map { height: 300px; }
}
.itinerary-section {
  margin: 4px 0 24px;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--accent-soft);
}
.itinerary-section > summary {
  padding: 16px 18px;
}
.itinerary-section > summary h3 { font-size: 17px; }
.itinerary-section[open] > summary { border-bottom: 1px solid var(--border); }
.itinerary-days { padding: 16px 18px 18px; }
.itinerary-day + .itinerary-day {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.itinerary-day > h4 { margin: 0 0 12px; font-size: 15px; color: var(--primary-dark); }
.itinerary-empty { margin: 0; color: var(--muted); font-size: 13px; }
.itinerary-list { display: grid; }
.itinerary-stop {
  display: grid;
  grid-template-columns: 48px 12px 1fr;
  gap: 9px;
  min-height: 88px;
}
.itinerary-time {
  padding-top: 1px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}
.itinerary-dot {
  position: relative;
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: var(--card);
}
.itinerary-dot::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 2px;
  width: 2px;
  height: 72px;
  background: var(--border);
}
.itinerary-stop:last-child .itinerary-dot::after { display: none; }
.itinerary-content { display: flex; flex-direction: column; gap: 3px; padding-bottom: 16px; }
.itinerary-content > span { color: var(--muted); font-size: 11px; }
.itinerary-content > strong { font-size: 15px; }
.itinerary-content > small { color: var(--muted); line-height: 1.4; }
.itinerary-links { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.itinerary-links a,
.itinerary-return a { color: var(--primary-dark); font-size: 12px; font-weight: 700; text-decoration: none; }
.itinerary-return {
  margin: 0 0 4px 69px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--soft-bg);
  color: var(--muted);
  font-size: 12px;
}
.place-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.place-list-title { margin: 0; font-size: 16px; }
.place-list-title span { color: var(--muted); font-size: 12px; font-weight: 500; }
.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.recommendation-grid[hidden] { display: none; }
.place-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.place-card img,
.place-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--soft-bg);
}
.place-image-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 32px;
}
.place-card-body { padding: 13px; }
.place-card h3 {
  margin: 5px 0 6px;
  font-size: 16px;
  line-height: 1.35;
}
.place-category {
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
}
.place-meta { display: flex; justify-content: space-between; gap: 8px; }
.place-meta > span:last-child { color: var(--muted); font-size: 10px; }
.place-reason,
.place-address {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.place-card a {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.source-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 24px;
}

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.trip-confirm-controls {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 8px;
}
.trip-confirm-controls select {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary-dark);
  text-decoration: underline;
  padding: 0;
  font-weight: 600;
}
.link-btn:hover { background: none; }

/* Finance: summary first, focused actions, secondary ledgers collapsed. */
#roomFinance { padding: 28px; }
.finance-actions { display:flex; flex-wrap:wrap; gap:12px; margin:24px 0; }
.finance-actions button { flex:1 1 160px; padding:14px; }
.finance-admin { margin:16px 0; padding:16px; background:var(--soft-bg); border-radius:14px; }
#roomFinance > .nested-collapsible { margin:20px 0; border:1px solid var(--border); border-radius:16px; overflow:hidden; background:var(--card); }
#roomFinance > .nested-collapsible > summary { padding:22px; font-size:17px; }
#roomFinance .finance-section { padding:8px 24px 24px; }
#roomFinance .finance-form { gap:18px; margin:20px 0 28px; padding:20px; border-radius:14px; background:var(--soft-bg); }
#roomFinance .finance-stats { gap:16px; margin:24px 0; }
#roomFinance .finance-stats > div { padding:22px; }
.finance-table th,.finance-table td { padding:16px 12px; }
.accommodation-result { display:grid; gap:8px; padding:16px; border:1px solid var(--border); border-radius:12px; margin-top:12px; }
#profileForm { display:grid; gap:16px; max-width:520px; }
#accommodationStatus { display:block; margin:12px 0; font-size:14px; }
@media(max-width:560px) { #roomFinance {padding:12px;} #roomFinance .finance-section {padding:8px 12px 18px;} #roomFinance .finance-form {padding:14px;} .finance-actions {gap:8px;} }

#profileForm { max-width: 560px; display: grid; gap: 16px; }
#profileForm label, #addNicknameFriend label { display: grid; gap: 8px; font-weight: 600; min-width: 0; }
#profileForm input, #addNicknameFriend input { width: 100%; box-sizing: border-box; min-height: 48px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--soft-bg); font: inherit; }
#profileForm input:focus, #addNicknameFriend input:focus { outline: 3px solid #ffdfcf; border-color: var(--primary); background: var(--card); }
#profileForm button { justify-self: start; min-width: 130px; }
#profileForm .desc { margin: 0; line-height: 1.7; }
.danger { color: var(--error-text); margin-left: 12px; }
.action-dialog { border: 0; border-radius: 20px; padding: 28px; width: min(440px, calc(100vw - 48px)); box-sizing: border-box; box-shadow: 0 20px 80px #0003; }
.action-dialog::backdrop { background: #17212b66; }
.action-dialog p { line-height: 1.7; }
.action-dialog label { display: grid; gap: 8px; }
.action-dialog input { font: inherit; width: 100%; box-sizing: border-box; padding: 12px; }
.dialog-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
.history-edit { padding: 16px 0; }
.history-edit textarea { width: 100%; min-height: 90px; box-sizing: border-box; font: inherit; padding: 12px; }
[hidden] { display: none !important; }
@media (max-width: 560px) {
  .topbar { padding: 14px 16px; }
  .user-box span { display: none; }
  .card { padding: 18px; }
  .collapsible-card { padding: 0; }
  .collapsible-card > summary { padding: 17px 18px; }
  .collapsible-card-content { padding: 17px 18px 20px; }
  .preference-grid { grid-template-columns: repeat(2, 1fr); }
  .trip-settings-grid { grid-template-columns: 1fr 1fr; }
  .trip-settings-wide { grid-column: 1 / -1; }
  .trip-settings-summary { flex-direction: column; }
  .recommendation-grid { grid-template-columns: 1fr; }
  .recommendation-heading { display: block; }
  .source-badge { display: inline-block; margin-bottom: 12px; }
  .member-list li { gap: 6px; }
  .trip-confirm-controls { grid-template-columns: 1fr 1fr; }
  .trip-confirm-controls button { grid-column: 1 / -1; }
  .itinerary-return { margin-left: 0; }
}

/* 출발지 · 가기 쉬운 여행지 */
.origin-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; margin-bottom: 14px; }
.origin-form label { display: flex; flex-direction: column; gap: 6px; }
.origin-form label > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.origin-form select { min-width: 0; padding: 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font-size: 14px; }
.origin-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
#originStatus { grid-column: 1 / -1; color: var(--primary-dark); font-size: 13px; }
#originStatus:empty { display: none; }
.easy-region-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.easy-region { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.easy-region.chosen { border-color: var(--primary); background: var(--accent-soft); }
.easy-region > button { margin-top: 8px; }
.easy-region-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.easy-region-rank { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 700; }
.easy-region-summary { margin-left: auto; color: var(--muted); font-size: 13px; }
.easy-region-legs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.easy-region-legs li { display: grid; grid-template-columns: 72px minmax(0, 1fr) 72px; align-items: center; gap: 8px; font-size: 13px; }
.easy-region-legs small { grid-column: 2 / -1; color: var(--muted); font-size: 11px; margin-top: -4px; }
.easy-leg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.easy-leg-bar { height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.easy-leg-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--available); }
.easy-leg-time { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
@media (max-width: 480px) {
  .origin-form { grid-template-columns: 1fr; }
  .easy-region-summary { margin-left: 0; width: 100%; }
  .easy-region-legs li { grid-template-columns: 52px minmax(0, 1fr) auto; }
}

/* 멤버별 출발지 · 드레스코드 컨셉 목록 */
.origin-list-title { margin: 4px 0 8px; font-size: 14px; }
.origin-list, .dresscode-concepts { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.origin-list li, .dresscode-concepts li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--bg); font-size: 13px; }
.origin-list li.missing span, .dresscode-concepts .muted, .member-list .muted { color: var(--muted); }
.origin-list li.undecided span { color: var(--teal); }
.dresscode-concepts { margin-top: 12px; }
.dresscode-toggle { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 600; cursor: pointer; }
.dresscode-toggle input { width: 18px; height: 18px; accent-color: var(--primary); }
.collapsible-card .dresscode-final { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--primary-dark); font-weight: 700; }
@media (max-width: 480px) {
  .calendar-grid { gap: 4px; }
  .day-cell { aspect-ratio: auto; min-height: 50px; padding: 3px 0; font-size: 12px; }
  .day-cell .best-label { padding: 1px 3px; font-size: 8px; }
  .day-cell .count { margin-top: 0; padding: 0 3px; font-size: 9px; }
}

/* 계정 찾기 · 가입 완료 · 비밀번호 */
.account-form form { display: grid; gap: 10px; }
.account-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.account-form .kakao-login-link { margin: 12px 0; }
.account-form .found-nickname { padding: 12px 14px; border-radius: 10px; background: var(--bg); }
.account-form .error-msg:empty, #passwordChangeStatus:empty { display: none; }
/* 닉네임 실시간 중복 확인 안내 */
.field-status { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.field-status:empty { display: none; }
.field-status.ok { color: var(--success-text); }
.field-status.bad { color: var(--error-text); }
#loginForm .field-status { margin: -6px 0 12px; }
#findAccountBtn { display: block; margin: 12px auto 0; }
.notice-card { color: var(--teal); font-weight: 600; }

/* 숙소 후보 투표 (사진 + 특징 + 투표 인원) */
.poll-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.poll-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); overflow: visible; }
.poll-item .poll-fill { position: absolute; inset: 0 auto 0 0; width: var(--share); border-radius: 12px 0 0 12px; background: var(--soft-bg-2); pointer-events: none; }
.poll-item.mine { border: 2px solid var(--primary); }
.poll-item.mine .poll-fill { background: var(--accent-soft-2); }
.poll-item.chosen { box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 25%, transparent); }
.poll-vote { position: relative; display: flex; gap: 12px; align-items: center; margin: 0; padding: 10px; border-radius: 12px 0 0 0; background: transparent; color: var(--text); text-align: left; font-weight: 400; }
.poll-vote:hover { background: transparent; }
.poll-vote:disabled { cursor: default; opacity: 1; }
.poll-thumb { flex: none; width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: var(--bg); }
.poll-thumb.placeholder { display: grid; place-items: center; font-size: 30px; }
.poll-text { display: grid; gap: 4px; min-width: 0; }
.poll-text strong { font-size: 15px; overflow-wrap: anywhere; }
.poll-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.poll-chips span { padding: 2px 7px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); font-size: 12px; }
.poll-memo { color: var(--muted); font-size: 12px; }
.poll-text .badge { justify-self: start; margin-left: 0; }
.poll-side { position: relative; display: flex; align-items: center; padding: 10px 12px 10px 4px; }
.poll-count { margin: 0; padding: 6px 10px; background: var(--card); border: 1px solid var(--border); color: var(--text); font-size: 15px; font-weight: 800; white-space: nowrap; }
.poll-count:hover { background: var(--accent-soft); }
.poll-voters { position: absolute; top: calc(100% - 6px); right: 8px; z-index: 5; min-width: 120px; max-height: 200px; overflow: auto; margin: 0; padding: 6px 0; list-style: none; border: 1px solid var(--border); border-radius: 10px; background: var(--card); box-shadow: 0 8px 20px #33221122; }
.poll-voters li { padding: 6px 14px; font-size: 13px; white-space: nowrap; }
.poll-voters .muted { color: var(--muted); }
.poll-footer { position: relative; grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 0 12px 10px; font-size: 12px; color: var(--muted); }
.poll-footer a { color: var(--primary-dark); font-weight: 600; }
.poll-footer button { margin: 0; }
.lodging-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.lodging-form label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.lodging-form .lodging-wide, .lodging-url, .lodging-preview { grid-column: 1 / -1; }
.lodging-url { display: flex; gap: 6px; }
.lodging-url input { flex: 1; min-width: 0; }
.lodging-url button { margin: 0; }
.lodging-preview { display: flex; gap: 10px; align-items: center; }
.lodging-preview p { margin: 0; }
@media (max-width: 480px) {
  .poll-thumb { width: 64px; height: 64px; }
  .lodging-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.trip-settings-saved a { color: var(--primary-dark); font-weight: 700; }
.attendance-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.attendance-row button { margin: 0; }

/* 지난 여행 */
.past-trip { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: var(--card); }
.past-trip > summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.past-trip > summary span { color: var(--muted); font-size: 13px; }
.past-trip-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 12px 0; font-size: 14px; }
.past-trip-facts dt { color: var(--muted); }
.past-trip-facts dd { margin: 0; }
.past-trip h4 { margin: 8px 0 6px; }
.past-trip-course { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }

/* 출발지 지도 · 중간지점 */
.origin-form .origin-search, .origin-form .origin-results, .origin-form .origin-map, .origin-form .origin-picked, .origin-form .origin-wide, .origin-form .origin-current { grid-column: 1 / -1; }
.origin-current { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--teal-soft); color: var(--teal); font-size: 13px; font-weight: 700; }
.origin-search { display: flex; gap: 6px; }
.origin-search input { flex: 1; min-width: 0; }
.origin-search button { margin: 0; }
.origin-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.origin-results:empty { display: none; }
.origin-results button { width: 100%; margin: 0; display: grid; gap: 2px; text-align: left; }
.origin-results small { color: var(--muted); font-weight: 400; }
.origin-map { width: 100%; height: 280px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); }
.origin-map.small { height: 220px; margin-bottom: 10px; }
.origin-picked { margin: 0; font-size: 13px; color: var(--primary-dark); }
.origin-wide small { color: var(--muted); font-weight: 400; }
.map-chip { padding: 3px 8px; border-radius: 999px; background: var(--card); border: 1px solid var(--primary); font-size: 12px; font-weight: 700; white-space: nowrap; }
.map-chip.midpoint { background: var(--primary); color: var(--on-primary); }
.midpoint-label { margin: 4px 0 10px; }

/* ---------- 다크모드 전환 · 토스트 · 추첨 연출 · 스켈레톤 ---------- */
body { transition: background .2s ease, color .2s ease; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.theme-toggle { margin: 0; padding: 6px 10px; border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 16px; line-height: 1; }
.theme-toggle:hover { background: var(--soft-bg); }
input, select, textarea { color: var(--text); }
.toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 0 16px; pointer-events: none; }
.toast { max-width: 420px; padding: 12px 18px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 14px; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,.25); opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--success-text); color: var(--card); }
.toast-error { background: var(--error-text); color: var(--card); }
.action-dialog { background: var(--card); color: var(--text); }
.action-dialog input { width: 100%; margin: 4px 0 12px; }
.draw-dialog { border: 0; background: transparent; color: #fff; text-align: center; overflow: visible; }
.draw-dialog::backdrop { background: var(--overlay-bg); }
.draw-box { min-width: 260px; padding: 20px; }
.draw-label { margin-bottom: 16px; font-size: 14px; letter-spacing: 1px; opacity: .85; }
.draw-region { min-height: 44px; font-size: 34px; font-weight: 800; }
.draw-region.landed { color: #ffd9a0; animation: draw-pop .5s ease; }
.draw-sub { min-height: 22px; margin-top: 14px; font-size: 16px; opacity: .9; }
.draw-result { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@keyframes draw-pop { 0% { transform: scale(.8); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }
.skeleton-card .skeleton-line { height: 16px; margin-bottom: 12px; border-radius: 8px; background: linear-gradient(90deg, var(--soft-bg) 25%, var(--border) 37%, var(--soft-bg) 63%); background-size: 400% 100%; animation: skeleton-shimmer 1.4s ease infinite; }
.skeleton-card .skeleton-line:last-child { width: 60%; margin-bottom: 0; }
@keyframes skeleton-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skeleton-card .skeleton-line, .draw-region.landed { animation: none; } }
.sync-banner { position: sticky; top: 70px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--primary); border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 14px; }
.sync-banner button { margin: 0; }

/* 여행지 정하기 */
.dest-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 14px; margin-bottom: 6px; }
.dest-method { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.dest-method select { min-width: 220px; }
.dest-method-label { margin: 0; }
.dest-draws { color: var(--primary-dark); font-weight: 700; font-size: 14px; }
.dest-draws small { color: var(--muted); font-weight: 400; }
.dest-selected { margin: 8px 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.dest-list { list-style: none; margin: 10px 0 14px; padding: 0; display: grid; gap: 8px; }
.dest-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.dest-item.chosen { border: 2px solid var(--primary); background: var(--accent-soft); }
.dest-main { display: flex; align-items: center; gap: 10px; }
.dest-text { flex: 1; display: grid; gap: 3px; min-width: 0; }
.dest-text small { color: var(--muted); font-size: 12px; }
.dest-text .badge { justify-self: start; margin-left: 0; }
.dest-vote { position: relative; display: flex; align-items: center; gap: 6px; }
.dest-vote button { margin: 0; }
.dest-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-left: 34px; }
.dest-actions button { margin: 0; }
.dest-search { margin: 8px 0; }
@media (max-width: 480px) {
  .dest-main { flex-wrap: wrap; }
  .dest-vote { width: 100%; justify-content: flex-end; }
  .dest-actions { padding-left: 0; }
  .dest-method select { min-width: 0; width: 100%; }
}

/* 문의하기 */
.footer-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 24px auto; padding: 0 16px; }
.footer-actions .help-guide { margin: 0; }
.inquiry-form { display: grid; gap: 12px; }
.inquiry-categories { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.inquiry-categories legend, .inquiry-label { margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 700; }
.inquiry-chip { position: relative; display: inline-flex; align-items: center; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--text); font-size: 14px; cursor: pointer; }
.inquiry-chip input { position: absolute; opacity: 0; pointer-events: none; }
.inquiry-chip:has(input:checked) { border-color: var(--primary); background: var(--accent-soft); color: var(--primary-dark); font-weight: 700; }
.inquiry-chip:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.inquiry-form textarea, .inquiry-reply-form textarea { display: block; width: 100%; min-height: 140px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; line-height: 1.6; resize: vertical; }
.inquiry-reply-form textarea { min-height: 90px; font-weight: 400; }
.inquiry-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inquiry-count { color: var(--muted); font-size: 13px; }
.inquiry-count.short { color: var(--warn-text); }
.inquiry-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.inquiry-item { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.inquiry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: 13px; }
.inquiry-meta .badge { margin-left: 0; }
.inquiry-meta strong { color: var(--text); }
.inquiry-message { margin: 10px 0 0; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.inquiry-reply { margin-top: 12px; padding: 12px; border-left: 3px solid var(--teal); border-radius: 10px; background: var(--soft-bg); }
.inquiry-reply .inquiry-meta strong { color: var(--teal); }
.badge.inquiry-status.open { background: var(--accent-soft); color: var(--warn-text); }
.badge.inquiry-status.answered { background: var(--success-bg); color: var(--success-text); }
.inquiry-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.inquiry-filter button { margin: 0; }
.inquiry-reply-form { display: grid; gap: 8px; margin-top: 12px; }
.inquiry-reply-label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.inquiry-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.inquiry-actions button { margin: 0; }

/* 계정 · 친구 알림 배지 (빨간 동그라미 + 수) */
.account-btn { position: relative; }
.notify-badge { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e5383b; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--card); }
.user-box .notify-badge { display: block; }
.notify-badge[hidden], .user-box .notify-badge[hidden] { display: none; }
.notify-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #e5383b; color: #fff; font-size: 11px; line-height: 18px; text-align: center; vertical-align: middle; }
