/* ============================================================
   콘크리트 사피엔스 지도 — Concrete Archive 디자인 시스템
   Design Spec v1.0 / v0.2 반영
   ============================================================ */

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

:root {
  --cs-black: #2F3031;
  --cs-paper: #F4F3EF;
  --cs-gray: #B9B9B5;
  --cs-map-gray: #E5E4DF;
  --cs-orange: #FF5A36;

  --cs-text-main: #2F3031;
  --cs-text-muted: #777875;

  --cs-radius-card: 6px;
  --cs-radius-sheet: 22px;
  --cs-radius-chip: 999px;

  --cs-transition-fast: 180ms;
  --cs-transition-normal: 280ms;

  --font-serif: "Noto Serif KR", serif;
  --font-sans: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
  color: var(--cs-text-main);
  background: var(--cs-map-gray);
  overflow: hidden;
}

/* ------------------------------------------------------------
   레이아웃 뼈대 / 레이어 구조
   Layer 1 Kakao Map / Layer 2 DIM / Layer 3 Dot
   Layer 4 Controls / Layer 5 Bottom Sheet / Layer 6 Global UI
   ------------------------------------------------------------ */
#app {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#map {
  width: 100%;
  height: 100%;
  background: var(--cs-map-gray);
}

.map-dim-layer {
  position: absolute;
  inset: 0;
  background: var(--cs-black);
  opacity: 0.2;
  pointer-events: none;
  z-index: 5;
}

/* 지도를 클릭했을 때 "도장 찍힌" 느낌을 주는 짧은 링 애니메이션 */
.click-stamp {
  position: fixed;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--cs-orange);
  background: rgba(255, 90, 54, 0.22);
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0.9;
  pointer-events: none;
  z-index: 15;
  animation: stampPulse 480ms ease-out forwards;
}

@keyframes stampPulse {
  to {
    transform: translate(-50%, -50%) scale(2.3);
    opacity: 0;
  }
}

/* ------------------------------------------------------------
   상단 오버레이 래퍼 — 이 안의 요소들은 절대 위치가 아니라 세로로
   자연스럽게 쌓인다. 해시태그가 여러 줄로 줄바꿈되면 그 아래
   배너/슬라이더가 자동으로 밀려 내려간다.
   ------------------------------------------------------------ */
.map-overlay-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  pointer-events: none;
}

.map-overlay-top > * {
  pointer-events: auto;
}

.top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wordmark {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--cs-black);
  text-transform: uppercase;
  pointer-events: auto;
  white-space: nowrap;
}

.wordmark small {
  display: block;
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--cs-orange);
  margin-top: 1px;
}

.search-box {
  flex: 1;
  max-width: 380px;
  position: relative;
  pointer-events: auto;
}

.search-input-row {
  display: flex;
  background: rgba(244, 243, 239, 0.92);
  border: 1px solid var(--cs-gray);
  border-radius: var(--cs-radius-chip);
  overflow: hidden;
}

#search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 16px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--cs-text-main);
  outline: none;
}

#search-input::placeholder {
  color: var(--cs-text-muted);
}

#search-btn {
  border: none;
  background: transparent;
  color: var(--cs-black);
  padding: 0 16px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}

.search-results {
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  background: var(--cs-paper);
  border: 1px solid var(--cs-gray);
  border-radius: var(--cs-radius-card);
  max-height: 300px;
  overflow-y: auto;
}

.search-result-item {
  padding: 9px 11px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-item:hover {
  background: var(--cs-map-gray);
}

.search-result-item strong {
  font-size: 13px;
  font-weight: 500;
}

.search-result-item span {
  font-size: 11px;
  color: var(--cs-text-muted);
}

.search-empty {
  padding: 9px 11px;
  font-size: 12px;
  color: var(--cs-text-muted);
}

/* ------------------------------------------------------------
   계정 아바타 / GNB
   ------------------------------------------------------------ */
.account-menu-wrap {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

.account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgb(48, 47, 49);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--cs-gray);
  border-radius: var(--cs-radius-card);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 30;
}

.account-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--cs-text-main);
  border-radius: 4px;
  cursor: pointer;
}

.account-menu-item:hover {
  background: var(--cs-map-gray);
}

.account-menu-item--danger {
  color: var(--cs-orange);
}

.account-menu-divider {
  height: 1px;
  background: var(--cs-map-gray);
  margin: 6px 4px;
}

/* ------------------------------------------------------------
   해시태그 칩
   ------------------------------------------------------------ */
.hashtag-bar {
  width: 100%;
  display: flex;
  column-gap: 6px;
  row-gap: 4px;
  flex-wrap: wrap;
  pointer-events: none;
}

.chip {
  pointer-events: auto;
  flex-shrink: 0;
  background: rgba(244, 243, 239, 0.92);
  border: 1px solid var(--cs-gray);
  color: var(--cs-text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--cs-radius-chip);
  cursor: pointer;
  transition: background var(--cs-transition-fast);
}

.chip--active {
  background: var(--cs-black);
  color: var(--cs-orange);
  border-color: var(--cs-black);
}

.chip--today {
  background: var(--cs-orange);
  color: var(--cs-paper);
  border-color: var(--cs-orange);
  font-weight: 500;
}

/* ------------------------------------------------------------
   활성 필터(해시태그/연도) 집단 기억 숫자 배너
   ------------------------------------------------------------ */
.filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 100%;
  background: var(--cs-black);
  color: var(--cs-paper);
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: var(--cs-radius-chip);
}

.filter-banner-clear {
  border: none;
  background: none;
  color: var(--cs-gray);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.filter-banner-clear:hover {
  color: var(--cs-paper);
}

/* ------------------------------------------------------------
   전체 등록된 기억 수 ("오늘의 기억" 칩 아래, 검정 텍스트)
   ------------------------------------------------------------ */
.total-count-banner {
  font-size: 13px;
  font-weight: 600;
  color: var(--cs-black);
  background: rgba(244, 243, 239, 0.92);
  padding: 6px 13px;
  border-radius: var(--cs-radius-chip);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.total-count-banner:hover {
  background: var(--cs-paper);
}

/* ------------------------------------------------------------
   시간 슬라이더 (누적 보기)
   ------------------------------------------------------------ */
.time-slider-panel {
  width: min(66%, 420px);
  align-self: center;
  background: var(--cs-paper);
  border: 1px solid var(--cs-gray);
  border-radius: var(--cs-radius-card);
  padding: 10px 16px 14px;
}

.time-slider-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.time-slider-close {
  border: none;
  background: none;
  color: var(--cs-text-muted);
  font-size: 14px;
  cursor: pointer;
}

.time-slider-input {
  width: 100%;
  accent-color: var(--cs-orange);
}

/* ------------------------------------------------------------
   최초 진입 안내 칩 / Toast
   ------------------------------------------------------------ */
.entry-toast,
.share-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cs-black);
  color: var(--cs-paper);
  font-size: 12.5px;
  padding: 10px 18px;
  border-radius: var(--cs-radius-card);
  z-index: 60;
  opacity: 0;
  transition: opacity var(--cs-transition-normal);
  pointer-events: none;
  white-space: nowrap;
}

.entry-toast {
  top: 64px;
}

.share-toast {
  bottom: 100px;
}

.entry-toast.show,
.share-toast.show {
  opacity: 1;
}

/* ------------------------------------------------------------
   Map Controls (하단)
   ------------------------------------------------------------ */
.bottom-toolbar {
  position: absolute;
  bottom: 20px;
  left: 16px;
  z-index: 20;
  display: flex;
  gap: 8px;
}

.tool-btn {
  border: 1px solid var(--cs-gray);
  background: rgba(244, 243, 239, 0.92);
  color: var(--cs-black);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 9px 16px;
  border-radius: var(--cs-radius-chip);
  cursor: pointer;
  transition: background var(--cs-transition-fast);
}

.tool-btn:hover {
  background: var(--cs-paper);
}

.tool-btn--accent {
  background: var(--cs-black);
  color: var(--cs-paper);
  border-color: var(--cs-black);
}

.tool-btn--accent:hover {
  background: #1c1d1e;
}

.fab-add {
  position: absolute;
  bottom: 20px;
  right: 16px;
  z-index: 20;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--cs-black);
  color: var(--cs-paper);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-add:hover {
  background: #1c1d1e;
}

/* ------------------------------------------------------------
   Memory Dot 마커 (kakao MarkerImage / CustomOverlay에서 참조하는
   시각 스펙 문서화용 — 실제 렌더는 app.js에서 SVG data URI로 생성)
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   오버레이 공통 (작성 폼)
   ------------------------------------------------------------ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(47, 48, 49, 0.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.overlay.hidden {
  display: none;
}

.composer-card {
  width: 100%;
  max-width: 420px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--cs-paper);
  border-radius: var(--cs-radius-sheet) var(--cs-radius-sheet) var(--cs-radius-sheet) var(--cs-radius-sheet);
  padding: 24px 22px 22px;
  position: relative;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08);
}

/* ------------------------------------------------------------
   Bottom Sheet (이야기 열람)
   ------------------------------------------------------------ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: transparent;
}

.sheet-backdrop.hidden {
  display: none;
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 91;
  background: var(--cs-paper);
  border-radius: var(--cs-radius-sheet) var(--cs-radius-sheet) 0 0;
  max-height: 65vh;
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08);
  transition: transform var(--cs-transition-normal) ease;
}

.bottom-sheet.hidden {
  transform: translateY(110%);
}

.sheet-handle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px 0 4px;
  flex-shrink: 0;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--cs-gray);
}

.sheet-close {
  position: absolute;
  right: 14px;
  top: 6px;
  width: 32px;
  height: 32px;
  min-width: 44px;
  min-height: 44px;
  margin: -6px -6px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--cs-text-muted);
  font-size: 18px;
  cursor: pointer;
}

.sheet-close:hover {
  color: var(--cs-black);
}

.sheet-scroll {
  overflow-y: auto;
  padding: 4px 24px 28px;
}

/* ------------------------------------------------------------
   Story 헤더 — 연도 중심 타이포그래피
   ------------------------------------------------------------ */
.story-spot-header {
  padding-right: 32px;
  margin-bottom: 4px;
}

.story-spot-count {
  display: block;
  font-size: 11.5px;
  color: var(--cs-text-muted);
  margin-top: 4px;
}

.story-custom-name {
  font-size: 12.5px;
  color: var(--cs-text-muted);
  margin: 0 0 16px;
  font-style: italic;
}

.story-spot-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
}

.sort-toggle {
  display: flex;
  gap: 6px;
  margin: 10px 0 46px;
}

.sort-btn {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: var(--cs-radius-chip);
  border: 1px solid var(--cs-gray);
  background: transparent;
  color: var(--cs-text-muted);
  cursor: pointer;
}

.sort-btn--active {
  background: var(--cs-black);
  color: var(--cs-paper);
  border-color: var(--cs-black);
}

.story-list {
  display: flex;
  flex-direction: column;
}

.story-item {
  padding: 24px 0;
  border-top: 1px solid var(--cs-map-gray);
}

.story-item:first-child {
  border-top: none;
  padding-top: 0;
}

/* ------------------------------------------------------------
   Story 아이템 상단 메뉴 (··· 신고 드롭다운)
   ------------------------------------------------------------ */
.story-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.story-item-menu {
  position: relative;
}

.story-item-menu-btn {
  border: none;
  background: none;
  color: var(--cs-text-muted);
  font-size: 16px;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 4px 8px;
}

.story-item-menu-btn:hover {
  color: var(--cs-black);
}

.story-item-menu-dropdown {
  position: absolute;
  right: 0;
  top: 30px;
  background: var(--cs-paper);
  border: 1px solid var(--cs-gray);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(47, 48, 49, 0.14);
  z-index: 5;
  white-space: nowrap;
  overflow: hidden;
}

.story-item-menu-dropdown.hidden {
  display: none;
}

.story-item-menu-dropdown .report-link {
  display: block;
  padding: 11px 16px;
  font-size: 12.5px;
  margin: 0;
  color: var(--cs-text-muted);
}

.story-item-menu-dropdown .report-link:hover {
  background: var(--cs-map-gray);
  color: var(--cs-orange);
}

/* ------------------------------------------------------------
   공감 / 전달 — 50:50 분할 행
   ------------------------------------------------------------ */
.action-row-split {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.action-row-split .reaction-btn,
.action-row-split .share-btn {
  flex: 1;
  justify-content: center;
  border: 1px solid var(--cs-gray);
  border-radius: var(--cs-radius-card);
  padding: 11px 0;
  font-size: 13px;
  margin: 0;
}

.action-row-split .share-btn {
  color: var(--cs-black);
  font-weight: 500;
  border-color: var(--cs-black);
}

.action-row-split .share-btn:hover {
  background: var(--cs-black);
  color: var(--cs-paper);
}

.action-row-split .reaction-btn--active {
  border-color: var(--cs-orange);
  color: var(--cs-orange);
}

/* ------------------------------------------------------------
   날짜 블록 — 연도는 "정보"가 아니라 이 기억의 표지(cover) 역할을
   하는 시각적 오브젝트다. YYYY년 MM월 형식의 일반적인 날짜 UI로
   디자인하지 않는다. "년"은 표기하지 않으며, 연도(76px)와
   월(24px)은 약 3:1 비율로 배치한 좌측 정렬 2단 구조다. 연도-월
   간격은 6~8px로 밀착시켜 하나의 "날짜 덩어리"로 인식시키고,
   날짜 블록과 본문 사이는 34px로 분리해 "날짜"와 "이야기"를
   시각적으로 확실히 나눈다. ···(신고) 메뉴는 이 블록에 절대
   두지 않는다 — 작성자 줄로 옮겨서 날짜 영역의 순수성을 지킨다.
   ------------------------------------------------------------ */
.story-date-block {
  margin: 0 0 34px;
  text-align: left;
}

.story-year {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 74px;
  line-height: 0.92;
  letter-spacing: -2.5px;
  color: var(--cs-black);
  margin: 0;
}

.story-month {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: -0.3px;
  color: #777775;
  margin: 7px 0 0;
}

@media (max-width: 420px) {
  .story-year {
    font-size: 58px;
    letter-spacing: -2px;
  }
  .story-month {
    font-size: 18px;
  }
}

.story-eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--cs-text-muted);
  text-transform: uppercase;
  margin: 4px 0 14px;
}

.story-place-line {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--cs-text-main);
  margin: 4px 0 16px;
}

.story-content {
  margin: 0 0 16px;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--cs-text-main);
  white-space: pre-wrap;
}

.story-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hashtag-link {
  border: none;
  background: none;
  color: var(--cs-text-muted);
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
}

.hashtag-link:hover {
  color: var(--cs-orange);
}

.story-author {
  font-size: 12px;
  color: var(--cs-text-muted);
  margin: 0;
}

.story-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reaction-btn,
.share-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  padding: 0;
  font-size: 13.5px;
  color: var(--cs-text-main);
  cursor: pointer;
  text-align: left;
}

.reaction-btn .dot-icon {
  font-size: 13px;
}

.reaction-btn--active {
  color: var(--cs-orange);
}

.reaction-btn--active .dot-icon {
  color: var(--cs-orange);
}

.share-btn {
  color: var(--cs-text-muted);
}

.share-btn:hover {
  color: var(--cs-black);
}

.report-link {
  align-self: flex-start;
  border: none;
  background: none;
  font-size: 11px;
  color: var(--cs-gray);
  cursor: pointer;
  padding: 0;
  margin-top: 4px;
}

.report-link:hover {
  color: var(--cs-orange);
}

.year-explore-link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-top: 1px solid var(--cs-map-gray);
  border-radius: 0;
  outline: none;
  background: none;
  font-family: var(--font-sans);
  color: var(--cs-text-muted);
  font-size: 12.5px;
  cursor: pointer;
  padding: 14px 0 0;
  margin: 0;
  text-align: left;
}

.year-explore-link:hover {
  color: var(--cs-orange);
}

.share-btn--emphasized {
  font-weight: 500;
  color: var(--cs-black);
}

/* ------------------------------------------------------------
   장소의 시간연대표
   ------------------------------------------------------------ */
.spot-timeline-toggle {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  color: var(--cs-text-muted);
  font-size: 12.5px;
  cursor: pointer;
  padding: 10px 0;
  border-top: 1px solid var(--cs-map-gray);
  margin-top: 8px;
}

.spot-timeline-toggle:hover {
  color: var(--cs-black);
}

.spot-timeline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0 16px;
}

.timeline-pill {
  border: 1px solid var(--cs-gray);
  background: #fff;
  color: var(--cs-text-muted);
  font-size: 12px;
  padding: 6px 13px;
  border-radius: var(--cs-radius-chip);
  cursor: pointer;
}

.timeline-pill--active {
  background: var(--cs-black);
  color: var(--cs-paper);
  border-color: var(--cs-black);
}

.btn-add-story {
  width: 100%;
  margin-top: 20px;
}

/* ------------------------------------------------------------
   작성 폼
   ------------------------------------------------------------ */
.composer-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 20px;
}

.field-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cs-text-muted);
  margin: 18px 0 6px;
}

.field-label:first-of-type {
  margin-top: 0;
}

.field-value {
  font-size: 15px;
  padding: 8px 0;
  border-bottom: 1px solid var(--cs-map-gray);
}

.field-address {
  font-size: 12px;
  color: var(--cs-text-muted);
  margin-top: 6px;
}

.story-spot-address {
  font-size: 11.5px;
  color: var(--cs-text-muted);
  margin-top: 2px;
}

.input-field {
  width: 100%;
  border: 1px solid var(--cs-gray);
  border-radius: var(--cs-radius-card);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--cs-text-main);
  background: #fff;
  outline: none;
}

.input-field:focus {
  border-color: var(--cs-black);
}

.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.75;
}

.char-count {
  text-align: right;
  font-size: 11px;
  color: var(--cs-text-muted);
  margin-top: 4px;
}

.field-hint {
  font-size: 11.5px;
  color: var(--cs-text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ------------------------------------------------------------
   회원가입 / 로그인
   ------------------------------------------------------------ */
.auth-error {
  color: var(--cs-orange);
  font-size: 12.5px;
  margin: 10px 0 0;
  line-height: 1.5;
}

.auth-switch {
  text-align: center;
  font-size: 12.5px;
  color: var(--cs-text-muted);
  margin: 16px 0 0;
}

.auth-switch-link {
  border: none;
  background: none;
  color: var(--cs-black);
  font-size: 12.5px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* ------------------------------------------------------------
   최근 기억 목록 모달
   ------------------------------------------------------------ */
.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.recent-close {
  border: none;
  background: none;
  color: var(--cs-text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.recent-close:hover {
  color: var(--cs-black);
}

.recent-empty {
  font-size: 13.5px;
  color: var(--cs-text-muted);
  text-align: center;
  padding: 24px 0;
}

.recent-item {
  padding: 16px 0;
  border-top: 1px solid var(--cs-map-gray);
}

.recent-item:first-child {
  border-top: none;
  padding-top: 0;
}

.recent-item-year {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--cs-text-muted);
  margin: 0 0 4px;
}

.recent-item-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--cs-text-main);
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-item-place {
  font-size: 12px;
  color: var(--cs-text-muted);
  margin: 0 0 10px;
}

.recent-goto-btn {
  border: 1px solid var(--cs-black);
  background: none;
  color: var(--cs-black);
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: var(--cs-radius-card);
  cursor: pointer;
}

.recent-goto-btn:hover {
  background: var(--cs-black);
  color: var(--cs-paper);
}

.recent-goto-btn--visited {
  border-color: var(--cs-gray);
  color: var(--cs-text-muted);
}

.backup-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--cs-map-gray);
}

.backup-link {
  border: none;
  background: none;
  color: var(--cs-text-muted);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  padding: 2px 0;
}

.backup-link:hover {
  color: var(--cs-black);
}

.date-mode-toggle,
.author-mode-toggle {
  display: flex;
  gap: 6px;
}

.mode-btn {
  flex: 1;
  font-size: 13px;
  padding: 9px 0;
  border-radius: var(--cs-radius-card);
  border: 1px solid var(--cs-gray);
  background: #fff;
  color: var(--cs-text-muted);
  cursor: pointer;
}

.mode-btn--active {
  background: var(--cs-black);
  color: var(--cs-paper);
  border-color: var(--cs-black);
}

.btn-primary {
  width: 100%;
  margin-top: 24px;
  padding: 13px;
  border: none;
  border-radius: var(--cs-radius-card);
  background: var(--cs-orange);
  color: var(--cs-paper);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--cs-transition-fast);
}

.btn-primary:hover {
  background: #e64f2d;
}

.btn-secondary {
  width: 100%;
  margin-top: 8px;
  padding: 11px;
  border: none;
  background: transparent;
  color: var(--cs-text-muted);
  font-size: 13px;
  cursor: pointer;
}

.btn-secondary:hover {
  color: var(--cs-black);
}

.hidden {
  display: none !important;
}

/* ------------------------------------------------------------
   년/월 선택 (기억나지 않음/과거)
   ------------------------------------------------------------ */
.year-month-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.year-month-row select {
  flex: 1;
  border: 1px solid var(--cs-gray);
  border-radius: var(--cs-radius-card);
  padding: 9px 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  background: #fff;
  color: var(--cs-text-main);
}

/* ------------------------------------------------------------
   오늘의 질문
   ------------------------------------------------------------ */
.chip--prompt {
  background: transparent;
  border: 1px dashed var(--cs-gray);
}

/* ------------------------------------------------------------
   시간여행순 - 시점을 알 수 없는 기억들 소제목
   ------------------------------------------------------------ */
.timeline-section-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cs-text-muted);
  padding: 18px 0 8px;
  border-top: 1px solid var(--cs-map-gray);
  margin-top: 8px;
}

.timeline-section-label:first-child {
  border-top: none;
  margin-top: 0;
}

/* ------------------------------------------------------------
   빈 상태 / 삭제된 기억
   ------------------------------------------------------------ */
.empty-state-content,
.gone-state-content {
  text-align: center;
  padding: 8px 0 20px;
}

.empty-state-content p,
.gone-state-content p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--cs-text-muted);
  margin: 0 0 18px;
}

/* ------------------------------------------------------------
   API 키 미설정 경고
   ------------------------------------------------------------ */
#key-warning {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--cs-black);
  color: var(--cs-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

#key-warning .box {
  max-width: 480px;
}

#key-warning h1 {
  font-family: var(--font-serif);
  font-size: 22px;
}

#key-warning code {
  display: block;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.08);
  padding: 12px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
  text-align: left;
}

/* ------------------------------------------------------------
   반응형 (모바일)
   ------------------------------------------------------------ */
@media (max-width: 600px) {
  .search-box {
    max-width: none;
  }
  .composer-card {
    max-width: 100%;
  }
}

/* ------------------------------------------------------------
   데스크톱: Bottom Sheet를 화면 중앙의 작은 카드로 표시
   ------------------------------------------------------------ */
@media (min-width: 768px) {
  .sheet-backdrop:not(.hidden) {
    background: rgba(47, 48, 49, 0.35);
  }

  .bottom-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(420px, 90vw);
    max-height: 72vh;
    min-height: 0;
    border-radius: var(--cs-radius-sheet);
    transform: translate(-50%, -50%);
  }

  .bottom-sheet.hidden {
    transform: translate(-50%, -50%) scale(0.96);
    opacity: 0;
    pointer-events: none;
  }
}
