/* ==========================================================
   판타지아카이브 v2 — 전문 뷰어급 디자인 시스템
   UI: Pretendard / 본문: Gowun Batang·Noto Sans KR
   ========================================================== */

:root {
  /* 라이트 (기본) — 저채도 웜 화이트, 고대비 잉크 */
  --bg: #f7f4ee;
  --bg-deep: #efeae0;
  --paper: #fffdf8;
  --paper-edge: #e6dfd2;
  --ink: #221c14;
  --ink-soft: #55483a;
  --ink-faint: #92836f;
  --accent: #8a5a2b;
  --accent-strong: #6e4218;
  --gold: #b08d3f;
  --line: #ddd4c2;
  --shadow: 0 1px 4px rgba(60, 45, 25, 0.08), 0 4px 16px rgba(60, 45, 25, 0.07);
  --shadow-lift: 0 4px 10px rgba(60, 45, 25, 0.12), 0 12px 32px rgba(60, 45, 25, 0.14);
  --radius: 12px;
  --font-ui: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-serif: "Gowun Batang", "Noto Serif KR", "Apple SD Gothic Neo", "Malgun Gothic", serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.35s;
  --section-gap: clamp(40px, 7vw, 64px);
}

[data-theme="dark"] {
  --bg: #191511;
  --bg-deep: #120f0c;
  --paper: #221d17;
  --paper-edge: #352d23;
  --ink: #ece3d2;
  --ink-soft: #bfb19a;
  --ink-faint: #82735c;
  --accent: #d3a45a;
  --accent-strong: #e6bc76;
  --gold: #c9a75a;
  --line: #3a3226;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lift: 0 4px 10px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  min-height: 100dvh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; display: block; }
button { font-family: var(--font-ui); -webkit-tap-highlight-color: transparent; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 640px) { .wrap { padding: 0 14px; } }

/* ---------- 헤더 ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.14rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--accent-strong); }
.brand img { width: 27px; height: 27px; }

.main-nav { display: flex; gap: 2px; margin-left: auto; }
.main-nav a {
  padding: 8px 13px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 0.94rem;
  font-weight: 600;
}
.main-nav a:hover { background: var(--bg-deep); color: var(--ink); }
.main-nav a.active { color: var(--accent-strong); box-shadow: inset 0 -2px 0 var(--gold); }

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 9px;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  margin-left: auto;
}

.theme-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  width: 37px;
  height: 37px;
  font-size: 1rem;
  cursor: pointer;
  flex: 0 0 auto;
}
.theme-btn:hover { border-color: var(--accent); }

@media (max-width: 640px) {
  .brand { font-size: 1.02rem; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 10px 14px 14px;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-lift);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; font-size: 0.95rem; width: 100%; }
  .site-header { position: sticky; }
  .site-header .wrap { position: relative; flex-wrap: wrap; }
  .theme-btn { margin-left: 8px; }
}

/* ---------- 공통 ---------- */
.section { margin: var(--section-gap) 0; }
.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 3vw, 1.3rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 18px;
}
.section-title.rule-both {
  flex: 1;
  align-items: center;
}
.section-title.rule-both::before,
.section-title.rule-both::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), color-mix(in srgb, var(--gold) 35%, var(--line)));
}
.section-title.rule-both::after {
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 35%, var(--line)), var(--line), transparent);
}
.section-title small { color: var(--ink-faint); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: none; }

.ornament { text-align: center; color: var(--gold); letter-spacing: 0.6em; margin: 26px 0; font-size: 0.9rem; user-select: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-ui);
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
}
.btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fdf8ec; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fdf8ec; }
.btn.small { padding: 7px 13px; min-height: 36px; font-size: 0.87rem; }

.tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
  margin: 2px 3px 2px 0;
  background: var(--bg-deep);
}
.empty-note { text-align: center; color: var(--ink-faint); padding: 40px 0; }

/* ---------- 히어로 ---------- */
.site-header .live-stats {
  display: block;
  width: 100%;
  border-top: 1px solid rgba(138, 90, 43, 0.22);
  background: #1f1810;
  color: #f3ebe0;
}
.live-stats-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
}
.live-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #d9cbb8;
}
.live-stat .live-label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: #b8a68e;
}
.live-stat strong {
  font-variant-numeric: tabular-nums;
  font-size: 1.12rem;
  color: #fff8ee;
  font-weight: 700;
  min-width: 1.2em;
}
.live-stat .live-unit {
  font-size: 0.78rem;
  color: #b8a68e;
}
.live-stats .live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3dd67a;
  box-shadow: 0 0 0 3px rgba(61, 214, 122, 0.25);
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}
.live-stats[data-tone="err"] .live-dot {
  background: #d4a24a;
  box-shadow: none;
  animation: none;
}
@media (max-width: 560px) {
  .live-stats-inner { gap: 0.4rem 1rem; }
  .live-stat strong { font-size: 1rem; }
}

.hero {
  text-align: center;
  padding: 54px 20px 44px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse at center top, color-mix(in srgb, var(--gold) 10%, transparent), transparent 68%);
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 6vw, 2.9rem);
  letter-spacing: 0.1em;
  margin: 0 0 8px;
  font-weight: 700;
}
.hero h1 .gold { color: var(--gold); }
.hero p.tagline { color: var(--ink-soft); font-size: clamp(0.92rem, 2.8vw, 1.02rem); margin: 0 0 24px; }
.hero .deco { color: var(--gold); letter-spacing: 0.5em; margin-bottom: 14px; font-size: 1rem; }
@media (max-width: 640px) { .hero { padding: 38px 16px 32px; } }

/* ---------- 작품 카드 ---------- */
.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
@media (max-width: 640px) {
  .novel-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

.novel-card {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  display: flex;
  flex-direction: column;
}
.novel-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.novel-card .cover { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; border-bottom: 1px solid var(--paper-edge); }
.novel-card .body { padding: 13px 15px 15px; flex: 1; display: flex; flex-direction: column; }
.novel-card h3 { margin: 0 0 3px; font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.4; }
.novel-card h3 a { color: var(--ink); }
.novel-card h3 a:hover { color: var(--accent-strong); }
.novel-card .meta { font-size: 0.8rem; color: var(--ink-faint); margin-bottom: 7px; }
.novel-card .synopsis {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
@media (max-width: 640px) {
  .novel-card .body { padding: 10px 11px 12px; }
  .novel-card h3 { font-size: 0.93rem; }
  .novel-card .synopsis { -webkit-line-clamp: 2; font-size: 0.8rem; }
  .novel-card .tag { font-size: 0.7rem; padding: 2px 8px; }
}

.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fdf8ec;
  margin-left: 6px;
  vertical-align: 2px;
}
.status-badge.done { background: var(--ink-faint); }

/* ---------- 최신 업데이트 ---------- */
.update-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.update-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  transition: background 0.2s var(--ease-out);
}
.update-list li:hover { background: color-mix(in srgb, var(--gold) 6%, var(--bg-deep)); }
.update-list li:last-child { border-bottom: none; }
.update-list .novel-name { color: var(--ink-faint); font-size: 0.84rem; flex: 0 0 auto; font-family: var(--font-serif); }
.update-list .ch-link { flex: 1 1 auto; min-width: 180px; font-weight: 700; font-size: 0.95rem; font-family: var(--font-serif); }
.update-list .date { color: var(--ink-faint); font-size: 0.8rem; margin-left: auto; font-variant-numeric: tabular-nums; }
.update-list--single .ch-link { min-width: 0; }
.new-chip {
  display: inline-block;
  background: color-mix(in srgb, var(--accent-strong) 85%, #8b2500);
  color: #fdf8ec;
  font-size: 0.62rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 7px;
  margin-left: 6px;
  vertical-align: 2px;
  letter-spacing: 0.05em;
}
@media (max-width: 640px) {
  .update-list:not(.update-list--single) .novel-name { width: 100%; order: -1; margin-bottom: -6px; }
}

/* ---------- 검색 ---------- */
.search-bar { display: flex; gap: 10px; margin-bottom: 18px; }
.search-bar input {
  flex: 1;
  padding: 13px 17px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
}
.search-bar input:focus { outline: none; border-color: var(--accent); }
.unified-search-bar { max-width: 640px; }
.unified-search-bar .btn { flex-shrink: 0; }
.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.search-filters button {
  border: 1px solid var(--paper-edge);
  background: var(--paper);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: var(--font-ui);
}
.search-filters button.on {
  background: var(--accent);
  color: #fdf8ec;
  border-color: var(--accent);
}
.search-status {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 12px;
}
.unified-results { margin-bottom: 48px; }
.search-section { margin-bottom: 28px; }
.search-section-title {
  font-size: 1rem;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--paper-edge);
}
.search-section-title span {
  color: var(--accent);
  font-weight: 700;
}
.search-hit-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.search-hit a {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.search-hit a:hover {
  background: var(--paper);
  border-color: var(--paper-edge);
}
.search-hit strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text);
}
.search-hit p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}
.search-hit p mark {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--accent-strong);
  padding: 0 2px;
  border-radius: 2px;
}
.search-hit-meta {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}
.search-empty, .search-warn {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 16px 0;
}
.search-warn { color: #c0392b; }
.tag-filter { margin-bottom: 22px; }
.tag-filter .tag { cursor: pointer; user-select: none; padding: 6px 14px; font-size: 0.85rem; }
.tag-filter .tag.on { background: var(--accent); color: #fdf8ec; border-color: var(--accent); }

/* ---------- 작품 상세 ---------- */
.novel-detail {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 30px;
  margin-top: 34px;
}
@media (max-width: 680px) {
  .novel-detail { grid-template-columns: 1fr; gap: 18px; }
  .novel-detail .cover-col { max-width: 210px; margin: 0 auto; }
}
.novel-detail .cover-col img {
  border-radius: var(--radius);
  border: 1px solid var(--paper-edge);
  box-shadow: var(--shadow-lift);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  width: 100%;
}
.novel-detail h1 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 4.5vw, 1.75rem);
  font-weight: 700;
}
.novel-detail .byline { color: var(--ink-faint); margin-bottom: 12px; font-size: 0.93rem; }
.novel-detail .synopsis {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 16px 18px;
  color: var(--ink-soft);
  white-space: pre-line;
  font-size: 0.95rem;
  line-height: 1.75;
}
.novel-detail .actions { margin: 16px 0; display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 680px) {
  .novel-detail .actions .btn { flex: 1; }
}

.chapter-list { list-style: none; margin: 12px 0 0; padding: 0; }
.chapter-list li { border-bottom: 1px solid var(--line); }
.chapter-list a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 8px;
  color: var(--ink);
  font-size: 0.96rem;
}
.chapter-list a:hover { background: var(--bg-deep); color: var(--accent-strong); }
.chapter-list .no { color: var(--gold); font-size: 0.82rem; font-weight: 700; flex: 0 0 50px; }
.chapter-list .date { margin-left: auto; color: var(--ink-faint); font-size: 0.8rem; flex: 0 0 auto; }
.chapter-list .read-mark { color: var(--ink-faint); font-size: 0.75rem; }
.chapter-list .jump-mark {
  color: var(--accent-strong, #8a5a2b);
  font-size: 0.75rem;
  font-weight: 700;
}
.chapter-list li.is-jump-target {
  background: rgba(196, 165, 116, 0.18);
  outline: 1px solid rgba(196, 165, 116, 0.45);
}
.chapter-list li.is-jump-target a { background: transparent; }
@media (max-width: 640px) {
  .chapter-list .date { display: none; }
}

/* ---------- 공지 ---------- */
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-item {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.notice-item summary {
  cursor: pointer;
  padding: 15px 18px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  list-style: none;
  flex-wrap: wrap;
}
.notice-item summary::-webkit-details-marker { display: none; }
.notice-item summary:hover { background: var(--bg-deep); }
.notice-item .n-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fdf8ec;
  background: var(--gold);
  border-radius: 5px;
  padding: 2px 8px;
  flex: 0 0 auto;
}
.notice-item .n-title { font-weight: 700; font-size: 0.96rem; }
.notice-item .n-date { margin-left: auto; color: var(--ink-faint); font-size: 0.8rem; }
.notice-item .n-body {
  padding: 4px 18px 16px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  white-space: pre-line;
  font-size: 0.93rem;
  line-height: 1.8;
}

/* ---------- 푸터 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 60px;
  padding: 28px 0 36px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.84rem;
}
.site-footer .deco { color: var(--gold); letter-spacing: 0.5em; margin-bottom: 8px; }

/* ==========================================================
   뷰어 v2 — 전문 뷰어
   ========================================================== */

/* 독서 테마 (뷰어 전용, data-rtheme) */
[data-rtheme="white"] {
  --bg: #ffffff; --bg-deep: #f3f3f3; --paper: #ffffff; --paper-edge: #e5e5e5;
  --ink: #1c1c1c; --ink-soft: #4c4c4c; --ink-faint: #969696; --line: #e8e8e8;
}
[data-rtheme="sepia"] {
  --bg: #f3e7cf; --bg-deep: #eaddc0; --paper: #f8efdb; --paper-edge: #dbcba6;
  --ink: #3f3122; --ink-soft: #67553d; --ink-faint: #98876b; --line: #d9c9a5;
}
[data-rtheme="mint"] {
  --bg: #e3ebdd; --bg-deep: #d8e2d1; --paper: #ecf2e7; --paper-edge: #c8d5bf;
  --ink: #263020; --ink-soft: #4c5a43; --ink-faint: #7f8f74; --line: #c8d4be;
}
[data-rtheme="dark"] {
  --bg: #23211d; --bg-deep: #1b1916; --paper: #2b2823; --paper-edge: #3b372f;
  --ink: #d9d2c2; --ink-soft: #b0a790; --ink-faint: #7c745f; --line: #3d382e;
  --shadow: 0 2px 10px rgba(0,0,0,.35); --shadow-lift: 0 8px 24px rgba(0,0,0,.45);
}
[data-rtheme="black"] {
  --bg: #000000; --bg-deep: #111111; --paper: #121212; --paper-edge: #262626;
  --ink: #c9c9c9; --ink-soft: #a0a0a0; --ink-faint: #666666; --line: #222222;
  --shadow: none; --shadow-lift: 0 8px 24px rgba(0,0,0,.8);
}

#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  z-index: 100;
}

/* 상단 바 */
.viewer-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: transform 0.22s ease;
}
.viewer-topbar.hidden { transform: translateY(-102%); }
.viewer-topbar .wrap { display: flex; align-items: center; gap: 8px; min-height: 52px; }
.viewer-topbar .v-title {
  flex: 1;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-btn {
  border: none;
  background: none;
  color: var(--ink-soft);
  width: 42px; height: 42px;
  border-radius: 10px;
  font-size: 1.15rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.icon-btn:hover { background: var(--bg-deep); color: var(--ink); }

/* 하단 바 */
.viewer-bottombar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  transition: transform 0.22s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.viewer-bottombar.hidden { transform: translateY(102%); }
.viewer-bottombar .inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 6px 10px;
}
.vb-btn {
  border: none;
  background: none;
  color: var(--ink-soft);
  border-radius: 10px;
  min-width: 54px;
  padding: 6px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
}
.vb-btn .ic { font-size: 1.15rem; line-height: 1.2; }
.vb-btn:hover { background: var(--bg-deep); color: var(--ink); }
.vb-btn[aria-disabled="true"] { opacity: 0.3; pointer-events: none; }
.vb-progress {
  flex: 1;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  min-width: 60px;
}
.vb-progress b { color: var(--accent-strong); font-size: 0.95rem; }

.viewer-loading {
  text-align: center;
  color: var(--ink-faint);
  padding: 48px 16px;
  font-size: 0.95rem;
}
.viewer-error {
  text-align: center;
  padding: 40px 20px;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  margin-top: 24px;
}
.viewer-error-title { font-weight: 800; margin: 0 0 8px; color: var(--ink); }
.viewer-error-msg { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 16px; word-break: break-all; }
.viewer-error .btn { margin: 4px; }

/* 본문 */
.viewer-body {
  max-width: min(var(--reader-width, 680px), 100%);
  width: 100%;
  margin: 0 auto;
  padding: 76px 20px 110px;
  box-sizing: border-box;
}
.viewer-body h1.ch-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  text-align: center;
  margin: 24px 0 6px;
  font-weight: 700;
}
.viewer-body .ch-sub { text-align: center; color: var(--ink-faint); font-size: 0.84rem; margin-bottom: 40px; }

.viewer-content {
  font-family: var(--reader-font, var(--font-serif));
  font-size: var(--reader-size, 1.08rem);
  line-height: var(--reader-lh, 1.95);
  color: var(--ink);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y;
  max-width: 100%;
}
.viewer-content p.para-merged { margin-bottom: calc(var(--reader-para, 1.4em) * 1.05); }
.viewer-content p.para-merged br { line-height: 1.6; }
.viewer-content p.para-merged br + br { display: block; content: ""; margin-top: 0.55em; }
.viewer-content p,
.viewer-content mark,
.viewer-content h1 {
  -webkit-user-select: none;
  user-select: none;
}
.viewer-content figure.illust img {
  -webkit-user-drag: none;
  user-drag: none;
}
.viewer-content p { margin: 0 0 var(--reader-para, 1.4em); }
.viewer-content p.tts-now {
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  border-radius: 6px;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 16%, transparent);
}

/* 삽화 */
.viewer-content figure.illust { margin: 2.4em auto; text-align: center; }
.viewer-content figure.illust img {
  margin: 0 auto;
  max-height: 72vh;
  border-radius: 10px;
  border: 1px solid var(--paper-edge);
  box-shadow: var(--shadow-lift);
  cursor: zoom-in;
}
.viewer-content figure.illust figcaption { margin-top: 0.7em; font-size: 0.8rem; color: var(--ink-faint); font-family: var(--font-ui); }
.viewer-content figure.illust figcaption::before { content: "✦ "; color: var(--gold); }

/* 라이트박스 */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 6, 3, 0.93);
  display: none;
  align-items: center; justify-content: center; flex-direction: column;
  gap: 12px; padding: 24px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 86vh; border-radius: 8px; }
.lightbox .lb-caption { color: #cfc5ae; font-size: 0.88rem; }

/* 끝 카드 */
.end-card {
  margin-top: 56px;
  padding: 28px 22px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.end-card .deco { color: var(--gold); letter-spacing: 0.5em; margin-bottom: 10px; }
.end-card .end-title { font-size: 1.02rem; font-weight: 700; margin-bottom: 4px; }
.end-card .end-sub { color: var(--ink-faint); font-size: 0.85rem; margin-bottom: 16px; }
.end-card .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 640px) {
  .viewer-body {
    padding: 68px 16px calc(100px + env(safe-area-inset-bottom));
    max-width: 100%;
    width: 100%;
  }
  .viewer-content {
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: max(1.02rem, var(--reader-size, 1.08rem));
    letter-spacing: -0.01em;
  }
  .viewer-content p { margin-bottom: calc(var(--reader-para, 1.4em) * 0.75); }
  .viewer-content p.para-merged { margin-bottom: calc(var(--reader-para, 1.4em) * 0.9); }
  .viewer-content p.para-merged br + br { margin-top: 0.45em; }
  .viewer-topbar .v-title { font-size: 0.82rem; }
  body.page-mode .viewer-body,
  body.page-mode #chapters-root.paged {
    height: auto !important;
    overflow: visible !important;
    transform: none !important;
    column-width: auto !important;
    width: 100% !important;
  }
  .page-mobile-hint:not([hidden]) {
    display: block;
    margin: 0 0 12px;
    padding: 10px 12px;
    font-size: 0.82rem;
    color: var(--ink-soft);
    background: color-mix(in srgb, var(--gold) 10%, var(--paper));
    border: 1px solid var(--line);
    border-radius: 8px;
    line-height: 1.5;
  }
}

.page-mobile-hint[hidden] { display: none !important; }

@media (max-width: 640px) {
  .end-card .actions .btn { flex: 1; min-width: 130px; }
}

/* ---------- 설정 시트 ---------- */
.settings-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(15, 11, 5, 0.4);
  display: none;
}
.settings-backdrop.open { display: block; }

.reader-settings {
  position: fixed;
  z-index: 160;
  background: var(--paper);
  box-shadow: var(--shadow-lift);
  overflow-y: auto;
  overscroll-behavior: contain;
  /* 데스크탑: 우측 패널 */
  top: 0; right: 0; bottom: 0;
  width: min(340px, 92vw);
  border-left: 1px solid var(--paper-edge);
  transform: translateX(105%);
  transition: transform 0.25s ease;
  padding: 20px 22px 34px;
}
.reader-settings.open { transform: translateX(0); }

@media (max-width: 640px) {
  /* 모바일: 바텀 시트 */
  .reader-settings {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%;
    max-height: 76vh;
    border-left: none;
    border-top: 1px solid var(--paper-edge);
    border-radius: 18px 18px 0 0;
    transform: translateY(105%);
    padding: 14px 20px calc(30px + env(safe-area-inset-bottom));
  }
  .reader-settings.open { transform: translateY(0); }
  .reader-settings::before {
    content: "";
    display: block;
    width: 42px; height: 4px;
    border-radius: 999px;
    background: var(--line);
    margin: 0 auto 12px;
  }
}

.reader-settings h2 {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.reader-settings h2 button { border: none; background: none; color: var(--ink-faint); font-size: 1.15rem; cursor: pointer; padding: 6px; }

.set-row { margin-bottom: 18px; }
.set-row .set-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-faint);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.set-row .set-label .val { color: var(--accent-strong); font-variant-numeric: tabular-nums; }

.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  flex: 0 0 44px; height: 40px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--ink);
  border-radius: 10px;
  font-size: 1.05rem;
  cursor: pointer;
}
.stepper button:hover { border-color: var(--accent); color: var(--accent-strong); }
.stepper .bar { flex: 1; height: 6px; border-radius: 999px; background: var(--bg-deep); overflow: hidden; }
.stepper .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); }

.choice-group { display: flex; gap: 8px; flex-wrap: wrap; }
.choice-group button {
  flex: 1;
  min-width: 64px;
  padding: 10px 4px;
  border: 1.5px solid var(--line);
  background: var(--bg-deep);
  color: var(--ink-soft);
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.choice-group button.on { border-color: var(--accent); background: var(--accent); color: #fdf8ec; }

/* 테마 스와치 */
.theme-swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.theme-swatches button {
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 2px solid var(--line);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.theme-swatches button.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.sw-paper { background: #f7f4ee; color: #55483a; }
.sw-white { background: #ffffff; color: #4c4c4c; }
.sw-sepia { background: #f3e7cf; color: #67553d; }
.sw-mint  { background: #e3ebdd; color: #4c5a43; }
.sw-dark  { background: #23211d; color: #b0a790; }
.sw-black { background: #000000; color: #a0a0a0; }

/* TTS / 자동 스크롤 컨트롤 */
.util-row { display: flex; gap: 8px; }
.util-row .btn { flex: 1; }
.util-row .btn.on { background: var(--accent); border-color: var(--accent); color: #fdf8ec; }

/* ==========================================================
   A/C 기능 스타일
   ========================================================== */

.fav-mark { color: #d4a017; margin-left: 4px; font-size: 0.9em; }

.continue-grid, .stats-grid { display: grid; gap: 12px; }
.continue-grid { grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .continue-grid { grid-template-columns: 1fr 1fr; }
}
.continue-card, .stat-card {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  align-items: center;
}
.continue-card img {
  width: 56px; height: 74px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--paper-edge);
  flex: 0 0 auto;
}
.continue-card .info { flex: 1; min-width: 0; }
.continue-card h3 { margin: 0 0 4px; font-size: 1rem; }
.continue-card h3 a { color: var(--ink); }
.continue-card .meta { font-size: 0.82rem; color: var(--ink-faint); margin-bottom: 8px; }
.prog-bar {
  height: 5px;
  background: var(--bg-deep);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.prog-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); }

.stats-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 520px) { .stats-grid { grid-template-columns: 1fr 1fr; } }
.stat-card { flex-direction: column; align-items: flex-start; gap: 4px; }
.stat-card .num { font-size: 1.35rem; font-weight: 800; color: var(--accent-strong); }
.stat-card .lbl { font-size: 0.8rem; color: var(--ink-faint); font-weight: 600; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.section-head .section-title { margin: 0; }

/* ---------- 세계관 스튜디오 홈 배너 ---------- */
.studio-promo-section { margin-top: var(--section-gap); }
.studio-promo {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(20px, 4vw, 36px);
  align-items: center;
  padding: clamp(22px, 4vw, 32px);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, var(--paper)), var(--paper));
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}
.studio-kicker {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.studio-promo .section-title { margin: 0 0 10px; text-align: left; }
.studio-desc {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 42ch;
}
.studio-features {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.studio-features li { margin-bottom: 4px; }
.studio-promo-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 120px;
}
.studio-icon {
  font-size: 3.2rem;
  color: var(--accent);
  opacity: 0.85;
  line-height: 1;
}
.studio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 140px;
}
.studio-tags em {
  font-style: normal;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg));
  color: var(--accent-strong);
  font-weight: 600;
}
@media (max-width: 720px) {
  .studio-promo { grid-template-columns: 1fr; }
  .studio-promo-visual { flex-direction: row; justify-content: flex-start; max-width: none; }
  .studio-tags { max-width: none; justify-content: flex-start; }
}

mark.hl {
  background: color-mix(in srgb, #f1c40f 45%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  cursor: pointer;
}
[data-rtheme="dark"] mark.hl,
[data-rtheme="black"] mark.hl {
  background: color-mix(in srgb, #f1c40f 35%, transparent);
}

.sel-toolbar {
  position: fixed;
  z-index: 180;
  display: flex;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  box-shadow: var(--shadow-lift);
  padding: 4px;
}
.sel-toolbar[hidden],
.side-panel[hidden],
.term-pop[hidden],
.page-nav[hidden],
.page-indicator[hidden] { display: none !important; }
.sel-toolbar button {
  border: none;
  background: var(--bg-deep);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-ui);
}
.sel-toolbar button:hover { background: var(--accent); color: #fdf8ec; }

.quote-card {
  margin: 0 0 1.1em;
  padding: 16px 20px;
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--paper));
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: "Gowun Batang", "Noto Serif KR", serif;
}
.quote-card .quote-text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.85;
  font-style: italic;
  color: var(--ink);
}
.post-body .quote-card + p { margin-top: 0.8em; }

.side-panel {
  position: fixed;
  top: 56px; right: 10px;
  width: min(300px, calc(100vw - 20px));
  max-height: 60vh;
  overflow: auto;
  z-index: 90;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
  padding: 12px;
}
.side-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  margin-bottom: 8px;
}
.side-head button { border: none; background: none; color: var(--ink-faint); cursor: pointer; font-size: 1.1rem; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.side-list a { flex: 1; color: var(--ink); font-size: 0.88rem; }
.side-list a small { display: block; color: var(--ink-faint); margin-top: 2px; }
.bm-del {
  border: none;
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 0.78rem;
  flex: 0 0 auto;
}

.term,
.glossary-link {
  border-bottom: 1px dashed var(--gold);
  cursor: pointer;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: color-mix(in srgb, var(--gold) 30%, transparent);
}
.term:active,
.glossary-link:active { background: color-mix(in srgb, var(--gold) 18%, transparent); border-radius: 2px; }
.write-hint {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--ink-faint);
  line-height: 1.5;
}
.write-hint code {
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-deep);
  color: var(--accent-strong);
}
.term-pop {
  position: fixed;
  z-index: 200;
  width: min(250px, calc(100vw - 20px));
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  box-shadow: var(--shadow-lift);
  padding: 12px 14px;
}
.term-close {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: var(--bg-deep);
  color: var(--ink-faint);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
}
.term-name { font-weight: 800; margin-bottom: 4px; color: var(--accent-strong); padding-right: 0; }
.term-body { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.55; }

@media (max-width: 640px) {
  .term-pop-mobile {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    padding: 16px 44px 16px 16px;
    border-radius: 14px;
    max-height: min(42vh, 280px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .term-pop-mobile .term-close { display: block; }
  .term-pop-mobile .term-name { padding-right: 24px; }
}

body.page-mode { overflow: hidden; }
body.page-mode .viewer-body {
  overflow: hidden;
  height: 100vh;
  padding-top: 10px;
  padding-bottom: 10px;
  display: flex;
  justify-content: center;
}
#chapters-root.paged {
  overflow: hidden;
  column-fill: auto;
  will-change: transform;
}
.page-nav {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  pointer-events: none;
}
.page-nav button { pointer-events: auto; }
.page-nav button {
  border: none;
  background: transparent;
  cursor: pointer;
}
.page-indicator {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.voice-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.chapter-block { margin-bottom: 8px; }

.me-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.me-tabs button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: var(--font-ui);
}
.me-tabs button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdf8ec;
}
.me-panel { display: none; }
.me-panel.on { display: block; }

.hl-list, .bm-page-list { list-style: none; margin: 0; padding: 0; }
.hl-list li, .bm-page-list li {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.hl-list .quote {
  font-family: var(--font-serif);
  margin: 6px 0;
  padding-left: 10px;
  border-left: 3px solid var(--gold);
  color: var(--ink-soft);
}
.hl-list .memo { font-size: 0.86rem; color: var(--accent-strong); }
.meta-line { font-size: 0.8rem; color: var(--ink-faint); }

.fav-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-ui);
  min-height: 44px;
}
.fav-btn.on { color: #d4a017; border-color: #d4a017; }

/* Coupang Partners banner */
.coupang-banner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 20px auto;
  width: 100%;
  max-width: 700px;
  min-height: 140px;
}
.coupang-banner {
  width: 100%;
  max-width: 680px;
  min-height: 140px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.coupang-banner-note {
  margin: 0;
  font-size: 0.72rem;
  color: var(--ink-faint, #999);
  text-align: center;
  line-height: 1.4;
}
@media (max-width: 720px) {
  .coupang-banner-wrap {
    margin: 16px auto;
    padding: 0 8px;
  }
  .coupang-banner {
    max-width: 100%;
    overflow-x: auto;
  }
}

.pwa-banner {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  padding: 12px 14px;
  width: min(420px, calc(100vw - 24px));
  align-items: center;
  gap: 10px;
}
.pwa-banner.show { display: flex; }
.pwa-banner p { margin: 0; flex: 1; font-size: 0.88rem; }

/* ==========================================================
   홈페이지 — 쇼케이스 레이아웃
   ========================================================== */

.notice-strip {
  background: color-mix(in srgb, var(--gold) 12%, var(--paper));
  border-bottom: 1px solid var(--line);
}
.notice-strip-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 0.88rem;
}
.notice-strip-inner a {
  flex: 1;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notice-strip-inner button {
  border: none;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
}

.hero--showcase {
  text-align: left;
  padding: clamp(40px, 7vw, 64px) 0;
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: clamp(24px, 5vw, 40px);
  align-items: start;
}
.hero-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--paper-edge);
  box-shadow: var(--shadow-lift);
  transition: transform 0.4s var(--ease-out);
}
.hero-cover-col a:hover .hero-cover { transform: scale(1.02); }
.hero-copy .deco { text-align: left; letter-spacing: 0.35em; opacity: 0.75; margin-bottom: 8px; }
.hero-kicker {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
}
.hero--showcase h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: 0.04em;
  margin: 0 0 6px;
  line-height: 1.3;
}
.hero-byline { margin: 0 0 14px; color: var(--ink-faint); font-size: 0.9rem; }
.hero--showcase .tagline {
  text-align: left;
  margin: 0 0 14px;
  max-width: 52ch;
  font-family: var(--font-serif);
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-tags { margin-bottom: 16px; }
.hero-progress { margin-bottom: 16px; max-width: 320px; }
.hero-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.hero-latest { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }
.hero-copy--center { text-align: center; margin: 0 auto; max-width: 480px; }

.chapter-spotlight {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.spotlight-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 6px;
}
.chapter-spotlight h2 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 3vw, 1.35rem);
}
.chapter-spotlight h2 a { color: var(--ink); }
.spotlight-date { margin: 0 0 14px; color: var(--ink-faint); font-size: 0.85rem; }

.continue-card--start { border-left: 3px solid var(--gold); }
.start-hint {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-skeleton {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  animation: pulse 1.2s ease-in-out infinite;
}
.sk-cover {
  aspect-ratio: 3/4;
  background: var(--bg-deep);
  border-radius: var(--radius);
}
.sk-lines { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; }
.sk-line { height: 14px; background: var(--bg-deep); border-radius: 6px; }
.sk-line.wide { height: 28px; width: 70%; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.hero.loaded .hero-inner { animation: fade-up 0.6s var(--ease-out) both; }

.site-footer {
  margin-top: clamp(56px, 10vw, 80px);
  padding: 36px 0 44px;
  text-align: center;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg-deep) 40%, transparent));
}
.footer-brand { font-family: var(--font-serif); color: var(--ink-soft); }
.footer-links { margin-top: 10px; font-size: 0.88rem; color: var(--ink-faint); }
.footer-links a { border-bottom: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }

.pwa-banner {
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 680px) {
  .hero-inner,
  .hero-skeleton { grid-template-columns: 1fr; }
  .hero-cover-col { max-width: 180px; margin: 0 auto; }
  .hero-copy { text-align: center; }
  .hero-copy .deco,
  .hero--showcase .tagline { text-align: center; margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-progress { margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hero.loaded .hero-inner { animation: none; }
  .hero-skeleton { animation: none; }
}

/* ===== 회원 / 댓글 ===== */
.auth-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.auth-nav .auth-nick {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-page {
  padding: 48px 16px 80px;
  display: flex;
  justify-content: center;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 8px; font-size: 1.5rem; }
.auth-sub { color: var(--muted); margin: 0 0 20px; font-size: 0.92rem; }
.auth-form { display: grid; gap: 14px; }
.auth-form label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}
.auth-form input {
  padding: 10px 12px;
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.auth-error {
  color: #c0392b;
  font-size: 0.88rem;
  margin: 0;
}
.auth-foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.chapter-poll {
  margin: 32px auto 0;
  padding: 20px 0;
  border-top: 1px solid var(--paper-edge);
  text-align: center;
}
.poll-title {
  font-size: 1.05rem;
  margin: 0 0 12px;
  color: var(--text);
}
.poll-stars {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 8px;
}
.poll-star {
  border: none;
  background: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--paper-edge);
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.15s, transform 0.1s;
}
.poll-star.on { color: #f1c40f; }
.poll-star:hover { transform: scale(1.12); }
.poll-summary {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.poll-login-hint {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.comments-panel {
  margin: 32px auto 120px;
  padding: 20px 0 0;
  border-top: 1px solid var(--paper-edge);
}
.comments-title {
  font-size: 1.1rem;
  margin: 0 0 14px;
}
.comments-title span {
  color: var(--accent);
  font-weight: 700;
}
.comment-login-hint {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 12px;
}
.comment-form {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.comment-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  background: var(--paper);
  color: var(--text);
  font: inherit;
  resize: vertical;
  min-height: 72px;
}
.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.comment-item {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  padding: 12px 14px;
}
.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.comment-meta b { color: var(--text); font-size: 0.9rem; }
.comment-meta .comment-del {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 6px;
}
.comment-meta .comment-del:hover { color: #c0392b; }
.comment-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  font-size: 0.95rem;
}
.comment-empty {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 8px 0;
}

@media (max-width: 760px) {
  .site-header .wrap { flex-wrap: wrap; }
  .auth-nav { order: 4; width: 100%; justify-content: flex-end; margin-top: 4px; }
}

/* ===== 커뮤니티 / 게시판 ===== */
.community-page { padding: 28px 16px 80px; max-width: 820px; }
.community-head h1 { margin: 0 0 6px; font-size: 1.6rem; }
.community-sub { color: var(--muted); margin: 0 0 20px; font-size: 0.95rem; }
.community-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.community-tabs button {
  padding: 8px 16px;
  border: 1px solid var(--paper-edge);
  border-radius: 999px;
  background: var(--paper);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.community-tabs button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdf8ec;
}
.community-tabs button:disabled { opacity: 0.45; cursor: not-allowed; }
.board-intro {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  background: var(--paper);
}
.board-intro h2 { margin: 0 0 6px; font-size: 1.15rem; }
.board-intro p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.board-intro.suggest-intro {
  border-color: rgba(45, 140, 180, 0.35);
  background: linear-gradient(135deg, rgba(45, 140, 180, 0.08), transparent);
}
.tag-board {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 7px;
  margin-right: 6px;
  border-radius: 4px;
  vertical-align: middle;
  font-weight: 600;
}
.tag-board.free { background: #6b7c3a; color: #fdf8ec; }
.tag-board.suggest { background: #2d6f8c; color: #f0f8fc; }
.board-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.board-count { color: var(--muted); font-size: 0.9rem; }
.board-write {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.board-write h2 { margin: 0 0 12px; font-size: 1.1rem; }
.board-write input,
.board-write textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  margin-bottom: 10px;
}
.board-write-actions { display: flex; gap: 8px; justify-content: flex-end; }
.board-list { list-style: none; margin: 0; padding: 0; }
.board-item {
  border-bottom: 1px solid var(--paper-edge);
}
.board-link {
  display: block;
  padding: 14px 4px;
  color: inherit;
  text-decoration: none;
}
.board-link:hover h3 { color: var(--accent-strong); }
.board-item h3 { margin: 0 0 6px; font-size: 1.05rem; }
.board-preview {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.board-meta {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}
.board-empty { color: var(--muted); padding: 24px 4px; text-align: center; }
.board-pager { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.breadcrumb {
  margin: 12px 0 20px;
  font-size: 0.88rem;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.back-link:hover { color: var(--accent); }
.post-view {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  padding: 24px 20px;
}
.post-head h1 { margin: 0 0 12px; font-size: 1.35rem; line-height: 1.45; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--paper-edge);
}
.post-meta #del-post { margin-left: auto; }
.post-body { line-height: 1.85; font-size: 1rem; word-break: break-word; }
.post-replies { margin-top: 28px; }
.post-replies h2 { font-size: 1.1rem; margin: 0 0 14px; }
.post-replies h2 span { color: var(--accent); }
.reply-list { list-style: none; margin: 0; padding: 0; }
.reply-item {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  margin-left: calc(var(--depth, 0) * 20px);
}
.reply-children { list-style: none; margin: 10px 0 0; padding: 0; }
.reply-to-btn {
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 6px;
}
.reply-form-actions { display: flex; gap: 8px; justify-content: flex-end; }
.novel-board-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
}
.novel-board-cover { width: 52px; height: 68px; object-fit: cover; border-radius: 6px; }
.novel-board-head h2 { margin: 0 0 4px; font-size: 1.1rem; }
.novel-board-head p { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* 팬아트 게시판 */
.fanart-panel { max-width: 960px; }
.fanart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.fanart-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.fanart-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.fanart-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg);
}
.fanart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fanart-card-body { padding: 10px 12px; }
.fanart-card-body h3 {
  margin: 0 0 6px;
  font-size: 0.92rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fanart-card-body .board-meta { font-size: 0.78rem; }
.fanart-write {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  background: var(--paper);
}
.fanart-drop {
  display: block;
  margin-bottom: 12px;
  cursor: pointer;
}
.fanart-drop-inner {
  border: 2px dashed var(--paper-edge);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.fanart-drop:hover .fanart-drop-inner,
.fanart-drop.drag .fanart-drop-inner {
  border-color: var(--accent);
  background: rgba(138, 90, 43, 0.04);
}
.fanart-drop-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.fanart-drop-text { display: block; font-size: 0.95rem; margin-bottom: 4px; }
.fanart-drop-hint { display: block; font-size: 0.8rem; color: var(--muted); }
.fanart-preview {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--bg);
}
.fanart-write input,
.fanart-write textarea {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
  font: inherit;
  background: var(--bg);
  color: inherit;
  box-sizing: border-box;
}
.fanart-full {
  margin: 0 0 16px;
  text-align: center;
}
.fanart-full img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--paper-edge);
}
.post-body.fanart-caption {
  margin-top: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* 독서 모임 */
.party-panel { max-width: 720px; }
.party-room-list { list-style: none; margin: 0; padding: 0; }
.party-room-item {
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--paper);
}
.party-room-link {
  display: block;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
}
.party-room-link:hover h3 { color: var(--accent-strong); }
.party-room-item h3 { margin: 0 0 6px; font-size: 1.05rem; }
.party-room-meta { color: var(--muted); font-size: 0.85rem; display: flex; gap: 12px; flex-wrap: wrap; }
.party-gate {
  text-align: center;
  padding: 32px 20px;
  border: 1px dashed var(--paper-edge);
  border-radius: var(--radius);
  background: var(--paper);
}
.party-gate h3 { margin: 0 0 8px; }
.party-gate p { color: var(--muted); margin: 0 0 16px; font-size: 0.92rem; }
.party-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.party-chat-head h2 { margin: 0; font-size: 1.15rem; flex: 1; }
.party-chat-box {
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  height: 420px;
}
.party-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.party-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--paper-edge);
  font-size: 0.92rem;
}
.party-msg.mine {
  align-self: flex-end;
  background: var(--accent);
  color: #fdf8ec;
  border-color: transparent;
}
.party-msg.mine .party-msg-meta { color: rgba(253,248,236,0.75); }
.party-msg-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 3px;
}
.party-compose {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--paper-edge);
}
.party-compose input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
  background: var(--bg);
  color: inherit;
  font-size: 0.92rem;
}
.party-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent);
  color: #fdf8ec;
  font-weight: 500;
}

.tag-spoiler {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 7px;
  margin-right: 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #fdf8ec;
  vertical-align: middle;
  font-weight: 500;
}
.tag-spoiler.warn { background: #c0392b; }
.spoiler-banner {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}
.inline-label { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--muted); }
.inline-label input { width: 80px; padding: 6px 8px; }
.spoiler-check { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; margin: 8px 0; }
.spoiler-blur {
  display: inline;
  filter: blur(5px);
  user-select: none;
  cursor: pointer;
  background: color-mix(in srgb, var(--paper-edge) 70%, transparent);
  border-radius: 4px;
  padding: 0 3px;
  transition: filter 0.2s ease, background 0.2s ease;
}
.spoiler-blur.revealed {
  filter: none;
  user-select: text;
  cursor: text;
  background: transparent;
}
.comment-body .spoiler-blur,
.post-body .spoiler-blur {
  display: inline-block;
  min-width: 4em;
}
.hot-weekly {
  margin-bottom: 24px;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.hot-weekly h2 { margin: 0 0 12px; font-size: 1.05rem; }
.hot-list { list-style: none; margin: 0; padding: 0; }
.hot-list li { border-bottom: 1px solid var(--paper-edge); }
.hot-list li:last-child { border-bottom: none; }
.hot-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  color: inherit;
  text-decoration: none;
}
.hot-list a:hover .hot-title { color: var(--accent-strong); }
.hot-rank {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--accent);
  color: #fdf8ec;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}
.hot-title { flex: 1; font-size: 0.95rem; }
.hot-meta { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.profile-page { padding: 28px 16px 80px; max-width: 720px; }
.profile-card {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #fdf8ec;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
}
.profile-info h1 { margin: 0 0 4px; font-size: 1.4rem; }
.profile-id { margin: 0; color: var(--muted); font-size: 0.9rem; }
.profile-joined { margin: 6px 0 0; color: var(--muted); font-size: 0.85rem; }
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.stat-card b { display: block; font-size: 1.3rem; color: var(--accent-strong); }
.stat-card span { font-size: 0.82rem; color: var(--muted); }
.profile-recent h2 { font-size: 1.05rem; margin: 0 0 12px; }
.auth-nav .auth-nick {
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-nav .auth-nick:hover { color: var(--accent); }

/* ===== 알림 ===== */
.notif-wrap {
  position: relative;
}
.notif-bell {
  position: relative;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  border-radius: 6px;
}
.notif-bell:hover { background: rgba(138, 90, 43, 0.08); }
.notif-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: #c44;
  border-radius: 999px;
}
.notif-badge.hidden { display: none; }
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, 90vw);
  max-height: 400px;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
}
.notif-panel.hidden { display: none; }
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--paper-edge);
  font-size: 0.85rem;
  font-weight: 600;
}
.notif-read-all {
  background: none;
  border: none;
  font-size: 0.78rem;
  color: var(--accent);
  cursor: pointer;
  padding: 2px 4px;
}
.notif-read-all:hover { text-decoration: underline; }
.notif-item {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--paper-edge);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(138, 90, 43, 0.05); }
.notif-item.notif-unread { background: rgba(138, 90, 43, 0.08); }
.notif-item .notif-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 2px;
}
.notif-item b {
  display: block;
  font-size: 0.88rem;
  color: var(--ink);
}
.notif-item p {
  margin: 4px 0 2px;
  font-size: 0.82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-item time {
  font-size: 0.72rem;
  color: var(--muted);
}
.notif-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.me-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.me-stat-pill {
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  color: var(--muted);
}
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--paper-edge);
  background: var(--paper);
}
.streak-badge.lv1 { border-color: #6ab04c; color: #4a7c32; }
.streak-badge.lv2 { border-color: #e67e22; color: #c0392b; }
.streak-badge.lv3 { border-color: #f1c40f; color: #9a7b0a; }
.streak-badge.lv4 { border-color: #9b59b6; color: #6c3483; }
.streak-badge.lv5 { border-color: var(--accent); background: linear-gradient(135deg, #fdf8ec, #f5e6c8); color: var(--accent-strong); }
.streak-badge.lv0 { color: var(--muted); font-weight: 400; }
.profile-streak { margin-top: 10px; }
