/* =========================================================
   style.css — "입장권 × 다꾸 모눈종이" 디자인
   행사 하나 = 입장 티켓 한 장. 모눈종이 다이어리에 마스킹테이프로 붙인 느낌.
   왼쪽은 본권(행사 정보), 점선 너머 오른쪽은 떼는 부분(D-day).

   색을 바꾸고 싶으면 아래 :root 안의 값만 고치면 앱 전체가 바뀌어요.
   ========================================================= */

/* ----- 1. 색상·크기 변수 (라이트 모드) ----- */
:root {
  --bg: #DFF5EE;        /* 바탕: 민트 모눈종이 */
  --grid: rgba(27, 35, 64, 0.07); /* 모눈 선 */
  --paper: #FFFFFF;     /* 티켓 종이 */
  --ink: #1B2340;       /* 글자·테두리 (남색 잉크) */
  --muted: #5D6785;     /* 흐린 글자 */
  --line: #C9D1DE;      /* 점선·구분선 */
  --lift: rgba(20, 80, 70, 0.16); /* 티켓 아래 그림자(두께감) */
  --hero-sub: #3D6B63;  /* 큰 제목 아래 글자 */
  --accent: #FF5FA2;    /* 선택된 버튼·탭 (형광펜 핑크) */
  --marker: #FFE27A;    /* 형광펜 노랑 */
  --tabbar: #FFFFFF;
  /* 마스킹테이프 3종 */
  --tape-1: repeating-linear-gradient(45deg, #FFB3CF 0 6px, #FFD3E2 6px 12px);
  --tape-2: repeating-linear-gradient(90deg, #9FD8FF 0 5px, #CDEBFF 5px 10px);
  --tape-3: repeating-linear-gradient(45deg, #FFE27A 0 6px, #FFF1B8 6px 12px);

  /* 분야별 티켓 색 — 떼는 부분·지도 핀·필터 점에 쓰여요 */
  --illust: #FF5FA2;    /* 일러스트: 핑크 */
  --anime: #3D6BFF;     /* 애니·만화: 파랑 */
  --game: #FFC93C;      /* 게임: 노랑 */
  --cos: #8B5CF6;       /* 동인·코스프레: 보라 */
  --goods: #FF8A3D;     /* 캐릭터·굿즈: 주황 */
  --culture: #12A5A5;   /* 문화: 청록 */
  --ended: #AEB6C7;     /* 종료: 회색 */

  --radius: 12px;
  --tabbar-h: 62px;
  color-scheme: light;
}

/* ----- 2. 다크 모드 -----
   설정에서 '시스템 설정 따르기'면 폰이 다크모드일 때 자동으로,
   '다크'를 고르면 항상 적용돼요. (아래 두 곳의 색은 똑같이 맞춰주세요) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12201D;
    --grid: rgba(255, 255, 255, 0.05);
    --paper: #1E2B30;
    --hero-sub: #8FC2B6;
    --accent: #FF6FAE;
    --marker: #8C7A2E;
    --tabbar: #172623;
    --tape-1: repeating-linear-gradient(45deg, #B9658A 0 6px, #94506F 6px 12px);
    --tape-2: repeating-linear-gradient(90deg, #4E86A8 0 5px, #3D6C88 5px 10px);
    --tape-3: repeating-linear-gradient(45deg, #A8923A 0 6px, #8A782F 6px 12px);
    --ink: #E8ECF6;
    --muted: #9AA3BF;
    --line: #3A4260;
    --lift: rgba(0, 0, 0, 0.45);
    --illust: #F2559A;
    --anime: #5B83FF;
    --game: #F2BE38;
    --cos: #9A72F7;
    --goods: #F5843D;
    --culture: #1DB3B3;
    --ended: #59617A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12201D;
  --grid: rgba(255, 255, 255, 0.05);
  --paper: #1E2B30;
  --hero-sub: #8FC2B6;
  --accent: #FF6FAE;
  --marker: #8C7A2E;
  --tabbar: #172623;
  --tape-1: repeating-linear-gradient(45deg, #B9658A 0 6px, #94506F 6px 12px);
  --tape-2: repeating-linear-gradient(90deg, #4E86A8 0 5px, #3D6C88 5px 10px);
  --tape-3: repeating-linear-gradient(45deg, #A8923A 0 6px, #8A782F 6px 12px);
  --ink: #E8ECF6;
  --muted: #9AA3BF;
  --line: #3A4260;
  --lift: rgba(0, 0, 0, 0.45);
  --illust: #F2559A;
  --anime: #5B83FF;
  --game: #F2BE38;
  --cos: #9A72F7;
  --goods: #F5843D;
  --culture: #1DB3B3;
  --ended: #59617A;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* 글자 크기 설정 (설정 → 글자 크기) */
:root[data-font="s"] { font-size: 93.75%; }
:root[data-font="l"] { font-size: 112.5%; }
:root[data-font="xl"] { font-size: 125%; }

/* 분야 색을 하나의 변수(--tone)로 바꿔주는 클래스 */
.tone-illust  { --tone: var(--illust);  --on-tone: #fff; }
.tone-anime   { --tone: var(--anime);   --on-tone: #fff; }
.tone-game    { --tone: var(--game);    --on-tone: #1B2340; }
.tone-cos     { --tone: var(--cos);     --on-tone: #fff; }
.tone-goods   { --tone: var(--goods);   --on-tone: #fff; }
.tone-culture { --tone: var(--culture); --on-tone: #fff; }
.is-ended     { --tone: var(--ended);   --on-tone: #fff; }

/* ----- 3. 기본 설정 ----- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", -apple-system, sans-serif;
  /* 모눈종이: 가로줄 + 세로줄 20px 간격 */
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 20px 20px,
    var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-feature-settings: "tnum"; /* 숫자 폭을 같게 → 날짜·D-day가 가지런해요 */
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--anime); outline-offset: 2px; }

/* ----- 4. 상단 영역 ----- */
.top { padding: calc(22px + env(safe-area-inset-top)) 16px 4px; }
.top-inner { max-width: 1100px; margin: 0 auto; }
.brand {
  display: inline-block; margin: 0 0 14px; padding: 1px 9px;
  font-size: 0.82rem; font-weight: 800; color: var(--ink);
  background: var(--marker); transform: rotate(-2deg);
}
.hero {
  margin: 0; font-size: clamp(1.9rem, 8vw, 2.6rem); font-weight: 900;
  line-height: 1.12; letter-spacing: -0.035em;
}
.hero-sub { margin: 8px 0 18px; color: var(--hero-sub); font-size: 0.9rem; }

/* 검색창 — 테두리만 있는 네모 칸 */
.search {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 14px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 10px;
}
.search-icon { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; flex: none; }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 1rem; color: var(--ink);
}
.search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--anime) 35%, transparent); }

/* 필터 칩 — 옆으로 스크롤 */
.chips {
  display: flex; gap: 6px; overflow-x: auto;
  margin: 0 -16px; padding: 12px 16px 2px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chips-region { padding-top: 6px; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--ink); border-radius: 6px; background: var(--paper);
  padding: 6px 11px; font-size: 0.86rem; font-weight: 700;
}
.chips-region .chip { border-color: var(--line); font-weight: 600; color: var(--muted); background: color-mix(in srgb, var(--paper) 60%, transparent); }
.chip.is-active,
.chips-region .chip.is-active { background: var(--accent); color: #fff; border-color: var(--ink); }
.chip-toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tone); display: inline-block; }
.chip.is-active .dot { box-shadow: 0 0 0 2px #fff; }

/* 안내 줄 (업데이트 날짜) */
.sample-banner {
  max-width: 1132px; margin: 14px auto 0; padding: 0 16px;
  font-size: 0.8rem; color: var(--muted);
}

/* ----- 5. 본문 / 탭 화면 ----- */
main { max-width: 1132px; margin: 0 auto; padding: 14px 16px; }
.view { display: none; }
.view.is-active { display: block; }

/* 티켓 목록: 모바일 1열 → 태블릿 2열 → PC 3열 */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 680px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.empty { text-align: center; color: var(--muted); padding: 56px 0; }

/* ----- 6. 티켓 카드 ----- */
.ticket {
  --stub-w: 92px;
  position: relative; display: grid; grid-template-columns: 1fr var(--stub-w);
  width: 100%; padding: 0; border: 0; text-align: left;
  background: transparent; border-radius: var(--radius);
  filter: drop-shadow(0 3px 0 var(--lift));
}
/* 점선 위·아래의 반원 홈: 종이를 실제로 동그랗게 오려내요 (어떤 바탕 위에서도 자연스럽게) */
.ticket-main {
  -webkit-mask: radial-gradient(circle 9px at 100% 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle 9px at 100% 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle 9px at 100% 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle 9px at 100% 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
}
.ticket-stub {
  -webkit-mask: radial-gradient(circle 9px at 0 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle 9px at 0 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle 9px at 0 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle 9px at 0 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
}
.ticket:active { transform: translateY(2px); filter: drop-shadow(0 1px 0 var(--lift)); }

/* 마스킹테이프: 티켓마다 색·각도·위치가 조금씩 달라요 */
.ticket::after {
  content: ""; position: absolute; z-index: 2; top: -8px; left: 22px;
  width: 64px; height: 18px; opacity: 0.88;
  background: var(--tape-1); transform: rotate(-4deg);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}
.ticket:nth-child(3n + 2)::after { background: var(--tape-2); transform: rotate(3deg); left: auto; right: 118px; }
.ticket:nth-child(3n)::after { background: var(--tape-3); transform: rotate(-2deg); left: 40%; }

.ticket-main {
  position: relative; min-width: 0; background: var(--paper);
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 15px 16px 14px; border-right: 2px dashed var(--line);
  display: flex; flex-direction: column;
}
.cat-tags { margin: 0; font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.ticket-name {
  margin: 3px 0 10px; font-size: 1.12rem; font-weight: 900;
  letter-spacing: -0.02em; line-height: 1.3; word-break: keep-all;
}
.ticket-fields { display: flex; gap: 18px; margin: 0; font-size: 0.8rem; }
.ticket-fields div { min-width: 0; }
.ticket-fields dt { font-size: 0.66rem; color: var(--muted); }
.ticket-fields dd { margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-fields div:last-child { flex: 1; }

/* 티켓 아래쪽 줄: 바코드(또는 도장) + 배치도 표시 */
.ticket-foot { display: flex; align-items: flex-end; gap: 10px; margin-top: auto; }
.has-map {
  margin-left: auto; padding: 1px 7px; border-radius: 4px;
  font-size: 0.68rem; font-weight: 800; color: var(--ink);
  background: var(--marker);
}

/* 바코드 장식 */
.barcode {
  display: block; margin-top: 11px; height: 13px; width: 112px; opacity: 0.55;
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px,
    var(--ink) 8px 11px, transparent 11px 12px);
}

/* 끝난 행사: "입장 마감" 도장 */
.stamp {
  display: inline-block; margin-top: 10px;
  padding: 2px 8px; border: 2px solid var(--illust); border-radius: 5px;
  color: var(--illust); font-size: 0.78rem; font-weight: 900;
  transform: rotate(-9deg); opacity: 0.85;
}
.ticket.is-ended { opacity: 0.72; }

/* 떼는 부분 (D-day) */
.ticket-stub {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 4px; border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--tone); color: var(--on-tone);
}
.stub-big { font-size: 1.55rem; font-weight: 900; line-height: 1; letter-spacing: -0.03em; }
.stub-small { margin-top: 6px; font-size: 0.7rem; font-weight: 700; opacity: 0.9; }
.stub-fav { position: absolute; top: 7px; right: 9px; font-size: 0.85rem; }

/* ----- 7. 지도 ----- */
.all-map {
  height: calc(100vh - 300px); min-height: 380px;
  border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden;
}
/* 핀: 작은 티켓 모양 말풍선에 D-day */
.pin {
  position: relative; width: 54px; height: 30px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--tone); color: var(--on-tone);
  border: 2px solid #1B2340; font: 900 12px/1 "Pretendard Variable", Pretendard, sans-serif;
  box-shadow: 0 2px 0 rgba(27, 35, 64, 0.35);
}
.pin::after {
  content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -6px;
  border: 6px solid transparent; border-top: 7px solid #1B2340; border-bottom: 0;
}
.pin.is-ended { opacity: 0.8; }

.leaflet-popup-content-wrapper { border-radius: 10px; border: 2px solid #1B2340; box-shadow: 0 3px 0 rgba(27,35,64,.25); }
.leaflet-popup-content { margin: 12px 14px; }
.popup-card { font-family: "Pretendard Variable", Pretendard, sans-serif; min-width: 190px; color: #1B2340; }
.popup-status {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 900;
  background: var(--tone); color: var(--on-tone);
}
.popup-card h3 { margin: 6px 0 2px; font-size: 15px; font-weight: 900; }
.popup-card p { margin: 0 0 10px; color: #5D6785; font-size: 12px; }
.popup-card button {
  width: 100%; border: 0; border-radius: 6px; padding: 8px;
  background: #1B2340; color: #fff; font-weight: 800;
}
.popup-sep { border: 0; border-top: 2px dashed #C9D1DE; margin: 12px 0; }

/* ----- 8. 상세 화면 (아래에서 올라오는 큰 티켓) ----- */
.detail-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(18, 23, 38, 0.55);
  animation: fade 0.2s ease;
}
.detail {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001;
  max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 20px 20px,
    var(--bg);
  border-radius: 22px 22px 0 0;
  padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
  animation: slideUp 0.28s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 760px) {
  .detail {
    left: 50%; top: 50%; bottom: auto; width: 600px; max-height: 88vh;
    transform: translate(-50%, -50%); border-radius: 22px; animation: pop 0.2s ease;
  }
}
@keyframes slideUp { from { transform: translateY(48px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%); } }
@media (prefers-reduced-motion: reduce) {
  .detail, .detail-backdrop { animation: none; }
}

/* 큰 티켓: 위쪽 색 띠(떼는 부분) + 점선 + 아래 본권 */
.sheet-ticket {
  position: relative; border-radius: 14px;
  filter: drop-shadow(0 3px 0 var(--lift));
}
/* 큰 티켓 위에도 마스킹테이프 두 장 */
.sheet-ticket::before, .sheet-ticket::after {
  content: ""; position: absolute; z-index: 2; top: -9px;
  width: 74px; height: 20px; opacity: 0.9; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}
.sheet-ticket::before { left: 26px; background: var(--tape-1); transform: rotate(-5deg); }
.sheet-ticket::after { right: 70px; background: var(--tape-3); transform: rotate(4deg); }
.sheet-stub {
  position: relative; display: flex; align-items: baseline; gap: 10px;
  padding: 18px 18px 16px; border-radius: 14px 14px 0 0;
  background: var(--tone); color: var(--on-tone);
  border-bottom: 2px dashed color-mix(in srgb, var(--on-tone) 45%, transparent);
}
/* 점선 양끝의 반원 홈 (실제로 오려내기) */
.sheet-stub {
  -webkit-mask: radial-gradient(circle 10px at 0 100%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 10px at 100% 100%, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 10px at 0 100%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 10px at 100% 100%, #0000 98%, #000) right / 51% 100% no-repeat;
}
.sheet-main {
  background: var(--paper); border-radius: 0 0 14px 14px;
  -webkit-mask: radial-gradient(circle 10px at 0 0, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 10px at 100% 0, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 10px at 0 0, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 10px at 100% 0, #0000 98%, #000) right / 51% 100% no-repeat;
}
.sheet-big { font-size: 2.2rem; font-weight: 900; line-height: 1; letter-spacing: -0.04em; }
.sheet-status { font-size: 0.85rem; font-weight: 700; opacity: 0.9; }
.detail-close {
  position: absolute; top: 12px; right: 12px; width: 38px; height: 38px;
  border: 0; border-radius: 50%; font-size: 1.05rem;
  background: color-mix(in srgb, var(--on-tone) 18%, transparent); color: var(--on-tone);
}

.sheet-main { position: relative; padding: 18px; }
.detail-title {
  margin: 4px 0 14px; font-size: 1.5rem; font-weight: 900;
  letter-spacing: -0.03em; line-height: 1.25; word-break: keep-all;
}
.sheet-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 0 0 16px; }
.field.wide { grid-column: 1 / -1; }
.field dt { font-size: 0.7rem; color: var(--muted); }
.field dd { margin: 1px 0 0; font-size: 0.93rem; font-weight: 600; word-break: keep-all; }
.fav-btn {
  border: 2px solid var(--ink); background: transparent; border-radius: 8px;
  padding: 8px 14px; font-weight: 800; font-size: 0.9rem;
}
.fav-btn[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--ink); }
.barcode-lg { position: absolute; right: 18px; bottom: 22px; width: 96px; height: 26px; margin: 0; }
.stamp-lg { position: absolute; margin: 0; right: 18px; bottom: 20px; font-size: 1rem; padding: 3px 10px; }

.detail-content { padding: 6px 2px 0; }
.desc { margin: 18px 0 0; font-size: 0.95rem; white-space: pre-line; }
.section-title {
  display: inline-block; margin: 26px 0 0; font-size: 0.95rem; font-weight: 900;
  background: linear-gradient(transparent 55%, var(--marker) 55%); /* 형광펜 밑줄 */
}
.detail-map { margin-top: 10px; height: 210px; border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }

/* 버튼 */
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 46px; padding: 10px; border-radius: 8px; text-decoration: none;
  border: 2px solid var(--ink); background: var(--paper);
  font-weight: 800; font-size: 0.88rem;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--ink); }
.btn-kakao { background: #FEE500; color: #191919; border-color: #191919; }
.btn-naver { background: #03C75A; color: #fff; border-color: #03C75A; }

.source { margin: 24px 0 0; font-size: 0.78rem; color: var(--muted); }
.source a { font-weight: 800; }

/* ----- 9. 하단 탭 메뉴 ----- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  display: flex; justify-content: center;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--tabbar); border-top: 2px solid var(--ink);
}
.tab {
  flex: 1; max-width: 200px; border: 0; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 0.74rem; font-weight: 700; color: var(--muted);
}
.tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.tab.is-active { color: var(--accent); }
.tab.is-active svg { stroke-width: 2.4; }

body.no-scroll { overflow: hidden; }

/* ----- 10. 부스 배치도 ----- */
.booth-map {
  position: relative; display: block; width: 100%; margin-top: 10px; padding: 0;
  border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; background: #fff;
}
.map-frame { position: relative; display: block; }
.booth-map img, .map-frame img { display: block; width: 100%; height: auto; }
/* 부스 위치 표시: 핑크 테두리가 세 번 반짝이고 남아 있어요 */
.booth-mark {
  position: absolute; border: 3px solid var(--accent); border-radius: 4px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 0 14px 4px color-mix(in srgb, var(--accent) 60%, transparent);
  pointer-events: none;
}
.booth-mark[hidden] { display: none; }
.booth-mark.pulse { animation: markPulse 0.7s ease-in-out 3; }
@keyframes markPulse { 50% { transform: scale(1.35); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .booth-mark.pulse { animation: none; } }
.booth-picked {
  margin: 8px 0 0; padding: 8px 12px; border-radius: 8px;
  background: var(--paper); border: 2px solid var(--accent); font-size: 0.88rem; font-weight: 600;
}
.booth-picked b { color: var(--accent); }
.booth-tip { margin: 8px 0 0; font-size: 0.78rem; color: var(--muted); }
.booth-main { cursor: default; }
.booth.has-pos .booth-main { cursor: pointer; }
.booth.has-pos:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.booth.is-picked { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pin-ico { width: 14px; height: 14px; margin-left: 6px; vertical-align: -2px; fill: none; stroke: var(--accent); stroke-width: 2.4; }
.booth-hit { margin: -4px 0 8px; font-size: 0.78rem; color: var(--ink); }
.booth-hit b { padding: 0 5px; border-radius: 3px; background: var(--marker); }
.booth-map-hint {
  position: absolute; right: 8px; bottom: 8px; padding: 3px 9px; border-radius: 6px;
  background: var(--ink); color: var(--paper); font-size: 0.75rem; font-weight: 800;
}
.btn-row.one { grid-template-columns: 1fr; }
.booth-search { margin-top: 12px; height: 44px; }
.booth-empty { margin: 14px 0 0; color: var(--muted); font-size: 0.85rem; }
.booth-groups { margin-top: 10px; display: grid; gap: 8px; }
.booth-group {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; overflow: hidden;
}
.booth-group summary {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  font-weight: 900; font-size: 0.92rem; cursor: pointer; list-style: none;
}
.booth-group summary::-webkit-details-marker { display: none; }
.booth-group summary::after { content: "＋"; margin-left: auto; color: var(--muted); }
.booth-group[open] summary::after { content: "−"; }
.gdot { width: 12px; height: 12px; border-radius: 3px; background: var(--gcolor); flex: none; }
.gcount { color: var(--muted); font-weight: 700; font-size: 0.8rem; }
.booth-list { list-style: none; margin: 0; padding: 0 14px 8px; }
.booth {
  display: flex; align-items: center; gap: 8px;
  border-top: 1px dashed var(--line); font-size: 0.88rem;
}
.booth-main {
  flex: 1; min-width: 0; display: grid; grid-template-columns: 64px 1fr auto; align-items: baseline; gap: 10px;
  padding: 9px 0; border: 0; background: none; text-align: left; font: inherit; color: inherit;
}
.booth[hidden] { display: none; }
.booth-code {
  justify-self: start; padding: 1px 7px; border-radius: 4px; font-size: 0.78rem;
  background: var(--gcolor); color: #fff; white-space: nowrap;
}
.booth-name { font-weight: 600; word-break: keep-all; }
.booth-name.is-blank { font-weight: 500; color: var(--muted); }
.booth-size { color: var(--muted); font-size: 0.74rem; white-space: nowrap; }

/* 배치도 크게 보기 화면 */
.viewer {
  position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column;
  background: rgba(18, 23, 38, 0.92);
}
.viewer-bar {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
}
.viewer-btn {
  width: 42px; height: 42px; border-radius: 10px; border: 2px solid #fff;
  background: transparent; color: #fff; font-size: 1.2rem; font-weight: 900;
}
.viewer-close { background: #fff; color: #1B2340; }
.viewer-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; padding: 0 8px 20px; }
.viewer-frame { width: 100%; margin: 0 auto; background: #fff; border-radius: 8px; overflow: hidden; }
.viewer-frame img { max-width: none; }


/* ----- 11. 부스 찜 · 체크리스트 ----- */
/* 우선순위 색: 1 꼭 살 것(핑크) / 2 살 수도(노랑) / 3 구경만(하늘) */
.p1 { --pc: #FF5FA2; --pc-text: #fff; }
.p2 { --pc: #FFC93C; --pc-text: #1B2340; }
.p3 { --pc: #5BB8F0; --pc-text: #fff; }
.booth-star {
  flex: none; min-width: 44px; height: 30px; padding: 0 8px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--muted);
  font-size: 0.78rem; font-weight: 900;
}
.booth-star.p1, .booth-star.p2, .booth-star.p3 { background: var(--pc); color: var(--pc-text); border-color: var(--ink); }
.pchip {
  display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 0.72rem; font-weight: 900;
  background: var(--pc); color: var(--pc-text);
}
.checklist { margin-top: 12px; }
.checklist-empty {
  margin: 0; padding: 12px 14px; border: 2px dashed var(--line); border-radius: 10px;
  font-size: 0.82rem; color: var(--muted); line-height: 1.7;
}
.checklist-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px 8px; background: var(--paper); border: 2px solid var(--ink); border-bottom: 0; border-radius: 10px 10px 0 0;
}
.checklist-head b { font-size: 0.95rem; }
.checklist-count { font-size: 0.8rem; font-weight: 800; color: var(--accent); }
.checklist-bar { flex: 1 1 100%; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.checklist-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.checklist-list {
  list-style: none; margin: 0; padding: 0 14px 6px; background: var(--paper);
  border: 2px solid var(--ink); border-top: 0; border-radius: 0 0 10px 10px;
}
.checklist-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 0.88rem; }
.checklist-list label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; cursor: pointer; }
.checklist-list input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.cl-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checklist-list li.is-done b, .checklist-list li.is-done .cl-name { text-decoration: line-through; opacity: .55; }
.cl-locate {
  flex: none; padding: 3px 9px; border-radius: 6px; border: 1.5px solid var(--ink);
  background: transparent; font-size: 0.74rem; font-weight: 800;
}
/* 배치도 위 찜 표시 */
.pick-layer { position: absolute; inset: 0; pointer-events: none; }
.pick-dot {
  position: absolute; border-radius: 3px; background: color-mix(in srgb, var(--pc) 55%, transparent);
  outline: 2px solid var(--pc); outline-offset: 0;
}
.pick-dot.is-done { background: rgba(120,128,150,.45); outline-color: #7C8AA5; }
.pick-dot.is-done::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 10px; }
.has-map { white-space: nowrap; }
.has-map.is-check { background: var(--accent); color: #fff; }
.ticket-foot .has-map.is-check + .has-map { margin-left: 0; }
.ticket-foot { gap: 6px; }
.ticket-foot .barcode { flex: 0 1 112px; min-width: 28px; }

/* ----- 12. 관람 안내 · 시간표 ----- */
.guide-list { margin-top: 10px; display: grid; gap: 6px; }
.guide-item { background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; }
.guide-item summary {
  display: flex; align-items: center; padding: 11px 14px; font-weight: 800; font-size: 0.92rem;
  cursor: pointer; list-style: none;
}
.guide-item summary::-webkit-details-marker { display: none; }
.guide-item summary::after { content: "＋"; margin-left: auto; color: var(--muted); }
.guide-item[open] summary::after { content: "−"; }
.guide-item p { margin: 0; padding: 0 14px 12px; font-size: 0.88rem; white-space: pre-line; line-height: 1.65; }
.day-tabs { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; }
.day-tab {
  flex: none; padding: 6px 12px; border-radius: 6px; border: 1.5px solid var(--ink);
  background: var(--paper); font-weight: 800; font-size: 0.85rem;
}
.day-tab.is-active { background: var(--accent); color: #fff; }
.timetable { margin-top: 8px; background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; }
.tt-list { list-style: none; margin: 0; padding: 4px 14px; }
.tt-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); }
.tt-item:first-child { border-top: 0; }
.tt-time { flex: none; width: 52px; font-weight: 900; font-size: 0.9rem; display: flex; flex-direction: column; }
.tt-time small { font-weight: 600; color: var(--muted); font-size: 0.72rem; }
.tt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 0.9rem; }
.tt-body small { color: var(--muted); font-size: 0.76rem; }
.tt-item.is-past { opacity: .45; }
.tt-item.is-now { background: color-mix(in srgb, var(--accent) 10%, transparent); margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.tt-now { flex: none; padding: 1px 7px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 0.72rem; font-weight: 900; }

/* ----- 13. 오프라인 안내 · 지난 행사 아카이브 ----- */
.offline-bar {
  position: sticky; top: 0; z-index: 950; margin: 0; padding: 9px 16px;
  background: var(--ink); color: var(--paper); font-size: 0.82rem; font-weight: 700; text-align: center;
}
.offline-bar[hidden] { display: none; }
.offline-ok { color: var(--ink); font-weight: 600; }
.archive-link {
  display: block; width: 100%; margin: 22px 0 0; padding: 13px;
  border: 2px dashed var(--ink); border-radius: 10px; background: color-mix(in srgb, var(--paper) 70%, transparent);
  font-weight: 800; font-size: 0.9rem;
}
.archive-back { border: 0; background: none; padding: 4px 0; font-weight: 800; color: var(--muted); font-size: 0.88rem; }
.archive-title { margin: 8px 0 2px; font-size: 1.5rem; font-weight: 900; letter-spacing: -0.03em; }
.archive-sub { margin: 0 0 8px; color: var(--muted); font-size: 0.86rem; }
.archive-y { margin: 26px 0 0; font-size: 1.2rem; font-weight: 900; display: inline-block; background: var(--marker); padding: 0 8px; transform: rotate(-1deg); }
.archive-y span { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-left: 4px; }
.archive-m { margin: 16px 0 10px; font-size: 0.95rem; font-weight: 800; color: var(--muted); }

.app-foot { margin: 18px 0 0; text-align: center; font-size: 0.76rem; color: var(--muted); line-height: 1.7; }
.app-foot a { font-weight: 800; }

/* ----- 14. 커뮤니티 (행사 이야기) ----- */
.mk { background: linear-gradient(transparent 55%, var(--marker) 55%); }
.linkish { border: 0; background: none; padding: 0; font-weight: 800; text-decoration: underline; color: var(--accent); cursor: pointer; }

/* 커뮤니티 탭 */
.comm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.comm-head .section-title { margin-top: 6px; font-size: 1.15rem; }
.comm-sub { margin: 6px 0 14px; color: var(--muted); font-size: 0.85rem; }
.comm-login {
  border: 2px solid var(--ink); border-radius: 999px; padding: 7px 14px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 0.85rem;
}
.comm-me { font-size: 0.88rem; display: inline-flex; gap: 8px; align-items: center; }
.comm-demo {
  margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; font-size: 0.8rem;
  background: var(--marker); color: #1B2340; border: 2px dashed var(--ink);
}
.comm-empty {
  text-align: center; padding: 34px 16px; margin: 6px 0; color: var(--muted);
  background: var(--paper); border: 2px dashed var(--line); border-radius: var(--radius);
}
.comm-empty b { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 4px; }
.comm-empty p { margin: 0; font-size: 0.85rem; }
#communityList { display: grid; gap: 10px; }
@media (min-width: 680px) { #communityList { grid-template-columns: repeat(2, 1fr); } #communityList .comm-demo { grid-column: 1 / -1; } }
.comm-ev {
  display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px;
  width: 100%; padding: 0 12px 0 0; text-align: left; overflow: hidden;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: 0 3px 0 var(--lift);
}
.comm-ev-st {
  align-self: stretch; display: flex; align-items: center; justify-content: center;
  min-height: 62px; background: var(--tone, var(--accent)); color: var(--on-tone, #fff);
  font-weight: 900; font-size: 0.82rem; border-right: 2px dashed var(--paper); text-align: center; padding: 4px;
}
.comm-ev-body { min-width: 0; padding: 9px 0; }
.comm-ev-body b, .cb-ev b { display: block; font-size: 0.93rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comm-ev-body small, .cb-ev small { display: block; color: var(--muted); font-size: 0.76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comm-ev-n { font-size: 0.76rem; font-weight: 800; color: var(--accent); white-space: nowrap; }

/* 상세 화면의 "행사 이야기" 버튼 */
.board-btn {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  width: 100%; margin-top: 18px; padding: 12px 14px; text-align: left;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--accent);
}
.board-btn-ic { font-size: 1.4rem; }
.board-btn b { display: block; font-size: 0.95rem; }
.board-btn small { color: var(--muted); font-size: 0.76rem; }

/* 게시판 (전체 화면) */
.comm-board {
  position: fixed; inset: 0; z-index: 1500; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 20px 20px,
    var(--bg);
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}
.comm-board[hidden], .comm-modal[hidden] { display: none; }
.comm-board > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.cb-back { border: 2px solid var(--ink); background: var(--paper); border-radius: 8px; padding: 6px 12px; font-weight: 800; }
.cb-ev {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; overflow: hidden;
  margin-top: 12px; padding-right: 12px; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius);
}
.cb-ev > span:last-child { min-width: 0; padding: 8px 0; }
.cb-title { margin: 16px 0 8px; font-size: 1.2rem; font-weight: 900; }
.cb-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.cb-tabs::-webkit-scrollbar { display: none; }
.cb-tab {
  flex: none; border: 2px solid var(--ink); border-radius: 999px; padding: 6px 12px;
  background: var(--paper); font-weight: 800; font-size: 0.82rem; white-space: nowrap;
}
.cb-tab.is-on { background: var(--ink); color: var(--paper); }
.cb-note { color: var(--muted); font-size: 0.82rem; margin: 6px 0 10px; }

/* 평가 요약 */
.cb-score { margin: 6px 0 12px; padding: 14px; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); }
.cb-big { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cb-big > b { font-size: 2.2rem; font-weight: 900; line-height: 1; }
.cb-big > span { font-size: 0.78rem; color: var(--muted); display: flex; flex-direction: column; }
.stars { font-style: normal; color: #F5A623; font-size: 1rem; letter-spacing: 1px; }
.cb-row { display: grid; grid-template-columns: 92px 1fr 30px; gap: 8px; align-items: center; font-size: 0.8rem; margin: 5px 0; }
.cb-row b { text-align: right; }
.cb-bar { height: 9px; border-radius: 99px; background: var(--line); overflow: hidden; }
.cb-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.cb-kw { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cb-kw span { font-size: 0.76rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.cb-kw .good { background: #D9F5E6; color: #146C43; }
.cb-kw .bad { background: #FFE3E3; color: #A61E1E; }

/* 글 카드 */
.cb-list { display: grid; gap: 10px; }
.cp {
  position: relative; padding: 12px 14px 8px; background: var(--paper);
  border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 0 3px 0 var(--lift);
}
.cp-meta { display: flex; align-items: center; gap: 7px; font-size: 0.82rem; flex-wrap: wrap; }
.cp-av {
  width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 0.78rem; border: 2px solid var(--ink);
}
.cp-nick { font-weight: 800; }
.cp-badge { font-size: 0.7rem; font-weight: 800; color: #0E7A55; background: #D3F4E4; border: 1.5px solid #0E7A55; border-radius: 99px; padding: 0 7px; }
.cp-time { margin-left: auto; color: var(--muted); font-size: 0.74rem; }
.cp-type { display: inline-block; margin-top: 8px; font-size: 0.72rem; font-weight: 800; padding: 1px 8px; border-radius: 4px; color: #1B2340; }
.t-day { background: #FFD3E2; } .t-rev { background: #CDEBFF; } .t-art { background: #FFF1B8; } .t-q { background: #E3D7FF; }
.cp-rate { margin: 6px 0 0; font-size: 0.76rem; color: #C98500; }
.cp-text { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; font-size: 0.92rem; }
.cp-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; margin-top: 8px; }
.cp-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1.5px solid var(--line); cursor: zoom-in; }
.cp-booth {
  display: block; width: 100%; margin-top: 8px; padding: 7px 10px; text-align: left; font-size: 0.82rem;
  background: var(--marker); color: #1B2340; border: 2px solid var(--ink); border-radius: 8px;
}
.cp-acts { display: flex; gap: 4px; margin-top: 6px; border-top: 1.5px dashed var(--line); padding-top: 4px; }
.cp-acts button { border: 0; background: none; padding: 6px 8px; font-size: 0.84rem; color: var(--muted); font-weight: 700; border-radius: 6px; }
.cp-acts button[aria-pressed="true"] { color: var(--accent); }
.cp-acts .cp-more { margin-left: auto; font-size: 1.1rem; }
.cb-fab {
  position: fixed; right: max(16px, calc(50% - 344px)); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 1510;
  max-width: none !important; margin: 0 !important;
  border: 2px solid var(--ink); border-radius: 999px; padding: 12px 20px;
  background: var(--accent); color: #fff; font-weight: 900; box-shadow: 0 4px 0 var(--ink);
}

/* 작은 창 (로그인·글쓰기·댓글 등) */
.comm-modal {
  position: fixed; inset: 0; z-index: 1800; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(18, 23, 38, 0.55);
}
@media (min-width: 680px) { .comm-modal { align-items: center; } }
.cm-card {
  width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  padding: 20px 18px calc(16px + env(safe-area-inset-bottom));
  background: var(--paper); border: 2px solid var(--ink); border-radius: 16px 16px 0 0;
}
@media (min-width: 680px) { .cm-card { border-radius: 16px; } }
.cm-h { margin: 0 0 6px; font-size: 1.1rem; font-weight: 900; }
.cm-p { margin: 0 0 12px; color: var(--muted); font-size: 0.86rem; }
.cm-l { display: block; margin: 14px 0 6px; font-size: 0.85rem; }
.cm-check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-size: 0.9rem; }
.cm-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.cm-btn {
  display: block; width: 100%; min-height: 46px; margin-top: 10px; border-radius: 8px;
  border: 2px solid var(--ink); background: var(--paper); font-weight: 800;
}
.cm-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.cm-btn.primary { background: var(--accent); color: #fff; }
.cm-btn.google { background: #fff; color: #1F1F1F; border-color: #747775; }
.cm-btn.danger { color: #D32F2F; border-color: #D32F2F; }
.cm-note { margin: 8px 0 0; font-size: 0.78rem; color: var(--muted); }
.cm-cancel { display: block; margin: 10px auto 0; border: 0; background: none; color: var(--muted); font-weight: 700; padding: 8px; }
.cm-input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 2px solid var(--ink);
  background: var(--paper); color: var(--ink); font: inherit; font-size: 16px;
}
.cm-text { resize: vertical; min-height: 96px; }
.cm-err { min-height: 1.2em; margin: 6px 0 0; color: #D32F2F; font-size: 0.82rem; font-weight: 700; }
.cm-types, .cm-kws, .cm-reasons, .cm-booths { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-types button, .cm-kws button, .cm-booths button, .cm-reasons button {
  border: 2px solid var(--line); border-radius: 999px; padding: 6px 11px; background: var(--paper); font-size: 0.82rem; font-weight: 700;
}
.cm-types button.is-on, .cm-booths button.is-on { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.cm-kws button.good.is-on { border-color: #146C43; background: #D9F5E6; color: #146C43; }
.cm-kws button.bad.is-on { border-color: #A61E1E; background: #FFE3E3; color: #A61E1E; }
.cm-booths { margin-top: 8px; max-height: 150px; overflow-y: auto; }
.cm-reasons { flex-direction: column; }
.cm-reasons button { border-radius: 8px; text-align: left; padding: 11px 12px; }
.cm-rate { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; margin: 4px 0; }
.cm-stars button { border: 0; background: none; font-size: 1.35rem; color: #F5A623; padding: 0 2px; }
.cm-photos { display: flex; gap: 8px; flex-wrap: wrap; }
.cm-add, .cm-thumb {
  position: relative; width: 70px; height: 70px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--line); font-size: 1.5rem; color: var(--muted); cursor: pointer;
  background-size: cover; background-position: center;
}
.cm-add[hidden] { display: none; }
.cm-thumb { border-style: solid; border-color: var(--ink); }
.cm-thumb button { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); font-size: 0.7rem; }
.cm-verify { margin-top: 14px; padding: 10px 12px; border-radius: 8px; font-size: 0.82rem; background: var(--bg); border: 2px dashed var(--line); }
.cm-verify.ok { background: #D3F4E4; color: #0E5C40; border-color: #0E7A55; }
.cm-rule { margin: 12px 0 0; font-size: 0.75rem; color: var(--muted); line-height: 1.6; }
.cm-comments { max-height: 46vh; overflow-y: auto; margin: 6px 0 10px; }
.cm-c { padding: 8px 0; border-bottom: 1.5px dashed var(--line); font-size: 0.86rem; }
.cm-c span { color: var(--muted); font-size: 0.74rem; }
.cm-c p { margin: 2px 0 0; white-space: pre-wrap; word-break: break-word; }
.cm-cin { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.cm-cin .cm-btn { margin: 0; width: auto; padding: 0 16px; }
.comm-toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); z-index: 2100;
  transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; font-size: 0.86rem; font-weight: 700;
  background: var(--ink); color: var(--paper); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); white-space: nowrap;
}

/* ----- 설정 화면 ----- */
body[data-view="settings"] :is(.hero, .hero-sub, #sampleBanner) { display: none; }
body[data-view="settings"] .top { padding-bottom: 0; }
.top-inner { position: relative; }
.settings-btn {
  position: absolute; top: -6px; right: -4px; width: 42px; height: 42px;
  display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink);
}
.settings-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.settings-btn:active { background: color-mix(in srgb, var(--ink) 10%, transparent); }

.set-group {
  margin: 18px 0 0; padding: 4px 16px; background: var(--paper);
  border: 2px solid var(--ink); border-radius: var(--radius);
  filter: drop-shadow(0 3px 0 var(--lift));
}
.set-group-title { margin: 22px 2px 0; font-size: 0.82rem; font-weight: 800; color: var(--muted); }
.set-group-title + .set-group { margin-top: 8px; }
.set-row { padding: 14px 0; border-top: 1.5px dashed var(--line); }
.set-row:first-child { border-top: 0; }
.set-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-label { font-weight: 800; font-size: 0.95rem; }
.set-desc { margin: 4px 0 0; font-size: 0.8rem; color: var(--muted); line-height: 1.55; }
.set-desc.is-warn { color: var(--accent); font-weight: 700; }
.set-sub { margin-top: 10px; }
.set-sub[hidden] { display: none; }

/* 여러 개 중 하나 고르기 (라이트/다크 등) */
.seg { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.seg button {
  flex: 1 1 0; min-width: 64px; min-height: 40px; padding: 6px 8px;
  border: 1.5px solid var(--line); border-radius: 8px; background: transparent;
  font-size: 0.85rem; font-weight: 700; color: var(--muted);
}
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--ink); }

/* 켜기/끄기 스위치 */
.switch { position: relative; flex: none; width: 50px; height: 30px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch span {
  position: absolute; inset: 0; border-radius: 30px; background: var(--line);
  border: 1.5px solid var(--ink); transition: background 0.15s;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--ink); transition: transform 0.15s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--anime); outline-offset: 2px; }
.switch input:disabled + span { opacity: 0.45; }

.set-select {
  font: inherit; font-size: 0.88rem; font-weight: 700; color: var(--ink);
  padding: 6px 10px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--paper);
}
.set-link {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 14px 0; border: 0; border-top: 1.5px dashed var(--line); background: none;
  text-align: left; text-decoration: none; font-weight: 800; font-size: 0.95rem;
}
.set-group > .set-link:first-child { border-top: 0; }
.set-link::after { content: "›"; color: var(--muted); font-size: 1.2rem; }
.set-link.is-danger { color: var(--accent); }
.set-link.is-danger::after { content: ""; }
.set-value { color: var(--muted); font-weight: 700; font-size: 0.88rem; }
.set-small-btn:disabled { opacity: 0.4; cursor: default; }
.set-small-btn {
  flex: none; padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 8px;
  background: transparent; font-size: 0.82rem; font-weight: 800;
}
.set-credits { margin: 0; padding: 0 0 14px; font-size: 0.8rem; color: var(--muted); line-height: 1.8; }
.set-credits summary { cursor: pointer; padding: 14px 0; font-size: 0.95rem; font-weight: 800; color: var(--ink); list-style: none; }
.set-credits summary::-webkit-details-marker { display: none; }
.set-credits a { font-weight: 700; }
#settingsCredits { border-top: 1.5px dashed var(--line); }
