/* ---- tokens (README design handoff 기준, light-only high-fidelity spec) ---- */
:root {
  --bg: #fbf9fb;
  --card: #ffffff;
  --ink: #2a2331;
  --ink-soft: #8a8093;
  --ink-soft2: #a99fb2;
  --icon-inactive: #cbc2d3;
  --line: #f0eaf4;
  --line2: #f2edf6;
  --line3: #ece6f2;
  --field-bg: #faf7fb;
  --brand: #c9426f;
  --font-sans: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

#app { max-width: 480px; margin: 0 auto; position: relative; min-height: 100vh; background: var(--bg); }

.tab-view { padding-bottom: 96px; min-height: 100vh; }
.tab-view[hidden] { display: none; }

.statusbar-pad { height: 14px; }

/* press feedback */
.ex-card, .map-card, .tab-btn, .date-cell, .save-toggle-pill, .sheet-cta, .month-nav button, .map-filter-btn, .map-pin {
  transition: transform .1s ease;
}
.ex-card:active, .map-card:active, .date-cell:active, .save-toggle-pill:active, .sheet-cta:active, .month-nav button:active, .map-filter-btn:active, .map-pin:active {
  transform: scale(.98);
}

/* ---- 캘린더 탭 ---- */
.cal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(251, 249, 251, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 10px 22px 14px;
}
.cal-header-row { display: flex; align-items: baseline; justify-content: space-between; }
.month-title { display: flex; align-items: baseline; gap: 8px; }
.month-title #calMonth { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.03em; color: var(--ink); }
.month-title #calYear { font-size: 13px; font-weight: 600; color: var(--ink-soft2); }
.month-nav { display: flex; gap: 6px; }
.month-nav button {
  width: 34px; height: 34px; border-radius: 12px; background: var(--card); border: 1px solid var(--line3);
  font-size: 14px; font-weight: 600; color: var(--ink-soft); cursor: pointer; font-family: inherit;
}

.date-strip { display: flex; gap: 6px; overflow-x: auto; margin-top: 14px; scrollbar-width: none; -ms-overflow-style: none; }
.date-strip::-webkit-scrollbar { display: none; }
.date-cell {
  flex: 0 0 46px; width: 46px; padding: 8px 0 7px; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.date-cell .dow { font-size: 10px; font-weight: 600; color: var(--ink-soft2); }
.date-cell .dnum { font-size: 17px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.date-cell.today .dnum { color: var(--brand); }
.date-cell .ddots { display: flex; gap: 3px; height: 4px; }
.date-cell .ddots span { width: 4px; height: 4px; border-radius: 50%; display: block; }
.date-cell.selected { background: var(--ink); }
.date-cell.selected .dow { color: rgba(255, 255, 255, .6); }
.date-cell.selected .dnum { color: #fff; }
.date-cell.selected .ddots span { opacity: .8; }

.sel-summary { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 22px 0; }
.sel-summary .d { font-size: 15px; font-weight: 700; color: var(--ink); }
.sel-summary .c { font-size: 12px; font-weight: 600; color: var(--ink-soft); flex: 0 0 auto; }

.card-list { list-style: none; margin: 0; padding: 14px 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.ex-card {
  background: var(--card); border-radius: 20px; padding: 14px; box-shadow: 0 2px 14px rgba(80, 50, 90, .07);
  display: flex; gap: 14px; cursor: pointer; border: none; text-align: left; width: 100%; font-family: inherit;
}
.ex-thumb {
  width: 72px; height: 72px; border-radius: 16px; flex: 0 0 72px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.ex-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-thumb .initial { font-size: 20px; font-weight: 700; opacity: .9; }
.ex-thumb .imglabel { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 9px; font-weight: 600; letter-spacing: .06em; color: rgba(255, 255, 255, .75); }
.ex-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.ex-title { font-size: 15.5px; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; color: var(--ink); text-wrap: pretty; }
.ex-meta { font-size: 12px; font-weight: 500; color: var(--ink-soft); margin-top: 5px; }
.ex-progress-row { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.ex-progress-track { flex: 1; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ex-progress-fill { height: 100%; border-radius: 3px; }
.ex-dday { font-size: 10.5px; font-weight: 700; white-space: nowrap; }

/* ---- 지도 탭 ---- */
#tab-map { padding-bottom: 0; height: calc(100vh - 76px); overflow: hidden; position: relative; }
.map-area { position: relative; width: 100%; height: 100%; background: #eef0e8; overflow: hidden; }
.naver-map-el { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-search-row { position: absolute; left: 14px; right: 14px; top: 52px; z-index: 9; display: flex; gap: 8px; }
.map-search-box {
  flex: 1; background: rgba(255, 255, 255, .95); border-radius: 16px; padding: 12px 14px;
  box-shadow: 0 3px 14px rgba(40, 20, 50, .12); display: flex; align-items: center; gap: 8px;
}
.map-search-box input { border: none; background: none; outline: none; font-size: 13px; font-weight: 600; color: var(--ink); width: 100%; font-family: inherit; }
.map-search-box input::placeholder { color: var(--ink-soft); }
.search-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink-soft); flex: 0 0 auto; cursor: pointer; }
.map-filter-btn {
  width: 44px; height: 44px; border-radius: 14px; background: rgba(255, 255, 255, .95);
  box-shadow: 0 3px 14px rgba(40, 20, 50, .12); border: none; font-size: 11px; font-weight: 600; color: var(--ink-soft); cursor: pointer; font-family: inherit;
}
.off-map-chip {
  position: absolute; left: 16px; top: 112px; z-index: 8; background: rgba(255, 255, 255, .94); border: none;
  border-radius: 999px; padding: 7px 12px; font-size: 10.5px; font-weight: 600; color: #5b5165; cursor: pointer; font-family: inherit;
}

/* 네이버 지도 커스텀 마커 콘텐츠(지도 SDK가 위치를 잡아주므로 여기선 position 지정 안 함) */
.pin-content { display: flex; flex-direction: column; align-items: center; cursor: pointer; font-family: inherit; }
.pin-content .pin-label {
  padding: 4px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700; background: #fff;
  border: 1.5px solid rgba(0, 0, 0, .06); box-shadow: 0 3px 10px rgba(40, 20, 50, .2); white-space: nowrap;
}
.pin-content .pin-stem { width: 2px; height: 6px; margin-top: 1px; }
.pin-content.focused .pin-label { color: #fff; padding: 7px 12px; font-size: 12px; border-color: transparent; }
.pin-content.focused .pin-stem { height: 10px; }

.origin-content { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.origin-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.origin-label { background: var(--ink); color: #fff; font-size: 9.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }

.my-location-content { position: relative; width: 18px; height: 18px; }
.my-location-dot { position: absolute; inset: 3px; border-radius: 50%; background: #3b82f6; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.my-location-pulse { position: absolute; inset: 0; border-radius: 50%; background: rgba(59, 130, 246, .35); animation: my-location-pulse 2s ease-out infinite; }
@keyframes my-location-pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .my-location-pulse { animation: none; opacity: 0; } }

.locate-btn {
  position: absolute; right: 14px; bottom: 232px; z-index: 9; width: 44px; height: 44px; border-radius: 14px;
  background: rgba(255, 255, 255, .95); box-shadow: 0 3px 14px rgba(40, 20, 50, .12); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.locate-icon { width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 50%; position: relative; }
.locate-icon::before { content: ""; position: absolute; inset: -5px; border: 2px solid transparent; border-radius: 50%; }
.locate-btn.locating .locate-icon { border-color: var(--brand); animation: locate-spin 1s linear infinite; }
@keyframes locate-spin { to { transform: rotate(360deg); } }
.locate-status {
  position: absolute; left: 14px; right: 14px; bottom: 282px; z-index: 9; background: rgba(255, 255, 255, .96);
  border-radius: 12px; padding: 8px 12px; font-size: 11px; font-weight: 600; color: var(--ink); box-shadow: 0 3px 14px rgba(40, 20, 50, .12);
}

.map-carousel-wrap { position: absolute; left: 0; right: 0; bottom: 88px; z-index: 9; }
.carousel-header { display: flex; justify-content: space-between; align-items: center; padding: 0 14px 8px; gap: 8px; }
.pill { border-radius: 999px; padding: 5px 11px; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.pill.dark { background: rgba(42, 35, 49, .9); color: #fff; }
.pill.light { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(40, 20, 50, .12); }
.map-carousel { display: flex; gap: 10px; overflow-x: auto; padding: 0 14px; scrollbar-width: none; -ms-overflow-style: none; }
.map-carousel::-webkit-scrollbar { display: none; }
.map-card {
  flex: 0 0 268px; width: 268px; background: #fff; border-radius: 20px; padding: 14px; display: flex; gap: 12px;
  cursor: pointer; border: 2px solid transparent; text-align: left; font-family: inherit; box-shadow: 0 4px 18px rgba(60, 30, 70, .07);
}
.map-card.focused { box-shadow: 0 6px 20px rgba(60, 30, 70, .16); }
.map-card .ex-thumb { width: 60px; height: 60px; border-radius: 14px; flex: 0 0 60px; }
.map-card .mc-title { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.map-card .mc-addr { font-size: 11px; font-weight: 500; color: var(--ink-soft); margin-top: 3px; }
.map-card .mc-time { font-size: 11px; font-weight: 700; margin-top: 4px; }
.map-card .mc-route { display: inline-block; margin-top: 7px; font-size: 10.5px; font-weight: 700; padding: 6px 11px; border-radius: 999px; text-decoration: none; }

/* ---- 저장 탭 ---- */
.page-header { padding: 8px 22px 4px; }
.page-header h1 { font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 4px; }
.page-sub { font-size: 12.5px; font-weight: 500; color: var(--ink-soft); margin: 0; }
.saved-list { padding-top: 14px; }
.saved-card-bottom { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.save-toggle-pill { border: none; border-radius: 999px; padding: 7px 13px; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; font-family: inherit; }
.delete-pill { background: var(--field-bg); color: #b3455f; }
.saved-empty { border: 1px dashed #e0d7e8; border-radius: 18px; padding: 18px; font-size: 12px; font-weight: 500; color: var(--ink-soft2); text-align: center; line-height: 1.6; margin: 4px 22px 0; }
.toast-banner {
  margin: 0 22px 12px; background: var(--field-bg); border-radius: 14px; padding: 11px 14px;
  font-size: 12px; font-weight: 600; color: var(--brand); line-height: 1.5;
}

/* ---- 더보기 탭 ---- */
.more-rows { display: flex; flex-direction: column; gap: 10px; padding: 16px 22px 0; }
.more-row { background: var(--card); border-radius: 16px; padding: 15px 16px; display: flex; justify-content: space-between; align-items: center; }
.more-row span:first-child { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.more-row span:last-child { font-size: 13px; font-weight: 500; color: var(--ink-soft2); }
.more-footnote { font-size: 11px; font-weight: 500; line-height: 1.7; color: var(--ink-soft2); padding: 16px 22px 0; }

.submit-box { margin: 14px 22px 0; background: var(--card); border-radius: 18px; padding: 16px; }
.submit-label { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.submit-desc { font-size: 11.5px; font-weight: 500; color: var(--ink-soft); line-height: 1.6; margin: 0 0 10px; }
.submit-textarea {
  width: 100%; min-height: 84px; border-radius: 12px; border: 1px solid var(--line3); background: var(--field-bg);
  padding: 10px 12px; font-size: 12.5px; font-family: inherit; color: var(--ink); resize: vertical; margin-bottom: 10px;
}
.submit-textarea::placeholder { color: var(--ink-soft2); }
.submit-cta { background: var(--brand); margin-bottom: 0; }
.submit-status { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); margin: 10px 0 0; line-height: 1.6; }

/* ---- 전시 상세 바텀시트 ---- */
.sheet-overlay { position: fixed; inset: 0; background: rgba(30, 20, 35, .45); display: flex; align-items: flex-end; z-index: 50; }
.sheet-overlay[hidden] { display: none; }
.sheet {
  background: var(--card); width: 100%; max-width: 480px; margin: 0 auto; max-height: 80%; overflow-y: auto;
  border-radius: 26px 26px 0 0; padding: 20px 22px 30px; position: relative; animation: sheet-up .18s ease-out;
}
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.sheet-handle { width: 38px; height: 4px; background: #e6dcec; border-radius: 4px; margin: 0 auto 16px; }
.sheet-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.chip { border-radius: 999px; padding: 5px 11px; font-size: 11px; font-weight: 700; }
.sheet-title { font-size: 21px; font-weight: 700; line-height: 1.35; letter-spacing: -.02em; margin: 0 0 4px; text-wrap: pretty; }
.sheet-artist { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 0 0 4px; }
.sheet-period { font-size: 13px; font-weight: 500; color: var(--ink-soft); margin: 0 0 14px; }
.sheet-image {
  height: 150px; border-radius: 18px; margin-bottom: 14px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.sheet-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sheet-image .placeholder-label { font-size: 13px; font-weight: 600; opacity: .85; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.sheet-grid .box { background: var(--field-bg); border-radius: 14px; padding: 12px; }
.sheet-grid .box .lbl { font-size: 10px; font-weight: 700; color: var(--ink-soft2); letter-spacing: .04em; margin-bottom: 4px; text-transform: uppercase; }
.sheet-grid .box .val { font-size: 12.5px; font-weight: 500; line-height: 1.5; color: var(--ink); }
.sheet-grid .admission-box { grid-column: 1 / -1; }
.sheet-address { font-size: 12.5px; font-weight: 500; line-height: 1.55; color: var(--ink-soft); margin: -6px 0 14px; }
.sheet-section { margin-bottom: 16px; }
.sheet-section .sec-label { font-size: 10px; font-weight: 700; color: var(--ink-soft2); letter-spacing: .04em; margin-bottom: 8px; text-transform: uppercase; }
.point-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.point-list li { font-size: 13px; font-weight: 500; line-height: 1.55; color: #4a4053; padding-left: 16px; position: relative; }
.point-list li::before { content: "—"; position: absolute; left: 0; color: var(--card-color, var(--brand)); }
.sheet-para { font-size: 13px; font-weight: 500; line-height: 1.6; color: #4a4053; margin: 0; }
.sheet-video-title { font-size: 12.5px; font-weight: 600; color: #4a4053; line-height: 1.5; margin-bottom: 10px; }
.sheet-cta {
  display: block; width: 100%; padding: 14px; border-radius: 16px; color: #fff; font-size: 14px; font-weight: 700;
  text-align: center; text-decoration: none; border: none; cursor: pointer; font-family: inherit; margin-bottom: 10px;
}
.sheet-cta.secondary { background: var(--field-bg) !important; color: var(--ink) !important; margin-bottom: 0; }

@keyframes sheet-up { from { transform: translateY(16px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }

/* ---- 하단 탭바 ---- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; height: 76px; padding-bottom: 10px;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); z-index: 15; display: grid; grid-template-columns: repeat(4, 1fr);
}
.tab-btn { background: none; border: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer; color: var(--icon-inactive); font-family: inherit; }
.tab-btn.active { color: var(--brand); }
.tab-icon { width: 20px; height: 20px; }
.icon-cal { border: 2px solid currentColor; border-radius: 6px; }
.icon-map { border: 2px solid currentColor; border-radius: 50%; }
.icon-saved { width: 16px; border: 2px solid currentColor; border-radius: 4px; }
.icon-more { border: 2px dashed currentColor; border-radius: 50%; }
.tab-label { font-size: 10px; font-weight: 600; }
