:root {
    --navy:   #1b2e4b;
    --ocean:  #2563a8;
    --sky:    #e8f4fd;
    --white:  #ffffff;
    --sand:   #faf7f2;
    --amber:  #f59e0b;
    --teal:   #0d9488;
    --gray1:  #f1f5f9;
    --gray2:  #e2e8f0;
    --gray3:  #94a3b8;
    --gray4:  #475569;
    --text:   #1e293b;
    --shadow: 0 4px 24px rgba(27,46,75,0.13);
    --shadow-lg: 0 8px 40px rgba(27,46,75,0.18);
    --radius: 12px;
    --panel-w: 320px;
    --header-h: 56px;
    --font-sans: 'Noto Sans KR', sans-serif;
    --font-serif: 'Noto Serif KR', serif;
  }
  

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { width: 100%; height: 100%; overflow: hidden; font-family: var(--font-sans); color: var(--text); word-break: keep-all; overflow-wrap: break-word; }
  /* ── HEADER ── */
  #header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--gray2);
    display: flex; align-items: center;
    padding: 0 1.5rem;
    gap: 1.5rem;
    box-shadow: 0 2px 8px rgba(27,46,75,0.07);
  }
  .logo {
    display: flex; align-items: center; gap: .55rem;
    font-family: var(--font-serif);
    font-size: 1.1rem; font-weight: 900;
    color: var(--navy); white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
  }
  .logo-beacon {
    width: 28px; height: 28px;
    background: var(--navy);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
    position: relative;
  }
  .logo-beacon::after {
    content: '';
    position: absolute; top: -3px; left: 50%; transform: translateX(-50%);
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 0 0 var(--amber);
    animation: beacon-pulse 2s ease-out infinite;
  }
  @keyframes beacon-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(245,158,11,.7); }
    70%  { box-shadow: 0 0 0 8px rgba(245,158,11,0); }
    100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
  }

  /* search bar */
  .header-search {
    flex: 1; max-width: 280px;
    display: flex; align-items: center;
    background: var(--gray1); border: 1.5px solid var(--gray2);
    border-radius: 8px; padding: 0 .75rem; gap: .5rem;
    transition: border-color .2s;
  }
  .header-search:focus-within { border-color: var(--ocean); background: var(--white); }
  .header-search input {
    border: none; background: none; outline: none;
    font-family: var(--font-sans); font-size: .83rem; color: var(--text);
    width: 100%; padding: .5rem 0;
  }
  .header-search input::placeholder { color: var(--gray3); }
  .search-icon { color: var(--gray3); font-size: .9rem; flex-shrink: 0; }

  /* nav */
  nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
  nav a {
    padding: .4rem .85rem;
    font-size: .8rem; font-weight: 500;
    color: var(--gray4); text-decoration: none;
    border-radius: 6px;
    transition: background .15s, color .15s;
    white-space: nowrap;
  }
  nav a:hover { background: var(--gray1); color: var(--navy); }
  nav a.active { background: var(--navy); color: var(--white); }

  /* ── LAYOUT ── */
  #app {
    position: fixed;
    top: var(--header-h); left: 0; right: 0; bottom: 0;
    display: flex;
  }

  /* ── LEFT PANEL  ── */
  #panel {
    width: var(--panel-w);
    flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid var(--gray2);
    display: flex; flex-direction: column;
    overflow-y: auto;
    z-index: 100;
  }
  .panel-section {
    padding: 1rem 1.1rem;
    flex: 1;
    overflow-y: auto;
  }
  .panel-section-title {
    font-size: .7rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--gray3); margin-bottom: .7rem;
  }

  /* filter checkboxes */
  .filter-list { display: flex; flex-direction: column; gap: .4rem; }
  .filter-item {
    display: flex; align-items: center; gap: .55rem;
    padding: .45rem .6rem; border-radius: 7px;
    cursor: pointer;
    transition: background .15s;
    font-size: .83rem; color: var(--gray4);
    user-select: none;
  }
  .filter-item:hover { background: var(--gray1); }
  .filter-item input[type="checkbox"] { display: none; }
  .filter-check {
    width: 17px; height: 17px; border-radius: 4px;
    border: 2px solid var(--gray2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: .65rem; color: transparent;
    transition: all .15s; background: var(--white);
  }
  .filter-item.checked .filter-check {
    background: var(--navy); border-color: var(--navy); color: var(--white);
  }
  .filter-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  }
  .lh-item {
    display: flex; align-items: center; gap: .8rem;
    padding: .7rem 1.1rem;
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid var(--gray1);
  }
  .lh-item:hover { background: var(--sky); }
  .lh-item.active { background: var(--sky); }
  .lh-rank {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--gray1); color: var(--gray3);
    font-size: .7rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .lh-item.active .lh-rank { background: var(--navy); color: var(--white); }
  .lh-thumb {
    width: 38px; height: 38px; border-radius: 8px;
    object-fit: cover; flex-shrink: 0;
    background: var(--gray1);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    overflow: hidden;
  }
  .lh-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .lh-info { flex: 1; min-width: 0; }
  .lh-name { font-size: .85rem; font-weight: 700; color: var(--navy); }
  .lh-loc  { font-size: .73rem; color: var(--gray3); margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lh-tags {
    display: flex; flex-direction: column;
    gap: .2rem; flex-shrink: 0;
  }
  .lh-tag  {
    font-size: .65rem; padding: .15rem .45rem;
    border-radius: 4px; font-weight: 600; white-space: nowrap;
  }
  .tag-stamp { background: #fef3c7; color: #92400e; }
  .tag-month { background: #dbeafe; color: #1e40af; }
  .tag-year  { background: #d1fae5; color: #065f46; }

  /* ── MAP ── */
  #map-wrap {
    flex: 1; position: relative; overflow: hidden;
    background: #d4e6f1;
  }
  #map-container {
    width: 100%; height: 100%;
    background: linear-gradient(145deg, #c8dff0 0%, #b8d4e8 40%, #a8c9e0 100%);
    position: relative; overflow: hidden;
  }

  /* fake map background grid */
  #map-container::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
    background-size: 60px 60px;
  }
  /* fake coastline */
  .map-coast {
    position: absolute; inset: 0; pointer-events: none;
  }

  /* map controls */
  .map-controls {
  position: absolute;
  top: 10px;
  right: 16px;

  display: flex;
  flex-direction: column;
  gap: .4rem;

  z-index: 60;
  }
  .map-ctrl-btn {
    width: 44px; height: 44px;
    background: var(--white); border: none;
    border-radius: 8px; box-shadow: var(--shadow);
    font-size: 1.25rem; cursor: pointer; color: var(--gray4);
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
  }
  .map-ctrl-btn:hover { background: var(--navy); color: var(--white); }
  .map-ctrl-btn.layer-btn {
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
  }
  .map-ctrl-btn.active { background: var(--navy); color: var(--white); }
  /* layer toggle */
  .map-layer-btn {
    position: absolute; right: 1rem; bottom: 3rem;
    background: var(--white); border: none;
    border-radius: 8px; box-shadow: var(--shadow);
    padding: .4rem .7rem;
    font-size: .72rem; font-weight: 600; color: var(--gray4);
    cursor: pointer; display: flex; align-items: center; gap: .35rem;
    transition: background .15s;
  }
  .map-layer-btn:hover { background: var(--gray1); }

  /* map attribution */
  .map-attr {
    position: absolute; bottom: .5rem; right: .5rem;
    font-size: .6rem; color: var(--gray3);
    background: rgba(255,255,255,.75); padding: .15rem .4rem; border-radius: 3px;
  }

  /* ── MARKERS ── */
  .marker {
    position: absolute;
    transform: translate(-50%, -100%);
    cursor: pointer;
    z-index: 5;
    display: flex; flex-direction: column; align-items: center;
    transition: filter .15s, transform .15s;
    filter: drop-shadow(0 2px 6px rgba(27,46,75,.25));
  }
  .marker:hover { transform: translate(-50%, -100%) scale(1.15); filter: drop-shadow(0 4px 12px rgba(27,46,75,.35)); }
  .marker.active { transform: translate(-50%, -100%) scale(1.2); z-index: 8; }
  .marker-pin {
    width: 36px; height: 36px; border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex; align-items: center; justify-content: center;
    border: 2.5px solid var(--white);
  }
  .marker-pin span { transform: rotate(45deg); font-size: .95rem; }
  .marker-label {
    margin-top: 4px;
    background: var(--white); color: var(--navy);
    font-size: .65rem; font-weight: 700;
    padding: .15rem .45rem; border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
    opacity: 0; transition: opacity .2s;
    pointer-events: none;
  }
  .marker:hover .marker-label,
  .marker.active .marker-label { opacity: 1; }

  /* ── POPUP ── */
  #popup {
    position: absolute;
    top: 80px;
    right: 64px;
    width: 320px;
    max-height: calc(100% - 2rem);
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    overflow-y: auto;
    display: none;
    animation: popup-in .25s cubic-bezier(.34,1.56,.64,1) both;
  }
  #popup.visible { display: block; }

  @media (max-width: 768px) {
    #popup {
      position: fixed;
      top: auto;
      bottom: 70px;
      left: 0; right: 0;
      width: 100%;
      max-height: 60vh;
      border-radius: var(--radius) var(--radius) 0 0;
      animation: popup-up .25s cubic-bezier(.34,1.56,.64,1) both;
    }
  }
  @keyframes popup-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes popup-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
  }
  .popup-img {
    width: 100%; height: 158px; object-fit: cover;
    background: linear-gradient(135deg, var(--sky), var(--gray2));
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: var(--gray3);
    position: relative; overflow: hidden;
  }
  .popup-img img { width: 100%; height: 100%; object-fit: cover; }
  .popup-img-placeholder { font-size: 3.5rem; }
  .popup-close {
    position: absolute; top: .5rem; right: .5rem;
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(0,0,0,.35); color: var(--white);
    border: none; cursor: pointer; font-size: .85rem;
    display: flex; align-items: center; justify-content: center;
    z-index: 2; transition: background .15s;
  }
  .popup-close:hover { background: rgba(0,0,0,.6); }
  .popup-body { padding: 1rem 1.1rem; }
  .popup-name {
  font-family: var(--font-serif);
  font-size: 1.05rem; font-weight: 900; color: var(--navy);
  margin-bottom: .25rem;
  cursor: pointer;
  transition: color .15s;
}

.popup-header-link:hover .popup-name {
  text-decoration: underline;
  text-decoration-color: #cbd5e1;
  text-underline-offset: 4px;
  color: var(--ocean);
}

.popup-header-link {
  display: block;
  cursor: pointer;
  text-decoration: none;
}
  .popup-meta {
    display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem;
  }
  .popup-badge {
    font-size: .68rem; padding: .18rem .5rem; border-radius: 5px; font-weight: 600;
  }
  .popup-divider { height: 1px; background: var(--gray2); margin-bottom: .9rem; }

  /* direction buttons */
  .dir-buttons { display: flex; gap: .5rem; margin-bottom: .8rem; }
  .dir-btn {
    flex: 1; padding: .55rem .5rem;
    border: none; border-radius: 8px;
    font-family: var(--font-sans); font-size: .75rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .35rem;
    transition: opacity .15s, transform .1s;
  }
  .dir-btn:hover { opacity: .88; transform: translateY(-1px); }
  .dir-btn:active { transform: translateY(0); }
  .dir-naver { background: #03c75a; color: var(--white); }
  .dir-kakao { background: #fee500; color: #3c1e1e; }
  .dir-btn-icon { font-size: .85rem; }

  /* ferry mini */
  .popup-ferry-title {
    font-size: .7rem; font-weight: 700; color: var(--gray3);
    letter-spacing: .08em; text-transform: uppercase;
    margin-bottom: .55rem;
    display: flex; align-items: center; gap: .4rem;
  }
  .ferry-rows { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .7rem; }
  .ferry-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: .76rem; padding: .35rem .5rem;
    background: var(--gray1); border-radius: 6px;
  }
  .ferry-time { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
  .ferry-route { color: var(--gray3); font-size: .72rem; }
  .ferry-avail { font-size: .7rem; color: var(--teal); font-weight: 600; }
  .popup-reserve-btn {
    width: 100%; padding: .6rem;
    background: var(--navy); color: var(--white);
    border: none; border-radius: 8px;
    font-family: var(--font-sans); font-size: .8rem; font-weight: 700;
    cursor: pointer; transition: background .15s;
  }
  .popup-reserve-btn:hover { background: var(--ocean); }

  /* ── BOTTOM ATTRIBUTION (map) ── */
  .map-scale {
    position: absolute; bottom: 1.5rem; left: 1rem;
    background: rgba(255,255,255,.8); border-radius: 4px;
    padding: .2rem .6rem; font-size: .65rem; color: var(--gray4);
    border: 1px solid rgba(0,0,0,.1);
  }

  /* ── TOAST ── */
  #toast {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--navy); color: var(--white);
    font-size: .8rem; padding: .6rem 1.2rem; border-radius: 8px;
    box-shadow: var(--shadow-lg); opacity: 0; transition: all .3s; z-index: 999;
    pointer-events: none; white-space: nowrap;
  }
  #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* ── RESPONSIVE ── */
  @media (max-width: 700px) {
    :root { --panel-w: 100%; }
    #app { flex-direction: column; }
    #panel { width: 100%; height: 200px; border-right: none; border-bottom: 1px solid var(--gray2); }
    #map-wrap { flex: 1; }
  }
  /* 드롭다운 필터 */
.filter-group { display: flex; flex-direction: column; }
.filter-parent { justify-content: flex-start; gap: .55rem; }
.filter-arrow {
  margin-left: auto; font-size: .6rem; color: var(--gray3);
  transition: transform .2s; display: inline-block;
}
.filter-parent.open .filter-arrow { transform: rotate(90deg); }

.filter-children {
  display: none;
  flex-direction: column;
  padding-left: 1.4rem;
  border-left: 2px solid var(--gray2);
  margin-left: 1.2rem;
  margin-bottom: .3rem;
}
.filter-children.open { display: flex; }

.filter-child { padding: .35rem .6rem; font-size: .8rem; }

/* 이달의 등대 년도/월 선택 */
.month-selects {
  display: flex; flex-direction: column; gap: .4rem;
  padding: .4rem .6rem .6rem;
}
.month-select {
  width: 100%; padding: .4rem .6rem;
  font-family: var(--font-sans); font-size: .78rem;
  border: 1.5px solid var(--gray2); border-radius: 6px;
  background: var(--white); color: var(--text);
  cursor: pointer; outline: none;
  transition: border-color .15s;
}
.month-select:focus { border-color: var(--ocean); }
.stamp-site-link {
  display: block;
  margin: .4rem .6rem .6rem;
  padding: .45rem .8rem;
  font-size: .78rem; font-weight: 600;
  color: var(--ocean);
  background: var(--sky);
  border-radius: 7px;
  border: 1px solid var(--gray2);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.stamp-site-link:hover {
  background: var(--ocean);
  color: var(--white);
}
/* 팝업 추가 스타일 */
#popup { overflow-y: auto; max-height: 85vh; }


/* 날씨 껍데기 */
.popup-weather {
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem 1rem;
  background: var(--sky);
  border-radius: 10px;
  margin-bottom: .9rem;
}
.weather-icon { font-size: 2.2rem; line-height: 1; }
.weather-temp {
  font-size: 1.6rem; font-weight: 900;
  color: var(--navy); font-family: var(--font-serif);
  line-height: 1;
}
.weather-desc { font-size: .75rem; color: var(--gray4); margin-top: .2rem; }

.detail-cctv-buttons { display: flex; gap: .6rem; }
.detail-cctv-btn {
  flex: 1; padding: .6rem;
  background: var(--gray1); color: var(--gray4);
  border: 1.5px solid var(--gray2); border-radius: 8px;
  font-family: var(--font-sans); font-size: .8rem; font-weight: 700;
  cursor: pointer; transition: background .15s;
  text-align: center;
}
.detail-cctv-btn:hover { background: var(--gray2); }

/* 모바일 팝업 공간 부족 시 압축용 클래스 */
#popup.popup-compact .popup-body { padding-top: .5rem; }
#popup.popup-compact .popup-meta { margin-bottom: .3rem; }
#popup.popup-compact .popup-weather { margin-bottom: .3rem; padding: .4rem 1rem; }
#popup.popup-compact .weather-icon { font-size: 1.6rem; }
#popup.popup-compact .weather-temp { font-size: 1.3rem; }
#popup.popup-compact .dir-buttons { margin-bottom: .3rem; }
#popup.popup-compact #btn-detail { margin-top: .3rem; }

/* ── 패널 토글 버튼 ── */
#panel-toggle {
  position: fixed;
  top: 50%;
  left: var(--panel-w);
  transform: translateY(-50%);
  z-index: 150;
  width: 20px; height: 56px;
  background: var(--white);
  border: 1px solid var(--gray2);
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  color: var(--gray4);
  box-shadow: 2px 0 8px rgba(27,46,75,0.08);
  transition: left .3s ease, background .15s;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700;
  padding: 0;
}
#panel-toggle:hover { background: var(--gray1); color: var(--navy); }
#panel { transition: transform .3s ease; }
#panel.collapsed { transform: translateX(-100%); position: fixed; height: calc(100vh - var(--header-h)); top: var(--header-h); }

/* ── 링크 모음 오버레이 ── */
#links-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 500;
  background: rgba(15,25,50,.55);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
#links-overlay.visible { display: flex; }
#links-card {
  background: var(--white);
  border-radius: 16px;
  padding: 2rem;
  width: 420px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(27,46,75,.2);
  position: relative;
  animation: popup-in .22s cubic-bezier(.34,1.56,.64,1) both;
}
#links-title {
  font-size: 1rem; font-weight: 700;
  color: var(--gray4, #6b7280);
  letter-spacing: 0.02em;
  margin-bottom: 1.2rem;
}
#links-close {
  position: absolute; top: 1.2rem; right: 1.2rem;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gray1); border: none;
  font-size: .85rem; color: var(--gray4);
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: background .15s;
}
#links-close:hover { background: var(--gray2); }
#links-body { display: flex; flex-direction: column; gap: .7rem; }
.link-item {
  display: flex; align-items: center; gap: 1rem;
  padding: .9rem 1rem;
  border: 1.5px solid var(--gray2);
  border-radius: 10px;
  text-decoration: none; color: var(--text);
  transition: border-color .15s, background .15s, transform .15s;
}
.link-item:hover {
  border-color: var(--ocean);
  background: var(--sky);
  transform: translateY(-2px);
}
.link-icon { font-size: 1.15rem; flex-shrink: 0; }
.link-item-compact { padding: .55rem 1rem; }
.link-info { flex: 1; }
.link-name { font-size: .88rem; font-weight: 700; color: var(--navy); }
.link-desc { font-size: .75rem; color: var(--gray3); margin-top: .15rem; }
.link-arrow { color: var(--gray3); font-size: .9rem; flex-shrink: 0; }
.link-item:hover .link-arrow { color: var(--ocean); }
.link-item-compact { padding: .55rem 1rem; }

#search-dropdown {
  position: absolute;
  top: 100%;           /* 검색창 바로 아래 */
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  max-height: 320px;   /* 보라색 박스 크기 — 이 값으로 높이 조절 */
  overflow-y: auto;    /* ★ 스크롤 기능 */
  z-index: 9999;
  display: none;       /* 기본은 숨김 */
}

#search-dropdown.visible {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.85rem;
}

.search-result-item:hover {
  background: #f9fafb;
}

.search-result-item .sr-name {
  font-weight: 600;
  color: #1b2e4b;
}

.search-result-item .sr-region {
  font-size: 0.75rem;
  color: #6b7280;
}

.search-no-result {
  padding: 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.82rem;
}

/* ════════════════════════════════════════
   news.html 전용 스타일
   ════════════════════════════════════════ */

/* news.html body 오버라이드 */
body.ar-page {
  background: #0a0f1e;
  color: #fff;
  height: 100dvh;
  overflow: hidden;
  user-select: none;
}

/* AR 페이지용 변수 */
body.ar-page {
  --accent: #f59e0b;
  --green:  #10b981;
  --gray:   #6b7280;
  --glass:  rgba(15, 25, 45, 0.72);
  --glass-border: rgba(255,255,255,0.12);
}

/* ── AR HEADER ── */
body.ar-page #header {
  height: 52px;
  background: rgba(10,15,30,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0 20px;
  gap: 20px;
  box-shadow: none;
}

body.ar-page .logo {
  color: #fff;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.3px;
}

body.ar-page .logo img {
  width: 28px; height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

body.ar-page nav a {
  color: rgba(255,255,255,0.55);
  font-size: .82rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  transition: all .2s;
}

body.ar-page nav a.active,
body.ar-page nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

/* ── AR VIEWPORT ── */
#ar-viewport {
  position: fixed;
  inset: 96px 0 0 0;
  overflow: hidden;
  cursor: grab;
}

#ar-viewport.dragging { cursor: grabbing; }

#camera-feed {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
}

#desktop-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(16,56,100,0.6) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 20% 80%, rgba(245,158,11,0.04) 0%, transparent 60%),
    linear-gradient(180deg, #020510 0%, #071428 40%, #0d2040 70%, #142a4a 100%);
}

#stars-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#horizon {
  display: none;
}

#sea {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 25%;
  background: linear-gradient(180deg, #0a3d6b 0%, #051e3e 100%);
  z-index: 10;
  pointer-events: none;
}

/* ── 나침반 눈금자 ── */
#compass-ruler {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  gap: 0;
  pointer-events: none;
  height: 44px;
}

.ruler-tick {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 10px;
  flex-shrink: 0;
}

.ruler-tick .tick-line {
  width: 1px;
  background: rgba(255,255,255,0.3);
  height: 10px;
}

.ruler-tick.major .tick-line {
  height: 18px;
  background: rgba(255,255,255,0.6);
}

.ruler-tick .tick-label {
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  margin-top: 3px;
  letter-spacing: .5px;
}

.ruler-tick.major .tick-label {
  color: rgba(255,255,255,0.85);
  font-weight: 700;
  font-size: 10px;
}

/* ── 조준선 ── */
#crosshair {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 36px;
  background: var(--accent);
  pointer-events: none;
}

#crosshair::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--accent);
}

/* after */
#ar-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.ar-marker {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity .3s;
}

.tag-stamp { background: rgba(245,158,11,0.25); color: #f59e0b; }
.tag-year  { background: rgba(16,185,129,0.25); color: #10b981; }
/* ── 하단 정보 패널 ── */
#info-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(15, 23, 42, 0.92);
  border-top: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px 24px 0 0;
  backdrop-filter: blur(24px);
  padding: 10px 22px 28px;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  z-index: 50;
  max-height: 45dvh;
  overflow-y: auto;
  box-shadow: 0 -12px 40px rgba(0,0,0,0.35);
}

#info-panel.open { transform: translateY(0); }

.info-panel-handle {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 3px;
  margin: 2px auto 16px;
}

#info-panel-close {
  position: absolute;
  top: 14px; right: 18px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: .9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

#info-panel-name {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: 'Noto Serif KR', serif;
  color: #fff;
  letter-spacing: -.3px;
  line-height: 1.3;
}

#info-panel-dist {
  flex-shrink: 0;
  background: rgba(245,158,11,0.18);
  color: var(--accent);
  font-size: .74rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
  margin-top: 3px;
}

#info-panel-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.panel-tag {
  font-size: .72rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 20px;
}

#btn-map-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: var(--accent);
  color: #1b2e4b;
  font-weight: 700;
  font-size: .88rem;
  padding: 13px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
#btn-map-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245,158,11,0.3);
}
.btn-arrow { font-size: .95rem; 
}

/* ── 상태바 ── */
#status-bar {
  display: none;
}

#status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gray);
  flex-shrink: 0;
  transition: background .3s;
}

#status-dot.active { background: var(--green); box-shadow: 0 0 6px var(--green); }
#status-dot.warn   { background: var(--accent); }

#start-overlay {
  position: fixed;
  inset: 52px 0 0 0;
  background: rgba(5, 10, 22, 0.92);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 24px;
}

.start-wrap {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  max-width: 600px;
}

.start-mascot-img {
  width: 130px; height: 130px;
  object-fit: contain;
  flex-shrink: 0;
  margin-bottom: 6px;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.45));
}

.start-bubble {
  position: relative;
  background: var(--sky);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  padding: 1.7rem 1.9rem;
  text-align: left;
}

.start-bubble-tail {
  position: absolute;
  left: -16px; bottom: 50px;
  width: 0; height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-right: 18px solid var(--sky);
}

.start-bubble h2 {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -.5px;
  color: var(--navy);
  margin-bottom: .6rem;
}

.start-bubble p {
  font-size: .88rem;
  color: var(--gray4);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.start-features {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 1.2rem;
}

.start-feature {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: .78rem;
  color: var(--gray4);
}

.start-feature span:first-child { font-size: 1rem; }

#start-btn {
  background: var(--navy);
  color: var(--white);
  border: none;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: .9rem;
  font-weight: 700;
  padding: 13px 32px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  width: 100%;
}

#start-btn:hover {
  background: var(--ocean);
  transform: translateY(-2px);
}

/* ── 방위각 표시 ── */
#heading-display {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
  pointer-events: none;
}

/* ── 범위 슬라이더 ── */
/* after */
#range-control {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  background: rgba(5,15,35,0.75);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  backdrop-filter: blur(12px);
  padding: 8px 18px;
  z-index: 30;
  display: none;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
#range-control label {
  font-size: .72rem;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  margin-bottom: 0;
}

#range-slider {
  width: 130px;
  accent-color: var(--accent);
}

#range-value {
  font-size: .75rem;
  color: var(--accent);
  font-weight: 700;
  min-width: 32px;
}

/* ── 드래그 힌트 ── */
#drag-hint {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .72rem;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
  letter-spacing: .3px;
  animation: fadeHint 3s ease-in-out 2s forwards;
  opacity: 1;
}

@keyframes fadeHint {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* 스크롤바 */
#info-panel::-webkit-scrollbar { width: 3px; }
#info-panel::-webkit-scrollbar-track { background: transparent; }
#info-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ── 모바일 반응형 (AR) ── */
@media (max-width: 768px) {
  body.ar-page #header {
    padding: 0 14px;
    gap: 10px;
  }
  body.ar-page nav a {
    font-size: .72rem;
    padding: 5px 8px;
  }

  #status-bar {
    bottom: 24px;
    font-size: .72rem;
    padding: 8px 16px;
  }

  #info-panel {
    max-height: 55dvh;
    padding: 14px 20px 32px;
  }
  #info-panel-name { font-size: 1.1rem; }

  .start-wrap {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
  .start-mascot-img { width: 92px; height: 92px; margin-bottom: 0; }
  .start-bubble {
    width: 100%;
    padding: 1.3rem 1.4rem;
    margin-top: 8px;
  }
  .start-bubble-tail {
    left: 50%; bottom: auto; top: -14px;
    transform: translateX(-50%);
    border-top: none;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-bottom: 16px solid var(--sky);
  }
  .start-bubble h2 { font-size: 1.2rem; }
  .start-bubble p  { font-size: .82rem; }
  #start-btn { padding: 14px 0; font-size: .88rem; }

  .ruler-tick .tick-label { font-size: 10px; }
  .ruler-tick.major .tick-label { font-size: 11px; }
/* 모바일 팝업 - 화면 중앙 */
}
/* 모든 등대 표시 체크박스 오른쪽 정렬 */
#btn-all {
  justify-content: space-between;
}
#btn-all .filter-check {
  order: 1;
  margin-left: auto;
}
  /* ── PAGE CONTENT ── */
  #page {
    padding-top: calc(var(--header-h) + 2rem);
    padding-bottom: 4rem;
    max-width: 780px;
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  /* breadcrumb */
  .breadcrumb {
    display: flex; align-items: center; gap: .4rem;
    font-size: .78rem; color: var(--gray3);
    margin-bottom: 1.5rem;
  }
  .breadcrumb a {
    color: var(--ocean); text-decoration: none;
    transition: text-decoration .15s;
  }
  .breadcrumb a:hover { text-decoration: underline; text-decoration-color: #93c5fd; text-underline-offset: 3px; }
  .breadcrumb-sep { color: var(--gray2); }

  /* hero image */
  .hero {
    width: 100%; height: 260px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--sky) 0%, var(--gray2) 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 6rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
  }
  /* 나중에 실제 이미지가 들어올 자리 */
  .hero-placeholder-text {
    position: absolute; bottom: 1rem; right: 1.2rem;
    font-size: .7rem; color: rgba(0,0,0,.25); font-weight: 500;
  }

  /* title row */
  .detail-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; margin-bottom: .6rem;
    flex-wrap: wrap;
  }
  .detail-name {
    font-family: var(--font-serif);
    font-size: 1.9rem; font-weight: 900; color: var(--navy);
    line-height: 1.2;
  }
  .detail-tags { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-top: .3rem; }
  .detail-tag {
    font-size: .7rem; padding: .2rem .55rem;
    border-radius: 5px; font-weight: 600;
  }

  .detail-region {
    font-size: .88rem; color: var(--gray3); margin-bottom: .5rem;
    display: flex; align-items: center; gap: .35rem;
  }
  .detail-desc {
    font-size: .95rem; color: var(--gray4); line-height: 1.8;
    margin-bottom: 2rem;
    padding: 1rem 1.2rem;
    background: var(--white);
    border-radius: var(--radius);
    border-left: 3px solid var(--ocean);
    box-shadow: var(--shadow);
  }

  /* section card */
  .section-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.2rem;
  }
  .section-title {
    font-size: .72rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--gray3); margin-bottom: 1rem;
    display: flex; align-items: center; gap: .45rem;
  }

  /* info grid */
  .info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .8rem;
  }
  .info-item { display: flex; flex-direction: column; gap: .2rem; }
  .info-label { font-size: .72rem; color: var(--gray3); font-weight: 600; }
  .info-value { font-size: .88rem; color: var(--text); font-weight: 500; }

  /* data-empty notice */
  .data-empty {
    padding: 1.2rem;
    background: var(--gray1);
    border-radius: 8px;
    text-align: center;
    font-size: .82rem; color: var(--gray3);
    font-style: italic;
  }

  /* ferry table */
  .ferry-table { display: flex; flex-direction: column; gap: .4rem; }
  .ferry-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: .5rem .7rem;
    background: var(--gray1); border-radius: 8px;
    font-size: .83rem;
  }
  .ferry-time { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
  .ferry-route { color: var(--gray3); font-size: .78rem; }
  .ferry-avail { font-size: .76rem; color: var(--teal); font-weight: 600; }

  /* direction buttons (detail.html 전용) */
  .detail-dir-buttons { display: flex; gap: .6rem; }
  .detail-dir-btn {
    flex: 1; padding: .65rem .5rem;
    border: none; border-radius: 8px;
    font-family: var(--font-sans); font-size: .8rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .35rem;
    transition: opacity .15s, transform .1s;
  }
  .detail-dir-btn:hover { opacity: .88; transform: translateY(-1px); }
  .detail-dir-naver { background: #03c75a; color: var(--white); }
  .detail-dir-kakao { background: #fee500; color: #3c1e1e; }

  /* reserve button */
  .reserve-btn {
    width: 100%; padding: .75rem;
    background: var(--navy); color: var(--white);
    border: none; border-radius: 8px;
    font-family: var(--font-sans); font-size: .88rem; font-weight: 700;
    cursor: pointer; transition: background .15s;
    margin-top: .8rem;
  }
  .reserve-btn:hover { background: var(--ocean); }

  /* weather placeholder (detail.html 전용) */
  .weather-box {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.2rem;
    background: var(--sky);
    border-radius: 10px;
  }
  .detail-weather-icon { font-size: 2.5rem; }
  .detail-weather-temp { font-size: 1.8rem; font-weight: 900; color: var(--navy); font-family: var(--font-serif); }
  .weather-label { font-size: .78rem; color: var(--gray4); margin-top: .15rem; }

  /* gallery placeholder */
  .gallery-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem;
  }
  .gallery-cell {
    aspect-ratio: 1;
    background: var(--gray1);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; color: var(--gray2);
  }

  /* back button */
  .back-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem 1rem;
    background: var(--white); border: 1.5px solid var(--gray2);
    border-radius: 8px; font-size: .82rem; font-weight: 600;
    color: var(--gray4); text-decoration: none;
    margin-bottom: 1.5rem;
    transition: background .15s, border-color .15s, color .15s;
    cursor: pointer;
  }
  .back-btn:hover { background: var(--gray1); border-color: var(--navy); color: var(--navy); }

  /* notice banner */
  .notice-banner {
    background: #fff7ed;
    border: 1.5px solid #fed7aa;
    border-radius: 10px;
    padding: .85rem 1.1rem;
    font-size: .8rem; color: #92400e;
    margin-bottom: 1.5rem;
    display: flex; align-items: flex-start; gap: .6rem;
    line-height: 1.6;
  }

  @media (max-width: 600px) {
    .info-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-name { font-size: 1.4rem; }
  }
/* 상단 이름/소개/세부정보 카드 */
.detail-top-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.2rem;
}
.detail-oneline {
  font-size: .92rem;
  color: var(--gray4);
  line-height: 1.6;
  margin: .4rem 0 .5rem;
}
.detail-sub-rows {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  border-top: 1px solid var(--gray2);
  padding-top: .9rem;
  margin-top: .2rem;
}
.detail-sub-row {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .85rem;
  color: var(--text);
  line-height: 1.5;
}
.detail-sub-icon {
  font-size: .9rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  margin-top: .1rem;
}
.detail-story {
  font-size: .88rem;
  color: var(--gray4);
  line-height: 1.8;
  padding: .8rem 1rem;
  background: var(--gray1);
  border-radius: 8px;
  margin-top: .5rem;
  margin-bottom: .8rem;
  font-style: italic;
}
/* ── detail.html 전용 ── */
body.detail-page {
  overflow: auto;
  height: auto;
}
html:has(body.detail-page) {
  overflow: auto;
  height: auto;
}
/* ════════════════════════════════════════
   모바일 반응형 (768px 이하)
════════════════════════════════════════ */
#mobile-sheet { display: none; }

@media (max-width: 768px) {

  #mobile-sheet-content .panel-section {
  max-height: none;
  flex-shrink: 1;
}

#mobile-sheet-content #panel {
  overflow-y: auto;
}

  /* 헤더: 로고 + 검색만 */
  #header { padding: 0 .75rem; gap: .6rem; }
  #header nav { display: none; }
  .header-search { flex: 1; max-width: none; }
  .header-search input { font-size: 1rem; }

  /* 앱: 전체화면 지도 */
  #app { flex-direction: column; }
  #panel { display: none; }
  #panel-toggle { display: none; }
  #map-wrap { flex: 1; width: 100%; height: 100%; }

  /* 팝업: 화면 중앙 */
  #popup {
    position: fixed !important;
    top: 25dvh !important;
    left: 50vw !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 2.5rem) !important;
    max-width: 380px !important;
    max-height: 60dvh !important;
    right: auto !important;
    bottom: auto !important;
    border-radius: 16px !important;
    overflow-y: auto;
    z-index: 300 !important;
  }
  #popup::before { display: none; }
  .popup-close { top: .75rem !important; right: .75rem !important; }

  /* 하단 내비게이션 바 */
  #mobile-nav {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 60px;
    background: var(--white);
    z-index: 300;
  }
  .mobile-nav-item {
    flex: 0 0 auto;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px;
    padding: 0 .6rem;
    background: none; border: none;
    text-decoration: none;
    color: var(--gray4);
    font-family: var(--font-sans);
    cursor: pointer;
    transition: color .15s;
  }
  .mobile-nav-item.active { color: var(--navy); }
  .mobile-nav-item:hover { color: var(--navy); }
  .mobile-nav-icon { font-size: 1.4rem; }
  .mobile-nav-label { font-size: .75rem; font-weight: 600; }

  /* 하단 시트 (필터/목록) */
  #mobile-sheet {
  display: block;
  position: fixed;
  bottom: 60px; left: 0; right: 0;
  height: 100px;
  background: var(--white);
  border-radius: 16px 16px 0 0;
  border-top: 1.5px solid var(--gray2);
  box-shadow: 0 -4px 24px rgba(27,46,75,0.15);
  z-index: 200;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow: visible;
}
#mobile-sheet.open {
  transform: translateY(0);
}
  #mobile-sheet-handle { display: none; }
  #mobile-sheet-handle-bar { display: none; }
  #mobile-sheet-content {
  overflow-y: auto;
  height: 100%;
  padding: 0 1rem 2rem;
}

  /* 모바일 오버레이 */
  #mobile-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 190;
  }
  #mobile-overlay.visible { display: block; }

  /* 내 위치 마커 */
  .my-location-marker {
    width: 18px; height: 18px;
    background: #2563eb;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.3);
  }
}

/* 모바일 시트가 내비게이션 바에 안 가려지도록 */
@media (max-width: 768px) {
  #mobile-sheet {
    bottom: 60px; /* 내비바 높이만큼 올리기 */
  }
}
/* ── AI 정보 섹션 ── */
.ai-block {
  background: var(--gray1);
  border-radius: 10px;
  padding: 0.8rem 1rem;
}
.ai-block-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray4);
  margin-bottom: 0.4rem;
}
.ai-block-content {
  font-size: 0.85rem;
  color: var(--navy);
  line-height: 1.7;
  white-space: pre-line;
}
/* 이달의 등대 섹션 */
.monthly-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0;
  border-bottom: 1px solid var(--gray2);
  margin-bottom: 0.2rem;
}

.monthly-desc-text {
  font-size: 0.83rem;
  color: var(--gray4);
  line-height: 1.7;
}

.monthly-spot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.2rem 0;
}

.monthly-spot-tag {
  background: #eff6ff;
  color: #1e40af;
  border-radius: 20px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 500;
}
/* AI 출처 뱃지 */
.ai-source-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--sky, #e0f2fe);
  color: var(--ocean, #0284c7);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}
.ai-source-badge:hover {
  background: var(--ocean, #0284c7);
  color: #fff;
}
/* AI 폴백 검색 버튼 */
.ai-search-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
}
.ai-search-naver { background: #03c75a; }
.ai-search-google { background: #4285f4; }
.ai-search-btn:hover { opacity: 0.88; }
.link-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray4, #6b7280);
  margin: 1.3rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--gray2, #e5e7eb);
  letter-spacing: 0.02em;
}

.link-section-desc {
  font-size: 0.78rem;
  color: var(--gray4, #9ca3af);
  margin: 0rem 0 0.5rem;
  line-height: 1.4;
}

.link-icon svg.icon-svg {
  width: 28px;
  height: 28px;
  color: var(--ocean, #1a73c2);
}
/* 등질 정보 + 등대 이야기 통합 섹션 */
.light-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.light-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff0f5;
  border: 1.5px solid #ffc4dd;
  color: #9d2960;
  font-size: .75rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
}
.light-badge-code {
  font-family: monospace;
  background: #ffe1ec;
}
.light-badge-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.light-explain-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.light-explain-icon {
  flex-shrink: 0;
  width: 90px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.light-explain-bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #f5f0fc;
  border: 1.5px solid #d8c5f2;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: .8125rem;
  color: #4a3d63;
  line-height: 1.7;
}
.light-explain-tip {
  position: absolute;
  left: -10px; top: 24px;
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 10px solid #d8c5f2;
}
.light-explain-tip-inner {
  position: absolute;
  left: -8px; top: 25px;
  width: 0; height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 9px solid #f5f0fc;
}
.light-explain-desc {
  font-size: .75rem;
  color: #7a6a99;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #d8c5f2;
}
.light-explain-photo {
  width: 100%;
  margin-top: 14px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.light-badge-break {
  flex-basis: 100%;
  height: 0;
}/* ── 사용법 버튼 (사이드바 하단) ── */
.panel-footer {
  flex-shrink: 0;
  padding: .8rem 1.1rem;
  border-top: 1px solid var(--gray2);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.btn-tutorial {
  width: 100%;
  padding: .6rem;
  background: var(--sky);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: .82rem; font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-tutorial:hover { background: var(--ocean); color: var(--white); }

/* ── 사용법 튜토리얼 오버레이 ── */
#tutorial-overlay {
  position: fixed; inset: 0;
  z-index: 10000;
  display: none;
}
#tutorial-overlay.active { display: block; }

.tutorial-highlight {
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(15,23,42,0.6);
  opacity: 0;
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease, opacity .25s ease;
  pointer-events: none;
}

.tutorial-wrap {
  position: fixed;
  display: flex;
  align-items: flex-end;
  z-index: 10001;
  transition: top .25s ease, left .25s ease, opacity .2s ease;
}

.tutorial-mascot-img {
  width: 110px; height: 110px;
  object-fit: contain;
  flex-shrink: 0;
  margin-bottom: 6px;
  filter: drop-shadow(0 8px 16px rgba(15,23,42,0.18));
}

.tutorial-bubble {
  position: relative;
  width: 440px;
  max-width: calc(100vw - 200px);
  background: var(--sky);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  padding: 1.8rem 2rem 1.5rem;
  margin-left: 14px;
}

.tutorial-bubble-tail {
  position: absolute;
  left: -18px;
  bottom: 50px;
  width: 0; height: 0;
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
  border-right: 20px solid var(--sky);
}

.tutorial-text {
  font-size: 1.15rem;
  line-height: 1.75;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 1.4rem;
  word-break: keep-all;
}

.tutorial-bottom-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
  flex-wrap: nowrap;
}

.tutorial-progress {
  font-size: .95rem; color: var(--ocean); font-weight: 700;
}

.tutorial-dismiss-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: .8rem;
  font-size: .82rem; color: var(--gray4);
  cursor: pointer;
  user-select: none;
}
.tutorial-dismiss-row input[type="checkbox"] {
  width: 15px; height: 15px;
  cursor: pointer;
}

.tutorial-next-btn {
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 12px;
  padding: .75rem 1.6rem;
  font-size: 1.05rem; font-weight: 700;
  cursor: pointer;
  font-family: var(--font-sans);
}
@media (hover: hover) and (pointer: fine) {
  .tutorial-next-btn:hover { background: var(--ocean); }
}

.tutorial-prev-btn {
  background: rgba(255,255,255,.7);
  color: var(--navy);
  border: 1.5px solid var(--navy);
  border-radius: 12px;
  padding: .7rem 1.3rem;
  font-size: 1rem; font-weight: 700;
  cursor: pointer;
  font-family: var(--font-sans);
}
.tutorial-prev-btn:hover { background: var(--white); }

.tutorial-skip-btn {
  position: fixed; top: 20px; right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.95);
  color: var(--navy);
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 10001;
  box-shadow: var(--shadow);
}
/* 메인 사용법 튜토리얼만: 말풍선 안쪽 왼쪽 위로 위치 변경 (AR 페이지는 영향 없음) */
#tutorial-overlay .tutorial-skip-btn {
  position: absolute;
  top: 10px; right: 10px; left: auto;
  width: 28px; height: 28px;
  font-size: .85rem;
  border: 1px solid var(--gray2);
  box-shadow: none;
}
/* ── 사용법 튜토리얼: 모바일 전체 최적화 (이미지 크기는 그대로) ── */
@media (max-width: 768px) {
  .tutorial-bubble {
    width: auto;
    max-width: calc(100vw - 170px);
    padding: 1.2rem 1.4rem 1.1rem;
    border-radius: 20px;
  }
  .tutorial-mascot-img {
    width: 110px;
    height: 110px;
  }
  .tutorial-text {
    font-size: .95rem;
    line-height: 1.55;
    margin-bottom: 1rem;
  }
  .tutorial-progress {
    font-size: .72rem;
    flex-shrink: 0;
  }
  .tutorial-next-btn {
    padding: .5rem .85rem;
    font-size: .78rem;
    border-radius: 9px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .tutorial-prev-btn {
    padding: .45rem .75rem;
    font-size: .78rem;
    border-radius: 9px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  /* ── detail 튜토리얼 모바일 전용: 캐릭터 왼쪽, 말풍선 오른쪽 ── */
  #detail-tutorial-overlay .tutorial-wrap {
    flex-direction: row;
    align-items: flex-end;
    width: calc(100vw - 24px);
    left: 12px !important;
  }
  #detail-tutorial-overlay .tutorial-mascot-img {
    width: 64px;
    height: 64px;
    margin-bottom: 6px;
    flex-shrink: 0;
  }
  #detail-tutorial-overlay .tutorial-bubble {
    flex: 1;
    width: 0;
    max-width: 100%;
    margin-left: 10px;
    margin-top: 0;
    border-radius: 16px;
  }
  #detail-tutorial-overlay .tutorial-bubble-tail {
    display: block;
    left: -16px;
    bottom: 40px;
  }
}
/* ── AR 페이지 사용법 안내 (3단계) ── */
#ar-tutorial-overlay {
  display: none;
  position: fixed; inset: 0;
  z-index: 9000;
  pointer-events: none;
}
#ar-tutorial-overlay .tutorial-skip-btn,
#ar-tutorial-overlay .tutorial-wrap {
  pointer-events: auto;
}
#ar-tutorial-overlay .tutorial-skip-btn {
  position: absolute;
  top: 10px; right: 10px; left: auto;
  width: 28px; height: 28px;
  font-size: .85rem;
  border: 1px solid var(--gray2);
  box-shadow: none;
}
.ar-tutorial-chevrons {
  justify-content: space-between;
  width: 340px;
  font-size: 4rem;
  color: rgba(255,229,200,0.9);
  font-weight: 700;
  letter-spacing: 2px;
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-shadow: 0 0 14px rgba(255, 200, 120, 0.85);
}
.ar-tutorial-chevrons span:first-child {
  display: inline-block;
  animation: chevron-bounce-left 1.2s ease-in-out infinite;
}
.ar-tutorial-chevrons span:last-child {
  display: inline-block;
  animation: chevron-bounce-right 1.2s ease-in-out infinite;
}
@keyframes chevron-bounce-left {
  0%, 100% { transform: translateX(0); opacity: 0.65; }
  50%      { transform: translateX(-16px); opacity: 1; }
}
@keyframes chevron-bounce-right {
  0%, 100% { transform: translateX(0); opacity: 0.65; }
  50%      { transform: translateX(16px); opacity: 1; }
}
.compass-btn-pulse {
  animation: compass-btn-pulse 1s ease-in-out infinite;
}
@keyframes compass-btn-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.2); }
}
@media (max-width: 768px) {
  .ar-tutorial-chevrons { font-size: 3rem; width: 260px; top: 32%; }
}
/* ── AR 사용법 안내: 가짜 등대 마커들 ── */
.ar-tutorial-marker {
  position: absolute;
  bottom: 280px;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
}
.ar-tutorial-marker-label {
  background: rgba(10,20,50,0.82);
  border: 1px solid rgba(255,200,80,0.5);
  border-radius: 7px;
  padding: 3px 8px;
  text-align: center;
  white-space: nowrap;
  margin-bottom: 2px;
}
.ar-tutorial-marker-name { color:#fff; font-size:12px; font-weight:700; font-family:'Noto Sans KR',sans-serif; }
.ar-tutorial-marker-dist { color:rgba(255,210,100,0.85); font-size:10px; font-family:'Noto Sans KR',sans-serif; }
.ar-tutorial-marker-line { width:1px; height:10px; background:rgba(255,200,80,0.5); }
@media (max-width: 768px) {
  .ar-tutorial-marker { bottom: 310px; }
  .ar-tutorial-marker svg { width: 48px; height: 118px; }
}
/* ── 맨 위로 가기 버튼 ── */
.scroll-top-btn {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 500;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ocean);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
}
.scroll-top-btn.visible {
  display: flex;
}
/* ── 페이지 공유하기 버튼 (맨 위로 가기 버튼 위에 쌓임) ── */
.page-share-btn {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 500;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ocean);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* ── AR 페이지: 지도로 돌아가기 버튼 (detail.html과 같은 .back-btn 스타일 재사용) ── */
.ar-back-btn {
  position: fixed;
  top: 64px;
  left: 20px;
  z-index: 60;
  margin-bottom: 0;
}
/* ── 배편 정보: 접기/더보기 ── */
.ferry-table {
  max-height: 300px;
  overflow: hidden;
  position: relative;
  transition: max-height .3s ease;
}
.ferry-table.expanded {
  max-height: none;
}
.ferry-table:not(.expanded)::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--white));
  pointer-events: none;
}
.ferry-toggle-btn {
  width: 100%;
  margin-top: .6rem;
  margin-bottom: .8rem;
  padding: .55rem;
  background: var(--gray1);
  border: none;
  border-radius: 8px;
  color: var(--gray4);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}
.ferry-toggle-btn:hover { background: var(--gray2); color: var(--navy); 
}
/* ── detail.html 사용법 튜토리얼 (예시 페이지) ── */
#detail-tutorial-overlay {
  position: fixed; inset: 0;
  z-index: 10000;
  display: none;
  background: var(--gray1);
  overflow-y: auto;
}
#detail-tutorial-overlay.active { display: block; }
#detail-tutorial-overlay .tutorial-skip-btn {
  position: absolute;
  top: 10px; right: 10px; left: auto;
  width: 28px; height: 28px;
  font-size: .85rem;
  border: 1px solid var(--gray2);
  box-shadow: none;
}
.dt-fake-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
}
/* ── 등질 정보 & 등대 이야기: 모바일 전용 접기/더보기 ── */
.light-story-toggle-btn {
  display: none; /* 데스크탑에서는 숨김 */
}

@media (max-width: 768px) {
  .light-story-toggle-btn {
    display: block;
    width: 100%;
    margin-top: .6rem;
    margin-bottom: .8rem;
    padding: .55rem;
    background: var(--gray1);
    border: none;
    border-radius: 8px;
    color: var(--gray4);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
  }
  .light-story-toggle-btn:hover {
    background: var(--gray2);
    color: var(--navy);
  }

  .light-story-content {
    max-height: 0;
    overflow: hidden;
    position: relative;
    transition: max-height .3s ease;
  }
  .light-story-content.expanded {
    max-height: 2000px;
  }
  .light-story-content:not(.expanded)::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), var(--white));
    pointer-events: none;
  }
}
/* ── 튜토리얼 6단계: 진짜 지도 위 가짜 클러스터 ── */
.tutorial-fake-cluster {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(37, 99, 168, .9);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 6px rgba(37, 99, 168, .25), 0 0 18px 6px rgba(96, 165, 250, .55);
  animation: fakeClusterGlow 1.6s ease-in-out infinite;
}
@keyframes fakeClusterGlow {
  0%, 100% { box-shadow: 0 0 0 6px rgba(37, 99, 168, .25), 0 0 18px 6px rgba(96, 165, 250, .55); }
  50%      { box-shadow: 0 0 0 10px rgba(37, 99, 168, .35), 0 0 26px 10px rgba(96, 165, 250, .75); }
}
/* ── 글자 크기 조절 버튼 (데스크탑) ── */
.font-size-control {
  display: flex;
  gap: .3rem;
  margin-left: .5rem;
}
.font-size-control button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--gray2);
  background: var(--white);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.font-size-control button:hover {
  background: var(--sky);
  border-color: var(--ocean);
}
@media (max-width: 768px) {
  .font-size-control {
    display: none; /* 모바일은 다음 단계에서 별도로 진행 */
  }
}
/* ── 글자 크기 슬라이더 (모바일 전용) ── */
.mobile-font-size-slider {
  display: none; /* 데스크탑에서는 숨김 */
}

@media (max-width: 768px) {
  .mobile-font-size-slider {
    display: flex;
    align-items: center;
    gap: .5rem;
    position: absolute;
    left: 12px;
    bottom: 74px;
    z-index: 60; /* 필터 시트(200), 팝업(300), 관련사이트 팝업(500)보다 낮게 → 다 뒤로 가려짐 */
    background: rgba(255,255,255,.92);
    padding: .35rem .7rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
  }
  .font-size-slider-label {
    font-size: .7rem;
    color: var(--gray4);
    font-weight: 700;
  }
  .font-size-slider-label.big {
    font-size: 1rem;
  }
  #mobile-font-size-range {
    width: 90px;
    height: 4px;
    accent-color: var(--ocean);
  }
}
.visit-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.55rem 1rem;
  background: var(--sky);
  border-radius: 8px;
  font-size: 0.78rem;
}

.visit-counter-icon {
  font-size: 0.85rem;
}

.visit-counter-text {
  font-weight: 500;
  color: var(--navy);
}

.visit-counter-text #visit-count-num,
.visit-counter-text #visit-count-num-modal {
  color: var(--ocean);
  font-weight: 800;
}
.link-section-title.no-border {
  border-top: none;
  padding-top: 0;
  margin-top: 1.3rem;
}