/* 공개 화면 부품의 꾸밈(4단계 목록 부품, 5단계 위 바 · 건너뛰기, 2026-11-30 · 12-02) — core/ui/*.tsx 와 한 벌.
   번역 사이트는 app/(site)/layout.tsx 가 import 하고(site.css 보다 먼저), waharakadhamma 는 npm run sync:core 가
   public/static/ui.css 로 복사해 styles.css 보다 먼저 싣는다. 색 · 그림자는 core/tokens.css 변수.
   겉모습은 번역 사이트 것(11-30 사용자): 카드 머리는 바탕 없음 · 제목 밑줄 없음, 들은 · 읽은 표는 늘 초록, 칩은 2.25rem.
   사이트의 링크 색 규칙(.s-shell a 따위)보다 앞서도록 링크 선택자는 한 단계 깊게 쓴다. */

/* ── 화면 머리 ── */
.results-head {
  margin-bottom: 1.2rem;
}
.results-head h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(1.3rem, 3.6vw, 1.75rem);
  line-height: 1.35;
}
/* 위 단계로 가는 경로(모든 모음 ›). */
.crumb {
  margin: 0 0 0.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.results-head .crumb a {
  color: var(--accent);
  text-decoration: none;
}
.results-head .crumb a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.results-note {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.catalog-empty {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

/* ── 법문 카드(검색 결과 · 모음 하나 · 기록) ── */
.result-groups {
  display: grid;
  gap: 0.9rem;
}
.sermon-group {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: var(--surface);
  overflow: hidden;
}
.group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.95rem 1rem 0.75rem;
  /* 바탕 없음(11-30 사용자) — 번역 사이트 globals.css 의 옛 회색 머리를 덮는다. */
  background: none;
}
.group-h {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}
.sermon-group .group-title {
  display: block;
  margin: 0;
  color: var(--text-strong);
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.35;
  text-decoration: none;
}
.sermon-group a.group-title:hover {
  color: var(--accent);
}
.sermon-group[data-off] .group-title {
  color: var(--text-muted);
}
.group-meta {
  margin: 0.1rem 0 0;
  color: var(--text-faint);
  font-size: 0.83rem;
  font-variant-numeric: tabular-nums;
}
.group-read {
  color: var(--ok);
  font-weight: 650;
}
.group-question {
  margin: 0.3rem 0 0;
  padding-left: 0.6rem;
  border-left: 2px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.hit-count {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  color: var(--text-strong);
  background: var(--surface-sunken);
  font-size: 0.85rem;
  font-weight: 750;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── 찾은 문장 줄 ── */
.hit-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}
.hit-list .hit {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) 2rem;
  gap: 0.6rem;
  align-items: baseline;
  min-height: 2.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.hit-list li:last-child .hit {
  border-bottom: 0;
}
.hit-list .hit:hover {
  color: var(--text);
  background: var(--surface-sunken);
}
.hit-list .hit-text mark {
  border-radius: 0.2em;
  color: var(--mark-text);
  background: var(--mark-bg);
  box-shadow: none;
}
.hit-list .hit-time {
  padding-top: 0;
  color: var(--text-strong);
  font-size: 0.9rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.hit-text {
  line-height: 1.6;
}
.hit-play {
  display: inline-flex;
  align-self: center;
  color: var(--text-faint);
}
.hit:hover .hit-play {
  color: var(--accent);
}

/* ── 접어 둔 나머지(<details>) ── */
.hit-more > .hit-list {
  border-top: 1px solid var(--border);
}
.hit-more-note {
  margin: 0;
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  text-align: center;
}
.show-more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  border-top: 1px solid var(--border);
  color: var(--accent);
  background: var(--surface-sunken);
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  list-style: none;
}
.show-more::-webkit-details-marker {
  display: none;
}
.hit-more[open] .when-closed,
.hit-more:not([open]) .when-open {
  display: none;
}

/* ── 빈 상태 · 갈 곳 단추 ── */
.empty-state {
  padding: 2.2rem 1.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: 0.8rem;
  background: var(--surface);
  text-align: center;
}
.empty-state h2 {
  margin: 0 0 0.5rem;
  color: var(--text-strong);
  font-size: 1.15rem;
}
.empty-state p {
  max-width: 26rem;
  margin: 0 auto;
  color: var(--text-muted);
}
.empty-state p + p {
  margin-top: 0.6rem;
}
.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 1rem;
}
.results-head .empty-actions {
  justify-content: flex-start;
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--accent);
  background: var(--bg);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}
.chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ── 맨 위 검색칸(알약) ── */
.query-form {
  margin-bottom: 0.9rem;
}
.query-chip {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  width: 100%;
  padding: 0.3rem 0.35rem 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  color: var(--text-muted);
  background: var(--surface);
}
.query-chip:focus-within {
  border-color: var(--accent);
  outline: 2px solid var(--focus-color);
  outline-offset: 0;
}
.query-chip-text {
  flex: 1;
  min-width: 0;
  min-height: 2.25rem;
  padding: 0;
  border: 0;
  color: var(--text-strong);
  background: transparent;
  font: inherit;
  font-weight: 650;
}
.query-chip-text:focus-visible {
  outline: 0;
}
.query-chip-go {
  flex: none;
  min-height: 2.25rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 0.5rem;
  color: var(--accent-text);
  background: var(--accent);
  font-weight: 650;
}
.query-chip-go:hover {
  background: var(--accent-hover);
}

/* ── 찾는 중 띠 ── */
.search-waiting {
  display: flex;
  gap: 0.875rem;
  align-items: center;
  margin: 0 0 1.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  color: var(--text);
  background: var(--surface-sunken);
}
.search-waiting-title {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.search-waiting-note {
  display: block;
  font-size: 0.875rem;
}
.search-waiting-dots {
  display: inline-flex;
  flex: none;
  gap: 0.3rem;
  color: var(--accent);
}
.search-waiting-dots span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  animation: search-waiting-dot 1.2s infinite;
}
.search-waiting-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.search-waiting-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes search-waiting-dot {
  0%,
  80%,
  100% {
    transform: scale(0.6);
  }
  40% {
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .search-waiting-dots span {
    animation: none;
  }
}

/* ── 기록: 날별 머리글 ── */
.day-list {
  display: grid;
  gap: 1.8rem;
}
.day-heading {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 0.7rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 650;
}
.day-heading-date {
  color: var(--text-dim);
  font-size: 0.87rem;
  font-weight: 400;
}

/* ── 메뉴: 단추 아래로 펼치는 목록 ── */
.menu {
  position: relative;
}
.menu-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.4rem);
  right: 0;
  width: max-content;
  min-width: 13rem;
  max-width: calc(100vw - 2rem);
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: var(--surface-raised);
  box-shadow: var(--shadow-mid);
}
.menu-panel[hidden] {
  display: none;
}
.menu-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.menu-panel li a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.menu-panel li a:hover {
  color: var(--text-strong);
  background: var(--surface-sunken);
}
.menu-panel li a[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
}

/* ── 바닥글 ── */
.home-footer {
  margin-top: 3rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.home-footer-inner {
  display: grid;
  gap: 1rem;
}
.home-footer p {
  margin: 0;
}
.home-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.home-footer nav a {
  color: var(--text);
  text-underline-offset: 0.3em;
}

/* ── 좁은 화면 · 손가락: 카드 머리는 한 칸, 찾은 줄은 재생 그림을 뺀다 ── */
@media (max-width: 44rem), (pointer: coarse) {
  .group-head {
    grid-template-columns: minmax(0, 1fr);
  }
  .hit-count {
    justify-self: start;
  }
  .hit-list .hit {
    grid-template-columns: 3.2rem minmax(0, 1fr);
    padding: 0.6rem 0.75rem;
  }
  .hit-play {
    display: none;
  }
}

/* ── 위 바 · 건너뛰기 링크(5단계, 2026-12-02 — bar.tsx 와 한 벌) ──
   겉모습은 번역 사이트 것(12-02 사용자): 돋보기를 누르면 가운데 칸만 검색칸, 돋보기는 ✕(파란 바탕), 막 없음. */
.skip-link {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0.75rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-top: 0;
  border-radius: 0 0 0.5rem 0.5rem;
  color: var(--accent);
  background: var(--surface-raised);
  box-shadow: var(--shadow-mid);
  font-weight: 650;
  text-decoration: none;
  transform: translateY(-120%);
  transition: transform 120ms ease;
}
.skip-link:focus-visible {
  transform: translateY(0);
}

.app-bar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  height: var(--bar-height);
  padding: 0 1rem;
  background: var(--surface);
  box-shadow: var(--shadow-bar);
}
.app-bar .app-brand {
  display: flex;
  align-items: center;
  color: var(--text-strong);
  font-size: 0.98rem;
  font-weight: 750;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
}
.bar-ident {
  display: flex;
  align-items: center;
  min-width: 0;
}
.sermon-id {
  overflow: hidden;
  color: var(--text-strong);
  font-size: 1.02rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-nav {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
/* 돋보기 · 메뉴 단추 */
.panel-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text-muted);
  background: var(--bg);
}
.panel-toggle:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
}
.panel-toggle[aria-expanded="true"] {
  color: var(--accent-text);
  border-color: var(--accent);
  background: var(--accent);
}

/* 돋보기를 누르면 가운데 칸이 검색칸이 된다. 폼은 칸 아래 펼치는 판(사이트 자리)이 떠 붙는 기준. */
.bar-search-form {
  position: relative;
  display: flex;
  width: min(36rem, 100%);
}
.bar-search {
  display: flex;
  flex: 1;
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
  height: 2.4rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface-raised);
}
.bar-search:focus-within {
  border-color: transparent;
  box-shadow: var(--shadow-mid);
  outline: 2px solid var(--focus-color);
}
.bar-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  color: var(--text-strong);
  background: transparent;
  font-size: 1rem;
}
.bar-search input:focus-visible {
  outline: 0;
}

/* 홈에는 위 바가 없고 오른쪽 위에 메뉴 단추만(가로로 눕힌 폰은 노치를 피함). */
.home-menu {
  position: absolute;
  z-index: 30;
  top: max(0.7rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
}

@media (max-width: 44rem) {
  .app-bar {
    gap: 0.5rem;
    padding: 0 0.7rem;
  }
  .sermon-id {
    font-size: 0.88rem;
  }
  /* 검색칸이 열리면 이름을 접어 칸을 넓힌다 */
  .app-bar[data-searching] .app-brand {
    display: none;
  }
  .app-bar[data-searching] {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* ═══ 6단계(2026-12-02): 홈 · 모든 법문 · 도움 투어 — core/ui/home.tsx · collections.tsx · tour.tsx 와 한 벌.
   겉모습은 번역 사이트 것(12-02 사용자). 홈 이름 묶음 안 그림 · 이름 꼴과 투어 가짜 화면의 꾸밈은 사이트에 둔다. ═══ */

.section-head {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.section-head h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.15rem;
}

/* ── 설명 페이지(core/ui/doc.tsx): 좁은 한 단, 절마다 위에 가는 선 하나 ──
   겉모습은 waharakadhamma 것(8단계, 12-02 사용자). 절 안의 꾸밈 · 문단 여백 · 줄 간격은 사이트 몫. */
.doc {
  width: min(42rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 1rem;
}
.doc-head h1 {
  margin: 0 0 0.6rem;
  color: var(--text-strong);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.2;
}
.doc-head .eyebrow + h1 {
  margin-top: 0.2rem;
}
.doc-lede {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.08rem;
}
.doc-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.doc-section > .section-head h2 {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 1.3rem;
  line-height: 1.3;
}
.doc-note {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ── 홈 ── */
.home-wrap {
  width: min(42rem, calc(100% - 2rem));
  margin: 0 auto;
}
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(36rem, calc(100% - 2rem));
  min-height: calc(min(56dvh, 34rem) + var(--bar-height));
  margin: 0 auto;
  padding: calc(4rem + var(--bar-height)) 0 4.5rem;
}
/* 이름 묶음: 그림 · 싱할라 법명(가사색) · 사이트 이름(· 부제). 그림 · 이름 꼴은 사이트(번역 사이트 .home-wheel · .home-wordmark · .home-tagline, waharakadhamma .home-emblem · .home-wordmark). */
.home-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  text-align: center;
}
/* 법명 색(--brand)은 사이트 CSS 가 칠한다. */
.home-monk {
  margin: 0 0 0.2rem;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.3;
}
.home-hero .search-block {
  width: 100%;
  margin: 0;
}
.home-hero .search-field {
  display: flex;
  gap: 0.1rem;
  align-items: center;
  height: 3.25rem;
  padding: 0 0.25rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-raised);
  transition:
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}
.home-hero .search-field:hover {
  box-shadow: var(--shadow-low);
}
.home-hero .search-field:focus-within {
  border-color: transparent;
  box-shadow: var(--shadow-mid);
  outline: 2px solid var(--focus-color);
  outline-offset: 0;
}
.home-hero .search-field input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 0.4rem;
  border: 0;
  background: transparent;
  font-size: 1.05rem;
}
.home-hero .search-field input[type="search"]:focus-visible {
  outline: 0;
}
.home-hero .submit-search {
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  color: var(--text-muted);
  background: transparent;
}
.home-hero .submit-search:hover {
  color: var(--text-strong);
  background: var(--surface-sunken);
}
/* 이어서 줄(이어 읽기 · 이어 듣기): 검색창 아래, 기록이 있을 때만. 자리는 늘 지켜 가운데 맞춘 이름 · 검색창이 움직이지 않는다. */
.home-resume {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 2.75rem;
  margin-top: 0.75rem;
  margin-bottom: -3.5rem;
}
.home-resume .home-resume-link {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  max-width: 100%;
  min-height: 2.75rem;
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
}
.home-resume-link .icon {
  flex: none;
  width: 1rem;
  height: 1rem;
}
.home-resume-label {
  flex: none;
  font-weight: 650;
}
.home-resume-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-resume-from {
  flex: none;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.home-resume-link:hover .home-resume-title {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}
.home-band {
  padding: 1.4rem 0;
  border-top: 1px solid var(--border);
}
.home-band-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
  align-items: baseline;
}
.home-scale {
  margin: 0;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.home-band .home-how {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  color: var(--text-strong);
  text-underline-offset: 0.3em;
}
.home-how .icon {
  width: 1rem;
  height: 1rem;
}
.home-collections {
  padding: 2.8rem 0 1rem;
}
.home-collections-head {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
}
.home-collections h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.4rem;
  line-height: 1.3;
}
.home-collections-head a {
  flex: none;
  white-space: nowrap; /* 싱할라 글이 길어도 링크는 한 줄(waharakadhamma 11-30) */
  color: var(--text-strong);
  text-underline-offset: 0.3em;
}
.home-source {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.home-source a {
  color: inherit;
  text-underline-offset: 0.3em;
}
.home-groups {
  display: grid;
  gap: 1.8rem;
  margin-top: 1.2rem;
}
.home-groups h3 {
  margin: 0 0 0.2rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 650;
}
.home-groups ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.home-groups li > a,
.home-collection-off {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-strong);
  text-decoration: none;
}
.home-collection-off {
  color: var(--text-muted);
}
.home-groups a:hover .home-collection-name {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}
.home-collection-label {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
.collection-id {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.home-collection-count {
  flex: none;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── 모든 법문: 카드 격자 ── */
.collections-section {
  padding: 1.6rem 0 0.4rem;
}
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.7rem;
}
.collection-grid .collection-card {
  display: grid;
  align-content: start;
  gap: 0.2rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  color: inherit;
  background: var(--surface);
  text-align: left;
  text-decoration: none;
}
.collection-grid a.collection-card:hover {
  color: inherit;
  border-color: var(--border-strong);
  box-shadow: var(--shadow-mid);
}
.collection-card .name {
  color: var(--text-strong);
  font-weight: 750;
}
.collection-card .series,
.collection-card .count {
  color: var(--text-muted);
  font-size: 0.87rem;
}
.collection-card[data-off] .name {
  color: var(--text-muted);
}


@media (max-width: 48rem) {
  .home-hero {
    min-height: calc(min(48dvh, 26rem) + var(--bar-height));
    padding: calc(2.5rem + var(--bar-height)) 0 3rem;
  }
}

/* ── 사용 설명: 눌러 보며 배우기(guide/tour.tsx, 시안 presentations/guide-c) ── */
.guide-start {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  margin: 1.6rem 0 0;
  padding: 1rem 1.2rem;
  border: 0;
  border-radius: 0.9rem;
  color: var(--accent-text);
  background: var(--accent);
  text-align: left;
}
.guide-start:hover {
  background: var(--accent-hover);
}
.guide-start-title {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 700;
}
.guide-start-sub {
  color: rgb(255 255 255 / 85%);
  font-size: 0.95rem;
}
.guide-try {
  padding: 0;
  border: 0;
  color: var(--accent);
  background: none;
  font-weight: 650;
  white-space: nowrap;
}
.guide-try:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* 투어 층: 화면 전체를 덮고, 안에서 가짜 화면이 스스로 굴러간다 */
.gt-layer {
  position: fixed;
  z-index: 1000;
  inset: 0;
  isolation: isolate;
}
.gt-scroller {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
}
.tour {
  position: fixed;
  z-index: 100;
  inset: 0;
  pointer-events: none;
}
.tour-dim {
  position: fixed;
  /* 옅게: 밝힌 곳이 전체 화면 어디쯤인지 둘레가 보여야 한다. 눈길은 테두리 맥박이 끈다. */
  background: rgb(15 17 19 / 38%);
  pointer-events: auto;
  transition: all 260ms ease;
}
/* 접은 동안: 어둡게 덮지 않고 테두리만 남긴다(눌러도 아무 일 없게 막은 그대로) */
.tour.is-folded .tour-dim {
  background: transparent;
}
.tour-ring {
  position: fixed;
  border-radius: 0.6rem;
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 6px var(--accent);
  pointer-events: none;
  transition: all 260ms ease;
  animation: tour-pulse 1.1s ease-out 300ms 2;
}
@keyframes tour-pulse {
  0% {
    box-shadow:
      0 0 0 3px #fff,
      0 0 0 6px var(--accent),
      0 0 0 6px rgb(26 93 200 / 55%);
  }
  100% {
    box-shadow:
      0 0 0 3px #fff,
      0 0 0 6px var(--accent),
      0 0 0 22px rgb(26 93 200 / 0%);
  }
}
.tour-card {
  position: fixed;
  width: min(25rem, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  overflow: auto;
  padding: 1.1rem 1.15rem 1rem;
  border-radius: 0.9rem;
  background: var(--surface-raised);
  box-shadow: 0 0.8rem 2.4rem rgb(0 0 0 / 28%);
  pointer-events: auto;
  transition:
    top 260ms ease,
    left 260ms ease;
}
.tour-card.is-wide {
  width: min(36rem, calc(100vw - 1.5rem));
}
/* 휴대전화: 화면 끝에 붙는 낮은 띠. 처음엔 첫 문단만, 나머지는 '더 보기'로 */
@media (max-width: 40rem) {
  .tour-card,
  .tour-card.is-wide {
    width: calc(100vw - 1.5rem);
    padding: 0.85rem 0.95rem 0.75rem;
  }
  .tour-progress {
    margin: -0.2rem 0 0.6rem;
  }
  .tour-card h2 {
    font-size: 1.1rem;
  }
  .tour-body {
    margin-top: 0.3rem;
    font-size: 1rem;
    line-height: 1.6;
  }
  .tour-body .tour-try {
    margin-top: 0.4rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.95rem;
  }
  .tour-nav {
    margin-top: 0.6rem;
  }
  .tour-nav .tour-btn {
    min-height: 2.75rem;
    padding: 0.4rem 1rem;
    font-size: 1rem;
  }
}
.tour-card.is-compact .tour-body > :not(:first-child):not(.tour-try):not(.tour-more) {
  display: none;
}
.tour-card.is-compact .tour-body > :first-child {
  margin-bottom: 0;
}
.tour-more {
  min-height: 2.5rem;
  margin: 0.15rem 0 -0.4rem;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: none;
  font-size: 0.98rem;
  font-weight: 650;
}
.tour-more:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
/* 접은 설명: 한 줄 띠 */
.tour-card.is-folded {
  width: auto;
  padding: 0;
  border-radius: 999px;
}
.tour-unfold {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-height: 3rem;
  padding: 0.45rem 1.2rem 0.45rem 0.95rem;
  border: 0;
  border-radius: 999px;
  color: var(--text-strong);
  background: none;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
}
.tour-unfold .icon {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--accent);
}
.tour-unfold span {
  display: grid;
  line-height: 1.3;
}
.tour-unfold small {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}
.tour-unfold:hover {
  color: var(--accent);
}
.tour-progress {
  height: 4px;
  margin: -0.35rem 0 0.8rem;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-sunken);
}
.tour-progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 260ms ease;
}
.tour-head {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.tour-count {
  flex: none;
  margin-top: 0.15rem;
  color: var(--text-faint);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.tour-card h2 {
  flex: 1;
  margin: 0;
  color: var(--text-strong);
  font-size: 1.25rem;
  line-height: 1.4;
}
.tour-x {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin: -0.35rem -0.45rem 0 0;
  border: 0;
  border-radius: 999px;
  color: var(--text-muted);
  background: none;
}
.tour-x:hover {
  color: var(--text-strong);
  background: var(--surface-sunken);
}
.tour-body {
  margin: 0.5rem 0 0;
  font-size: 1.08rem;
  line-height: 1.65;
}
.tour-body p {
  margin: 0 0 0.5rem;
}
.tour-body ul {
  margin: 0 0 0.5rem;
  padding-left: 1.2rem;
}
.tour-body li + li {
  margin-top: 0.3rem;
}
.tour-body kbd {
  display: inline-block;
  min-width: 1.6rem;
  padding: 0 0.35rem;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 0.3rem;
  color: var(--text);
  background: var(--surface-raised);
  font: inherit;
  font-size: 0.85em;
  line-height: 1.5;
  text-align: center;
}
.tour-body .tour-try {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin: 0.6rem 0 0;
  padding: 0.5rem 0.7rem;
  border-radius: 0.5rem;
  color: #0b2a55;
  background: var(--accent-soft);
  font-size: 1rem;
  font-weight: 600;
}
.tour-body .tour-try.is-done {
  color: var(--ok);
  background: var(--ok-soft);
}
.tour-body .tour-why {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 0.7rem 0 0;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  color: #4a3209;
  background: var(--amber-soft);
  font-size: 1rem;
}
.tour-why b {
  flex: none;
  padding: 0 0.45rem;
  border-radius: 0.3rem;
  color: #fff;
  background: var(--amber);
  font-size: 0.85rem;
  line-height: 1.7;
}
.tour-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 1rem;
}
.tour-nav .gap {
  flex: 1;
}
.tour-nav .tour-btn {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.5rem 1.15rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-raised);
  font-size: 1.05rem;
  font-weight: 650;
  text-decoration: none;
}
.tour-nav .tour-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.tour-nav .tour-btn.is-primary {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}
.tour-nav .tour-btn.is-primary:hover {
  color: #fff;
  background: var(--accent-hover);
}
.tour-link,
.tour-link-btn {
  color: var(--text-muted);
  font-size: 0.98rem;
}
.tour-link-btn {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
.gt-free {
  position: fixed;
  z-index: 90;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.gt-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.9rem;
  padding: 0.4rem 1.1rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--text-strong);
  box-shadow: var(--shadow-mid);
  font-size: 1rem;
  font-weight: 650;
}
.gt-pill.is-quiet {
  border: 1px solid var(--border-strong);
  color: var(--text-strong);
  background: var(--surface-raised);
}

@media (prefers-reduced-motion: reduce) {
  .tour-dim,
  .tour-ring,
  .tour-card,
  .tour-progress i {
    transition: none;
  }
  .tour-ring {
    animation: none;
  }
}
