/* ==========================================================================
   리뉴얼 레이어 — styles.css 위에 덮어쓴다. 색은 전부 아래 테마 토큰을 거쳐서
   라이트/다크 양쪽에서 같이 바뀌게 한다(예전엔 밝은 색이 고정으로 박혀 있어서
   다크 모드에서 탭 메뉴 글씨가 배경에 묻혀 안 보였다).
   ========================================================================== */
/* "재첩국 캘린더" 여섯 글자만 담은 Gugi(6KB)를 사이트에 직접 두고 먼저 받아온다.
   구글 폰트 전체(6종)가 도착하기 전에 기본 글꼴로 제목이 보이던 문제를 막는다. */
@font-face { font-family: "Gugi Title"; src: url("/static/assets/fonts/gugi-title.woff2") format("woff2"); font-display: block; }

/* 제목 글꼴이 준비될 때까지(최대 1.5초) 입장 연출 대상을 감춰 두었다가 한 번에 시작한다. */
body.is-font-wait .home-content, body.is-font-wait .home-footer, body.is-font-wait .side-nav, body.is-font-wait .top-actions, body.is-font-wait .brand-block { opacity: 0; }

body[data-theme="light"] {
  --rn-ink: #17313b;
  --rn-muted: #5a7480;
  --rn-line: #d6e3e2;
  --rn-surface: #ffffff;
  --rn-surface-2: #f3f8f7;
  --rn-chip: #edf4f3;
  --rn-input: #ffffff;
  --rn-shadow: 0 10px 30px rgba(25, 63, 70, 0.08);
  --rn-nav-bg: rgba(246, 250, 249, 0.92);
  --rn-nav-line: rgba(117, 158, 162, 0.55);
  --rn-nav-ink: #31505b;
  --rn-nav-active-bg: #1e5361;
  --rn-nav-active-ink: #ffffff;
  --rn-brand: #183b49;
  --rn-page: #f2f6f5;
  --rn-tab-bg: rgba(255, 255, 255, 0.96);
  --rn-accent-ink: #1e5361;
  --rn-accent-soft: #d5ebe8;
}

body[data-theme="dark"] {
  --rn-ink: #e7f0f1;
  --rn-muted: #9db1b7;
  --rn-line: #2b3940;
  --rn-surface: #19232a;
  --rn-surface-2: #141c22;
  --rn-chip: #223038;
  --rn-input: #10181d;
  --rn-shadow: 0 12px 34px rgba(0, 0, 0, 0.32);
  --rn-nav-bg: rgba(15, 24, 29, 0.86);
  --rn-nav-line: rgba(255, 255, 255, 0.14);
  --rn-nav-ink: #cfe0e2;
  --rn-nav-active-bg: #e6f2f1;
  --rn-nav-active-ink: #12343f;
  --rn-brand: #e7f0f1;
  --rn-page: #0f171c;
  --rn-tab-bg: rgba(15, 23, 28, 0.97);
  --rn-accent-ink: #9fe3d8;
  --rn-accent-soft: rgba(159, 227, 216, 0.16);
}

html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); }
body.local-background-preview::before { background-image: url("/static/assets/hero-underwater-local.webp"); background-position: center center; opacity: 1; }
.main-with-nav { margin-left: 0; }
.page-glow { display: none; }

/* ---------- 상단 바 / 탭 메뉴 ---------- */
.topbar { top: 0; min-height: 70px; padding: 10px clamp(18px, 3vw, 48px); align-items: center; pointer-events: none; z-index: 50; }
.topbar > * { pointer-events: auto; }
.brand-block { display: inline-flex; align-items: center; border: 0; background: none; padding: 4px 0; font-family: var(--font-display); font-size: var(--fs-18); color: var(--rn-brand); white-space: nowrap; cursor: pointer; transition: opacity 240ms ease; }
/* 일정·노래책·스토리·게임 탭은 상단이 배경 사진 위라서 테마와 상관없이 흰 글씨로 둔다. */
body:not([data-page="home"]) .brand-block { color: #ffffff; text-shadow: 0 1px 8px rgba(10, 35, 45, 0.88); }
/* 홈에서는 가운데 큰 제목과 겹치므로 왼쪽 위 로고를 감춘다. */
body[data-page="home"] .brand-block { opacity: 0; visibility: hidden; pointer-events: none; }
.top-actions { margin-left: auto; }

.side-nav,
body[data-theme="dark"] .side-nav {
  top: 16px; left: 50%; transform: translateX(-50%); width: auto; padding: 3px; flex-direction: row; gap: 2px;
  border-radius: var(--r-pill); background: var(--rn-nav-bg); border: 1px solid var(--rn-nav-line);
  box-shadow: 0 8px 24px rgba(13, 35, 41, 0.12); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 49;
}
.side-nav-item { display: flex; flex-direction: row; align-items: center; justify-content: center; width: auto; min-width: 64px; padding: 9px 14px; border-radius: var(--r-pill); color: var(--rn-nav-ink); font-size: var(--fs-13); transition: background 200ms ease, color 200ms ease; }
.side-nav-item:hover { color: var(--rn-ink); background: color-mix(in srgb, var(--rn-nav-ink) 10%, transparent); }
.side-nav-item svg, .side-nav-item::before { display: none; }
.side-nav-item span { display: inline; }
.side-nav-item.is-active, .side-nav-item.is-active:hover { color: var(--rn-nav-active-ink); background: var(--rn-nav-active-bg); }

/* 홈은 사진 위에 떠 있으므로 테마별로 따로 맞춘다. */
body[data-page="home"][data-theme="dark"] .side-nav { background: rgba(10, 35, 45, 0.72); border-color: rgba(255, 255, 255, 0.28); }
body[data-page="home"][data-theme="dark"] .side-nav-item { color: var(--c-sea-100); }
body[data-page="home"][data-theme="dark"] .side-nav-item.is-active { color: #12343f; background: #f7fbfb; }
body[data-page="home"][data-theme="light"] .side-nav { background: rgba(247, 251, 251, 0.8); border-color: rgba(255, 255, 255, 0.92); }

/* ---------- 홈 ---------- */
.renewal-home {
  position: relative; display: flex; flex-direction: column; min-height: 100svh;
  padding: 92px clamp(22px, 5vw, 80px) 24px; overflow: hidden; isolation: isolate; color: var(--home-ink);
}
body[data-theme="dark"] .renewal-home { --home-ink: #ffffff; --home-muted: #d2e2e3; --home-card: rgba(8, 30, 40, 0.52); --home-card-line: rgba(255, 255, 255, 0.22); --home-chip: rgba(255, 255, 255, 0.12); background: #183b49; }
body[data-theme="light"] .renewal-home { --home-ink: #12313b; --home-muted: #3f5d66; --home-card: rgba(255, 255, 255, 0.72); --home-card-line: rgba(255, 255, 255, 0.95); --home-chip: rgba(18, 49, 59, 0.07); background: #d8f0f2; }
.renewal-home::before, .renewal-home .hero-aura { display: none; }
.home-scene { position: absolute; inset: -2%; z-index: -2; background: url("/static/assets/hero-underwater-local.webp") center center / cover no-repeat; }
.renewal-home::after { content: ""; display: block; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
body[data-theme="dark"] .renewal-home::after { background: linear-gradient(100deg, rgb(var(--c-navy-deep-rgb) / 0.8) 0%, rgba(6, 34, 48, 0.5) 52%, rgba(6, 34, 48, 0.28) 100%); }
body[data-theme="light"] .renewal-home::after { background: linear-gradient(100deg, rgb(var(--c-mist-rgb) / 0.92) 0%, rgb(var(--c-mist-rgb) / 0.6) 48%, rgb(var(--c-mist-rgb) / 0.16) 100%); }

.home-content {
  width: min(1240px, 100%); flex: 1; margin: auto; padding: clamp(24px, 6vh, 80px) 0 40px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: clamp(28px, 5vw, 80px);
}
.home-copy { min-width: 0; justify-self: stretch; }
.renewal-home .home-title { margin: 0 0 30px; font-family: var(--font-display); font-weight: 400; font-size: clamp(2.8rem, 6.2vw, 5.6rem); line-height: 1.04; letter-spacing: -.05em; color: var(--home-ink); -webkit-text-fill-color: currentColor; background: none; text-shadow: none; }
body[data-theme="dark"] .renewal-home .home-title { text-shadow: 0 4px 30px rgba(0, 0, 0, 0.24); }
.home-title .home-title-line { display: block; overflow: hidden; padding: .04em .02em .1em; white-space: nowrap; }
.home-title .home-char { display: inline-block; will-change: transform; }

.home-agenda {
  display: grid; gap: 16px; width: min(520px, 100%); padding: 20px 0 0;
  border-top: 1px solid color-mix(in srgb, var(--home-ink) 42%, transparent);
}
.home-agenda-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.home-agenda-label { color: var(--home-ink); font-size: var(--fs-13); font-weight: 800; letter-spacing: -.01em; }
.home-agenda-live-mark { color: #d6344b; font-size: var(--fs-13); font-weight: 800; white-space: nowrap; }
.home-agenda-live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: .08em; }
body[data-theme="dark"] .home-agenda-live-mark { color: #ff8e9e; }
.home-agenda-date { color: var(--home-muted); font-size: var(--fs-13); font-weight: 600; }
.home-agenda-note { margin: -8px 0 0; overflow: hidden; font-size: var(--fs-13); color: var(--home-muted); }
.home-agenda-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.home-agenda-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 11px 0 11px 14px; border-left: 3px solid var(--dot); }
body[data-theme="light"] .home-agenda-item { border-left-color: color-mix(in srgb, var(--dot) 60%, #25505c); }
.home-agenda-item + .home-agenda-item { border-top: 1px solid color-mix(in srgb, var(--home-ink) 20%, transparent); }
.home-agenda-text { min-width: 0; display: grid; gap: 2px; }
.home-agenda-text strong { font-size: clamp(1.08rem, 1.8vw, 1.35rem); line-height: 1.4; word-break: keep-all; }
.home-agenda-text small { font-size: var(--fs-12); color: var(--home-muted); }
.home-agenda-cat { color: var(--home-muted); font-size: var(--fs-12); font-weight: 600; white-space: nowrap; }
.home-agenda-empty { padding: 4px 0 6px; font-size: var(--fs-17); font-weight: 700; }
.home-agenda-loading { animation: home-loading-fade 1.1s ease-in-out infinite alternate; }
.home-agenda-foot { min-height: 30px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--home-ink) 20%, transparent); }
.home-agenda-time { color: var(--home-ink); font-size: var(--fs-14); font-weight: 700; }

.home-frame { margin: 0; justify-self: center; width: min(100%, 600px); }
.renewal-home .hero-screen-shell { width: 100%; }
.renewal-home .hero-screen-frame { box-shadow: 0 30px 60px rgba(4, 22, 30, 0.36), 0 3px 0 rgba(255, 255, 255, 0.72) inset, 0 0 0 1px rgba(199, 190, 177, 0.8); }

.home-footer { display: flex; flex-direction: row; justify-content: center; align-items: center; gap: 20px; width: min(1240px, 100%); margin: 0 auto; padding: 14px 0 0; border-top: 1px solid var(--home-card-line); font-size: var(--fs-12); text-shadow: none; }
.home-footer .footer-link-button { display: inline; color: var(--home-ink); font-size: var(--fs-12); text-shadow: none; font-weight: 500; text-decoration: none; opacity: .85; }
.home-footer .footer-link-button:hover { text-decoration: underline; opacity: 1; }

/* 첫 입장 연출 — 배경이 천천히 내려앉고, 제목 글자가 마스크 안에서 하나씩
   올라오고, 앨범 액자가 아래서부터 드러난 뒤 테이프가 붙는다(1회만). */
body.is-intro .home-scene { animation: home-scene-in 2.6s cubic-bezier(.2, .7, .1, 1) both; }
body.is-intro .renewal-home::after { animation: home-fade-in 1.4s ease both; }
body.is-intro .home-char { animation: home-char-in 1s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(.35s + var(--i) * .065s); }
body.is-intro .home-agenda { animation: home-rise-in 1s cubic-bezier(.16, 1, .3, 1) both; animation-delay: .95s; }
body.is-intro .home-agenda-item { animation: home-rise-in .8s cubic-bezier(.16, 1, .3, 1) both; }
body.is-intro .home-agenda-item:nth-child(1) { animation-delay: 1.15s; }
body.is-intro .home-agenda-item:nth-child(2) { animation-delay: 1.23s; }
body.is-intro .home-agenda-item:nth-child(3) { animation-delay: 1.31s; }
body.is-intro .home-agenda-item:nth-child(n+4) { animation-delay: 1.39s; }
body.is-intro .home-frame { animation: home-frame-in 1.4s cubic-bezier(.16, 1, .3, 1) both; animation-delay: .55s; }
body.is-intro .renewal-home .hero-photo-tape { animation: home-tape-in .7s cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: 1.55s; }
body.is-intro .side-nav { animation: home-drop-in .9s cubic-bezier(.16, 1, .3, 1) both; animation-delay: .2s; }
body.is-intro .top-actions { animation: home-fade-in .9s ease both; animation-delay: .3s; }
body.is-intro .home-footer { animation: home-fade-in .9s ease both; animation-delay: 1.4s; }

@keyframes home-scene-in { from { transform: scale(1.14); opacity: .35; } to { transform: scale(1); opacity: 1; } }
@keyframes home-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes home-char-in { from { transform: translateY(110%) rotate(8deg); opacity: 0; filter: blur(8px); } to { transform: none; opacity: 1; filter: none; } }
@keyframes home-rise-in { from { transform: translateY(26px); opacity: 0; } to { transform: none; opacity: 1; } }
/* 액자 등장: 잘라서 드러내지 않고, 사진을 판 위에 올려놓듯 살짝 기울어진 채 내려앉게 한다. */
@keyframes home-frame-in {
  from { transform: translateY(36px) rotate(-5deg) scale(.95); opacity: 0; }
  55% { opacity: 1; }
  75% { transform: translateY(-4px) rotate(.8deg) scale(1.005); }
  to { transform: none; opacity: 1; }
}
@keyframes home-tape-in { from { opacity: 0; transform: translateX(-50%) translateY(-16px) rotate(-12deg) scale(1.2); } to { opacity: .92; transform: translateX(-50%) rotate(-1.2deg); } }
@keyframes home-drop-in { from { opacity: 0; transform: translateX(-50%) translateY(-14px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes home-loading-fade { to { opacity: .45; } }

@media (prefers-reduced-motion: reduce) {
  body.is-intro .home-scene, body.is-intro .renewal-home::after, body.is-intro .home-char, body.is-intro .home-agenda,
  body.is-intro .home-agenda-item, body.is-intro .home-frame, body.is-intro .renewal-home .hero-photo-tape,
  body.is-intro .side-nav, body.is-intro .top-actions, body.is-intro .home-footer { animation: none; }
  .home-agenda-loading { animation: none; }
}

/* ---------- 노래책 · 스토리 공통 패널 (일정/게임 탭과 같은 보드) ---------- */
.story-shell { position: relative; z-index: 2; min-height: 100svh; padding: 96px clamp(16px, 3vw, 34px) 60px; color: var(--rn-ink); }
.songbook-shell { color: var(--rn-ink); }
.story-board { max-width: 1400px; margin: 0 auto; padding: 28px; border: 1px solid var(--border); border-radius: var(--r-3xl); background: var(--panel); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow-xl); }

/* ---------- 노래책 ---------- */
.songbook-board { max-width: 1400px; }
.songbook-head { padding: 0 0 18px; border-bottom: 1px solid var(--rn-line); }
.songbook-head h2 { margin: 0; font-size: clamp(1.8rem, 2.6vw, 2.6rem); line-height: 1.2; letter-spacing: -.04em; color: var(--rn-ink); }
/* 편집 도움말(스토리·최근 부른 날짜) — 노래책 밀기 안내와 같은 모양 */
.guide-tour { position: fixed; inset: 0; z-index: 2000; pointer-events: none; }
.guide-tour.hidden { display: none; }
.guide-tour-shade { position: fixed; background: rgb(var(--c-night-2-rgb) / 0.32); pointer-events: auto; }
.guide-tour-card { position: fixed; z-index: 2; box-sizing: border-box; width: min(300px, calc(100vw - 24px)); padding: 14px 15px; border: 1px solid var(--rn-line); border-radius: var(--r-lg); background: var(--rn-surface); color: var(--rn-ink); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16); pointer-events: auto; }
.guide-tour-step { margin: 0 0 4px; font-size: var(--fs-11); font-weight: 700; color: var(--rn-muted); }
.guide-tour-step:empty { display: none; }
.guide-tour-card h3 { margin: 0; font-size: var(--fs-14); font-weight: 800; }
.guide-tour-card p#guide-tour-text { margin: 7px 0 12px; font-size: var(--fs-12); line-height: 1.55; }
.guide-tour-actions { display: flex; justify-content: flex-end; gap: 6px; }
.guide-tour-actions button { padding: 6px 12px; border: 0; border-radius: var(--r-pill); font: inherit; font-size: var(--fs-12); font-weight: 700; cursor: pointer; }
.guide-tour-skip { background: var(--rn-chip); color: var(--rn-ink); }
.guide-tour-skip.hidden { display: none; }
.guide-tour-next { background: var(--c-teal-ink); color: #ffffff; }
.song-swipe-guide { position: fixed; inset: 0; z-index: 2000; pointer-events: none; }
.song-swipe-guide.hidden { display: none; }
.song-swipe-guide-shade { position: fixed; background: rgb(var(--c-night-2-rgb) / 0.28); pointer-events: auto; }
.song-swipe-guide-gesture { position: fixed; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; transform: translate(-50%, -50%); border: 1px solid var(--rn-line); border-radius: 50%; background: var(--rn-surface); color: var(--rn-ink); font-size: var(--fs-18); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); }
.song-swipe-guide-coachmark { position: fixed; z-index: 2; box-sizing: border-box; width: min(290px, calc(100vw - 24px)); padding: 14px 15px; border: 1px solid var(--rn-line); border-radius: var(--r-lg); background: var(--rn-surface); color: var(--rn-ink); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16); pointer-events: auto; }
.song-swipe-guide-coachmark h3 { margin: 0; font-size: var(--fs-14); font-weight: 800; }
.song-swipe-guide-coachmark p { margin: 7px 0 12px; font-size: var(--fs-12); line-height: 1.5; }
.song-swipe-guide-coachmark button { padding: 6px 12px; border: 0; border-radius: var(--r-pill); background: var(--c-teal-ink); color: #ffffff; font: inherit; font-size: var(--fs-12); font-weight: 700; cursor: pointer; }
.songbook-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 315px); gap: 18px; margin-top: 18px; align-items: start; }
.songbook-table-card, .song-detail { min-width: 0; padding: 18px; border: 1px solid var(--rn-line); border-radius: var(--r-3xl); background: var(--rn-surface); box-shadow: var(--rn-shadow); color: var(--rn-ink); }
.song-detail { position: sticky; top: 90px; min-height: 320px; }
.renewal-song-search { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.renewal-song-search label { font-size: var(--fs-13); font-weight: 700; white-space: nowrap; }
.renewal-song-search input { min-width: 0; flex: 1; height: 40px; padding: 0 14px; border: 1px solid var(--rn-line); border-radius: var(--r-pill); background: var(--rn-input); color: var(--rn-ink); }
.renewal-song-search span { font-size: var(--fs-12); white-space: nowrap; color: var(--rn-muted); }
.song-tag-filter-bar { padding: 5px 0 12px; border: 0; background: none; }
.song-table-head { display: none; }
.song-results.song-table { border: 0; }
.song-item { display: flex; min-height: 64px; margin: 0; border: 0; border-top: 1px solid var(--rn-line); border-radius: 0; background: transparent; box-shadow: none; }
.song-item:hover, .song-item.is-selected { background: var(--rn-surface-2); }
.song-item-content { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(80px, .8fr) minmax(80px, .7fr); gap: 9px; width: 100%; padding: 9px 5px; align-items: center; }
.song-title-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.song-number-cell { min-width: 23px; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--rn-muted); font-size: var(--fs-12); text-align: center; }
.song-artwork { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; overflow: hidden; border-radius: var(--r-md); background: var(--rn-chip); color: var(--rn-muted); font-size: var(--fs-16); }
.song-artwork img, .song-detail-art img { width: 100%; height: 100%; object-fit: cover; }
.song-title-block { min-width: 0; }
.song-title-cell { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-13); color: var(--rn-ink); }
.song-last-sung { display: block; margin-top: 3px; color: var(--rn-muted); font-size: var(--fs-11); line-height: 1.25; }
.song-item-content > :nth-child(2), .song-item-content > :nth-child(5) { display: none; }
.song-item-content > :nth-child(3), .song-item-content > :nth-child(4) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-12); color: var(--rn-muted); }
.song-detail-art { display: grid; place-items: center; width: 100%; max-height: 240px; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-lg); background: var(--rn-chip); color: var(--rn-muted); font-size: 4rem; }
.song-detail-kicker { display: none; }
.song-detail h3 { margin: 15px 0 0; font-size: var(--fs-22); color: var(--rn-ink); }
.song-detail p { margin: 7px 0; font-size: var(--fs-13); color: var(--rn-muted); }
.song-quick-date { display: grid; gap: 6px; margin-top: 12px; color: var(--rn-muted); font-size: var(--fs-12); font-weight: 700; }
.song-quick-date input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--rn-line); border-radius: var(--r-md); background: var(--rn-input); color: var(--rn-ink); font: inherit; }
.song-quick-date-status:empty { display: none; }
.song-sung-history { margin-top: 14px; }
.song-sung-history h4 { margin: 0 0 5px; color: var(--rn-muted); font-size: var(--fs-12); font-weight: 700; }
.song-sung-history ul { margin: 0; padding: 0; list-style: none; }
.song-sung-history li { display: flex; align-items: center; justify-content: space-between; min-height: 32px; border-bottom: 1px solid var(--rn-line); color: var(--rn-ink); font-size: var(--fs-13); }
.song-sung-history li button { flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 0; background: none; color: var(--rn-muted); font: inherit; font-size: var(--fs-18); cursor: pointer; }
.song-sung-history li button:hover { color: var(--rn-ink); }
.song-sung-history li button:disabled { opacity: .45; cursor: default; }
#song-history-modal .version-history-preview-before,
#song-history-modal .version-history-preview-after,
#song-history-modal .version-history-summary,
#song-history-modal .version-history-preview-day-title { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 760px) {
  body .songbook-head { flex-wrap: wrap; }
  body .songbook-head-actions { flex-wrap: wrap; }
}
.song-detail-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 14px 0; }
.song-detail-tags span { padding: 3px 8px; border: 1px solid var(--rn-line); border-radius: var(--r-pill); font-size: var(--fs-11); }
.song-detail-close { display: none; }
.song-detail-empty { display: grid; min-height: 250px; place-items: center; color: var(--rn-muted); font-size: var(--fs-14); }
.song-item-editing .song-artwork { display: none; }
.song-random-button, .song-search-button, .song-search-reset-button { min-width: auto; height: 38px; padding: 0 15px; border: 1px solid var(--rn-line); border-radius: var(--r-pill); background: var(--rn-surface); color: var(--rn-ink); box-shadow: none; }
.song-pagination-button { border-radius: var(--r-pill); background: var(--rn-surface); color: var(--rn-ink); box-shadow: none; }
.song-pagination-button.is-active { border-color: var(--c-teal-ink); background: var(--c-teal-ink); color: #ffffff; }

/* 노래 추가·편집 폼 — 라벨 위, 입력칸 아래의 정돈된 격자 */
.songbook-editor { display: grid; gap: 14px; max-width: none; margin: 18px 0 0; padding: 18px; border: 1px solid var(--rn-line); border-radius: var(--r-xl); background: var(--rn-surface); box-shadow: var(--rn-shadow); }
.songbook-editor.hidden { display: none; }
.song-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.song-field { display: grid; gap: 6px; min-width: 0; }
.song-field > span { font-size: var(--fs-12); font-weight: 700; color: var(--rn-muted); }
.song-field-wide { grid-column: 1 / -1; }
.songbook-editor .song-field input:not(.song-tag-new), .songbook-editor .song-field select, .song-item-editing .song-field .song-inline-input {
  flex: none; width: 100%; max-width: none; height: 40px; padding: 0 12px; border: 1px solid var(--rn-line); border-radius: var(--r-md);
  background: var(--rn-input); color: var(--rn-ink); font-size: var(--fs-14);
}
.song-field input:focus, .song-field select:focus { outline: 2px solid color-mix(in srgb, var(--c-teal-ink) 45%, transparent); outline-offset: 0; border-color: var(--c-teal-ink); }
.song-field input::placeholder { color: var(--rn-muted); opacity: .8; }
.song-form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.song-form-foot .song-editor-status { flex: 1; margin: 0; min-height: 0; font-size: var(--fs-12); color: var(--rn-muted); }
.song-form-button { height: 36px; padding: 0 16px; border: 1px solid var(--rn-line); border-radius: var(--r-pill); background: var(--rn-surface); color: var(--rn-ink); font-size: var(--fs-13); font-weight: 700; cursor: pointer; }
.song-form-button.is-primary { border-color: var(--c-teal-ink); background: var(--c-teal-ink); color: #ffffff; }
.song-form-open { border-color: var(--c-teal-ink); background: var(--c-teal-ink); color: #ffffff; }
.song-item-editing { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px 12px; background: var(--rn-surface-2); }
.song-edit-title { margin: 0; font-size: var(--fs-13); font-weight: 800; color: var(--rn-ink); }

/* 태그 필터 칩 — 선택 체크를 다시 보여준다(아이콘은 아래 html 규칙에서 숨김). */
.song-tag-filter-chip { height: 32px; padding: 0 12px; box-shadow: none; transform: none; font-size: var(--fs-12); }
.song-tag-filter-chip:not([class*="tag-"]) { border: 1px solid var(--rn-line); background: var(--rn-surface); color: var(--rn-muted); }
.song-tag-filter-chip.active:not([class*="tag-"]) { border-color: var(--c-teal-ink); background: var(--c-teal-ink); color: #ffffff; }
.song-tag-filter-chip[class*="tag-"].active { box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 35%, transparent); }

/* 노래 추가/편집 — 태그 선택 칩 */
.song-tag-picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.song-tag-pick { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border: 1px dashed var(--rn-line); border-radius: var(--r-pill); background: transparent; color: var(--rn-muted); font-size: var(--fs-12); font-weight: 700; cursor: pointer; transition: background 160ms ease, color 160ms ease, border-color 160ms ease; }
.song-tag-pick:hover { border-style: solid; color: var(--rn-ink); }
.song-tag-pick[aria-pressed="true"] { border-style: solid; border-color: var(--c-teal-ink); background: var(--c-teal-ink); color: #ffffff; }
.song-tag-pick .song-tag-symbol-image { width: .9rem; height: .9rem; }
.song-tag-picker .song-tag-new { flex: none; max-width: none; width: 110px; height: 30px; padding: 0 11px; border: 1px solid var(--rn-line); border-radius: var(--r-pill); background: var(--rn-input); color: var(--rn-ink); font-size: var(--fs-12); }

/* 노래책 검색·랜덤 팝업 */
#song-random-modal .song-random-dialog, #song-search-modal .song-random-dialog { width: min(100%, 440px); padding: 20px; border: 1px solid var(--rn-line); border-radius: var(--r-2xl); background: var(--rn-surface); color: var(--rn-ink); box-shadow: 0 24px 60px rgba(4, 22, 30, 0.28); }
.song-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.song-random-form .song-modal-head h3 { margin: 0; font-family: var(--font-sans); font-size: var(--fs-18); font-weight: 800; letter-spacing: -.02em; color: var(--rn-ink); }
.song-modal-close { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--rn-chip); color: var(--rn-muted); font-size: var(--fs-20); line-height: 1; cursor: pointer; }
.song-modal-close:hover { color: var(--rn-ink); }
#song-random-modal .song-random-fields span, #song-search-modal .song-random-fields span { font-size: var(--fs-12); color: var(--rn-muted); }
#song-random-modal .song-random-fields label, #song-search-modal .song-random-fields label { gap: 6px; }
#song-random-modal .song-random-fields :is(input, select), #song-search-modal .song-random-fields :is(input, select) { height: 40px; border: 1px solid var(--rn-line); border-radius: var(--r-md); background: var(--rn-input); color: var(--rn-ink); font-size: var(--fs-14); }
#song-random-modal .song-random-submit, #song-search-modal .song-random-submit { width: 100%; height: 42px; margin-top: 16px; border: 0; border-radius: var(--r-lg); background: var(--c-teal-ink); color: #ffffff; font-size: var(--fs-14); font-weight: 700; }
#song-random-modal .song-random-results { gap: 0; margin-top: 14px; }
#song-random-modal .song-random-results:empty { display: none; }
#song-random-modal .song-random-results.is-drawing { display: block; max-height: min(340px, 42vh); overflow-y: auto; }
#song-random-modal .song-random-submit:disabled { opacity: .62; cursor: wait; }
#song-random-modal .song-random-slot { border-top: 1px solid var(--rn-line); }
#song-random-modal .song-random-reel { height: 46px; overflow: hidden; }
#song-random-modal .song-random-reel-track { transform: translate3d(0, 0, 0); transition: transform 1750ms cubic-bezier(.14, .72, .12, 1) var(--reel-delay); }
#song-random-modal .song-random-results.is-spinning .song-random-reel-track { transform: translate3d(0, var(--reel-end), 0); }
#song-random-modal .song-random-reel-title { display: block; height: 46px; padding: 0 2px; overflow: hidden; color: var(--rn-ink); font-size: var(--fs-15); font-weight: 700; line-height: 46px; text-overflow: ellipsis; white-space: nowrap; }
#song-random-modal .song-random-item { padding: 11px 2px; border: 0; border-top: 1px solid var(--rn-line); border-radius: 0; background: none; }
#song-random-modal .song-random-item strong { font-size: var(--fs-15); color: var(--rn-ink); }
#song-random-modal .song-random-item p { margin-top: 2px; font-size: var(--fs-12); color: var(--rn-muted); }

/* ---------- 스토리 ---------- */
.story-shell[data-accent="gold"] { --st-accent: #c58d1e; --st-accent-ink: #8a5d06; --st-soft: #fff6df; --st-soft-2: #fffaf0; }
.story-shell[data-accent="violet"] { --st-accent: #6f5fd3; --st-accent-ink: #4b3da8; --st-soft: #f1eeff; --st-soft-2: #f8f6ff; }
.story-shell[data-accent="rose"] { --st-accent: #cf3f61; --st-accent-ink: #a52746; --st-soft: #ffeef2; --st-soft-2: #fff6f8; }
body[data-theme="dark"] .story-shell { --st-soft: color-mix(in srgb, var(--st-accent) 18%, #19232a); --st-soft-2: color-mix(in srgb, var(--st-accent) 8%, #19232a); --st-accent-ink: color-mix(in srgb, var(--st-accent) 70%, #ffffff); }

.story-game-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--rn-line); border-radius: 999px; background: var(--rn-surface-2); }
.story-game-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border: 0; border-radius: 999px; background: transparent; color: var(--rn-muted); font-size: .88rem; font-weight: 800; cursor: pointer; transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease; }
.story-game-tabs button img { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.story-game-tabs button:hover { color: var(--rn-ink); }
.story-game-tabs button[aria-selected="true"] { background: var(--rn-surface); color: var(--st-accent-ink); box-shadow: 0 2px 10px rgba(20, 40, 50, 0.12); }

.story-hero { margin-top: 16px; }
.story-loading { margin: 0; color: var(--rn-muted); }
.story-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 28px; margin: 0; }
.story-summary > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.story-summary dt { flex: 0 0 auto; white-space: nowrap; font-size: var(--fs-12); font-weight: 700; color: var(--rn-muted); }
.story-summary dd { margin: 0; font-size: var(--fs-16); font-weight: 800; color: var(--rn-ink); font-variant-numeric: tabular-nums; }
.story-summary dd span { font-weight: 600; color: var(--rn-muted); }
.story-summary .is-current dd { color: var(--st-accent-ink); }

.story-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 12px; }
.story-filters button { padding: 6px 12px; border: 1px solid var(--rn-line); border-radius: var(--r-pill); background: var(--rn-surface); color: var(--rn-muted); font-size: var(--fs-12); font-weight: 800; cursor: pointer; }
.story-filters button[aria-pressed="true"] { border-color: var(--rn-ink); color: var(--rn-ink); box-shadow: inset 0 0 0 1px var(--rn-ink); }

.story-journey { display: grid; grid-template-columns: minmax(190px, 240px) minmax(0, 1fr); align-items: start; border: 1px solid var(--rn-line); border-radius: var(--r-3xl); background: var(--rn-surface-2); overflow: hidden; }
.story-chapter-picker { display: none; }
.story-stepper { display: grid; align-content: start; gap: 2px; max-height: 72vh; overflow-y: auto; padding: 12px; border-right: 1px solid var(--rn-line); }
.story-step { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 7px 9px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--rn-muted); text-align: left; cursor: pointer; }
.story-step:hover, .story-step[aria-current="true"] { background: var(--rn-surface); }
.story-step[aria-current="true"] { box-shadow: inset 3px 0 var(--st-accent); }
.story-step.no-index { grid-template-columns: minmax(0, 1fr) auto; }
.story-step-index, .story-step-count { font-size: var(--fs-11); font-weight: 700; color: var(--rn-muted); }
.story-step-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-13); font-weight: 750; color: var(--rn-ink); }
.story-step.is-complete .story-step-count { color: var(--st-accent-ink); }

.story-columns { min-width: 0; padding: 12px; }
.story-card { position: relative; display: flex; flex-direction: column; width: 100%; min-width: 0; border: 1px solid var(--rn-line); border-radius: var(--r-xl); background: var(--rn-surface); overflow: hidden; }
.story-card-head { position: relative; display: grid; gap: 4px; padding: 18px 18px 16px; background: linear-gradient(170deg, var(--st-soft), var(--rn-surface)); border-bottom: 1px solid var(--rn-line); }
/* 챕터 배경 이미지 — 머리 영역에 옅게 깔고 아래로 갈수록 사라지게 */
.story-card-head.has-image::before { content: ""; position: absolute; inset: 0; background: var(--story-image) center / cover no-repeat; opacity: .3; -webkit-mask-image: linear-gradient(180deg, #000000 30%, transparent 100%); mask-image: linear-gradient(180deg, #000000 30%, transparent 100%); pointer-events: none; }
body[data-theme="dark"] .story-card-head.has-image::before { opacity: .24; }
.story-card-head > * { position: relative; }
.story-card-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-11); font-weight: 800; letter-spacing: .12em; color: var(--rn-muted); }
.story-card-head h3 { margin: 6px 0 0; font-size: var(--fs-13); font-weight: 700; color: var(--rn-muted); }
.story-card-title { margin: 0; font-size: var(--fs-18); font-weight: 900; line-height: 1.35; letter-spacing: -.03em; color: var(--rn-ink); word-break: keep-all; }
.story-shell[data-accent="rose"] .story-card-head h3 { font-size: var(--fs-18); font-weight: 900; color: var(--rn-ink); }
.story-card-subtitle { margin: 0; font-size: var(--fs-12); font-style: italic; color: var(--rn-muted); }
.story-card-note { margin: 4px 0 0; font-size: var(--fs-12); color: var(--rn-muted); }
.story-location-chip { justify-self: start; display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 4px 10px; border: 1px solid color-mix(in srgb, var(--st-accent) 45%, transparent); border-radius: var(--r-pill); background: var(--rn-surface); color: var(--st-accent-ink); font-size: var(--fs-12); font-weight: 700; }

/* 항목 목록은 챕터 판 안에서 따로 스크롤한다 — 탭에 들어올 때 페이지 전체가 아니라
   이 목록만 마지막으로 체크한 항목 위치로 움직이게. 세로 줄은 스크롤 내용 전체에 이어지도록
   배경(local)으로 그린다. */
.story-items { position: relative; display: grid; align-content: start; gap: 2px; margin: 0; padding: 14px 14px 12px; list-style: none; flex: 1; max-height: min(70vh, 760px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; background: linear-gradient(var(--rn-line), var(--rn-line)) no-repeat 27px 26px / 2px calc(100% - 52px); background-attachment: local; }
.story-items[data-filter="done"] > [data-filter-state="todo"], .story-items[data-filter="todo"] > [data-filter-state="done"] { display: none; }
.story-children[data-filter="done"] > [data-filter-state="todo"], .story-children[data-filter="todo"] > [data-filter-state="done"] { display: none; }
.story-empty { padding: 16px 8px; color: var(--rn-muted); font-size: var(--fs-13); }
.story-item { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 9px 8px 9px 0; border-radius: var(--r-lg); }
.story-marker { position: relative; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; margin: 1px 0 0 3px; border: 2px solid var(--rn-line); border-radius: 50%; background: var(--rn-surface); }
.story-marker.is-editable { padding: 0; cursor: pointer; transition: box-shadow 150ms ease, border-color 150ms ease; }
.story-marker.is-editable:hover, .story-marker.is-editable:focus-visible { border-color: var(--st-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--st-accent) 25%, transparent); outline: none; }
.story-marker svg { width: 13px; height: 13px; fill: none; stroke: #ffffff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.story-item.is-done > .story-marker { border-color: var(--st-accent); background: var(--st-accent); }
.story-item.is-editable > .story-item-body { cursor: pointer; }
.story-item-body { min-width: 0; display: grid; align-content: start; gap: 3px; }
.story-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.story-item-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.story-item-side { flex: 0 0 auto; font-size: var(--fs-11); font-weight: 700; color: var(--rn-muted); }
.story-count { color: var(--rn-muted); }
.story-tag { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: var(--r-sm); font-size: var(--fs-10); font-weight: 800; letter-spacing: .06em; line-height: 1.4; }
.story-tag-type { background: #e3eefc; color: #2f5d9e; }
.story-tag-type.is-prologue { background: #eeeaff; color: #5b45b0; }
.story-tag-type.is-interlude { background: #fde9df; color: #b2522a; }
.story-tag-type.is-segue { background: var(--c-foam); color: #20786a; }
.story-tag-type.is-epilogue { background: var(--c-sea-100); color: #4f5d6b; }
.story-tag-type.is-finale { background: #ffe5e5; color: #b3293f; }
.story-tag-kind { background: #e3eefc; color: #2f5d9e; letter-spacing: 0; }
.story-tag-importance.is-must { background: #fff0ca; color: #8a6200; letter-spacing: 0; }
.story-tag-importance.is-key { background: #ffe1e6; color: #b3293f; letter-spacing: 0; }
.story-tag-importance.is-optional { background: var(--rn-chip); color: var(--rn-muted); letter-spacing: 0; }
.story-tag-badge { background: var(--st-soft); color: var(--st-accent-ink); letter-spacing: 0; }
.story-tag-plain { border: 1px solid var(--rn-line); color: var(--rn-muted); letter-spacing: 0; }
body[data-theme="dark"] .story-tag-type, body[data-theme="dark"] .story-tag-kind, body[data-theme="dark"] .story-tag-importance.is-must,
body[data-theme="dark"] .story-tag-importance.is-key { filter: saturate(.9) brightness(.92); }
.story-item-label { font-size: var(--fs-12); font-weight: 700; color: var(--rn-ink); }
.story-item-location { padding: 1px 7px; border-radius: var(--r-pill); background: var(--rn-chip); font-size: var(--fs-10); font-weight: 700; color: var(--rn-muted); }
.story-item-title { margin: 0; font-size: var(--fs-15); font-weight: 800; line-height: 1.4; color: var(--rn-ink); word-break: keep-all; }
.story-item.is-todo .story-item-title { color: color-mix(in srgb, var(--rn-ink) 80%, transparent); }
.story-item-subtitle { margin: 0; font-size: var(--fs-12); font-style: italic; color: var(--rn-muted); }
.story-item-note { margin: 0; font-size: var(--fs-11); color: var(--rn-muted); }

.story-replays { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.story-replay { display: inline-flex; align-items: center; max-width: 100%; border: 1px solid color-mix(in srgb, var(--st-accent) 35%, var(--rn-line)); border-radius: var(--r-pill); background: var(--rn-surface); overflow: hidden; }
.story-replay a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 10px 4px 5px; color: var(--rn-ink); text-decoration: none; font-size: var(--fs-11); font-weight: 700; }
.story-replay a:hover { background: var(--st-soft); }
.story-replay-icon { display: grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; background: #e3353f; color: #ffffff; font-size: .48rem; }
.story-replay-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.story-replay-edit, .story-replay-remove { align-self: stretch; padding: 0 9px; border: 0; border-left: 1px solid var(--rn-line); background: transparent; color: var(--rn-muted); font-size: var(--fs-11); cursor: pointer; }
.story-replay-remove { font-size: var(--fs-14); }
.story-replay-edit:hover, .story-replay-remove:hover { color: var(--rn-ink); background: var(--st-soft); }
.story-video-edit-form { flex: 1 0 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(130px, .5fr); gap: 8px; padding: 10px; border: 1px solid var(--rn-line); border-radius: var(--r-lg); background: var(--rn-surface-2); }
.story-video-edit-form label { display: grid; gap: 3px; min-width: 0; color: var(--rn-muted); font-size: var(--fs-11); }
.story-video-edit-form input { width: 100%; min-width: 0; height: 34px; padding: 0 9px; border: 1px solid var(--rn-line); border-radius: var(--r-md); background: var(--rn-input); color: var(--rn-ink); font: inherit; font-size: var(--fs-12); }
.story-video-edit-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.story-video-edit-actions button { padding: 6px 10px; border: 1px solid var(--rn-line); border-radius: var(--r-pill); background: var(--rn-surface); color: var(--rn-ink); font: inherit; font-size: var(--fs-12); font-weight: 700; cursor: pointer; }
.story-video-edit-actions button.is-primary { border-color: var(--st-accent); background: var(--st-accent); color: #ffffff; }
.story-video-edit-form .story-add-status { grid-column: 1 / -1; }
@media (max-width: 700px) { .story-video-edit-form { grid-template-columns: minmax(0, 1fr); } .story-video-edit-actions { grid-column: 1; } .story-video-edit-form .story-add-status { grid-column: 1; } }
.story-add-video { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; width: 100%; margin-top: 2px; }
.story-add-video input { flex: 1 1 160px; min-width: 0; height: 30px; padding: 0 11px; border: 1px solid var(--rn-line); border-radius: var(--r-pill); background: var(--rn-input); color: var(--rn-ink); font: inherit; font-size: var(--fs-12); }
.story-add-video button { height: 30px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: var(--st-accent); color: #ffffff; font-size: var(--fs-12); font-weight: 800; cursor: pointer; }
.story-add-video button:disabled { opacity: .6; }
.story-add-status { flex-basis: 100%; font-size: var(--fs-11); color: var(--rn-muted); }
.story-add-status:empty { display: none; }

.story-children-toggle { justify-self: start; margin-top: 4px; padding: 4px 10px; border: 1px solid color-mix(in srgb, var(--st-accent) 40%, var(--rn-line)); border-radius: var(--r-pill); background: var(--rn-surface); color: var(--st-accent-ink); font-size: var(--fs-11); font-weight: 800; cursor: pointer; }
.story-children-toggle::after { content: " ▾"; }
.story-children-toggle[aria-expanded="true"]::after { content: " ▴"; }
.story-children { display: grid; gap: 0; margin: 6px 0 0; padding: 4px 0 0; list-style: none; border-top: 1px dashed var(--rn-line); }
.story-item.is-child { grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 6px 4px 6px 0; }
.story-item.is-child > .story-marker { width: 18px; height: 18px; margin-left: 0; }
.story-item.is-child > .story-marker svg { width: 10px; height: 10px; }
.story-divider { display: grid; gap: 2px; margin: 10px 0 4px 38px; padding: 8px 10px; border-radius: var(--r-lg); background: var(--rn-surface-2); font-size: var(--fs-12); }
.story-divider strong { color: var(--rn-ink); }
.story-divider span { color: var(--rn-muted); }
.story-items[data-filter="done"] > .story-divider, .story-items[data-filter="todo"] > .story-divider { display: none; }

.story-card-foot { padding: 12px 18px; border-top: 1px solid var(--rn-line); font-size: var(--fs-12); color: var(--rn-muted); }

/* 챕터 편집 (편집자 전용) */
.story-filters .story-edit-toggle { margin-left: auto; border-color: var(--rn-line); color: var(--rn-ink); }
.story-filters .story-edit-toggle[aria-pressed="true"] { border-color: var(--c-teal-ink); background: var(--c-teal-ink); color: #ffffff; box-shadow: none; }
.story-edit-buttons { display: flex; gap: 10px; margin-top: 4px; }
.story-edit-buttons button { padding: 0; border: 0; background: none; color: var(--rn-muted); font-size: var(--fs-11); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.story-edit-buttons button:hover { color: var(--rn-ink); }
.story-edit-buttons button.is-danger:hover { color: #d14a4a; }
.story-add-row { margin: 0 14px 12px; padding: 9px 12px; border: 1px dashed var(--rn-line); border-radius: var(--r-lg); background: transparent; color: var(--rn-muted); font-size: var(--fs-12); font-weight: 700; cursor: pointer; }
.story-add-row:hover { border-style: solid; color: var(--rn-ink); }
.story-card-new { justify-content: flex-start; padding-top: 14px; background: transparent; border-style: dashed; }
.story-card-new > .story-add-row { margin: 0 14px; }
.story-card.is-form { padding: 14px; }
.story-card-form { padding: 0 14px 12px; }
.story-item.is-form { display: block; padding: 6px 0; }
.story-edit-form { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--rn-line); border-radius: var(--r-lg); background: var(--rn-surface-2); }
.story-edit-form label { display: grid; gap: 4px; }
.story-edit-form label span { font-size: var(--fs-11); font-weight: 700; color: var(--rn-muted); }
.story-edit-form :is(input, select) { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--rn-line); border-radius: var(--r-md); background: var(--rn-input); color: var(--rn-ink); font: inherit; font-size: var(--fs-13); }
.story-edit-actions { display: flex; justify-content: flex-end; gap: 6px; }
.story-edit-actions button { height: 30px; padding: 0 12px; border: 1px solid var(--rn-line); border-radius: var(--r-pill); background: var(--rn-surface); color: var(--rn-ink); font-size: var(--fs-12); font-weight: 700; cursor: pointer; }
.story-edit-actions .is-primary { border-color: var(--c-teal-ink); background: var(--c-teal-ink); color: #ffffff; }

/* ---------- 반응형 ---------- */
@media (max-width: 860px) {
  .home-content { grid-template-columns: 1fr; justify-items: start; }
  .home-frame { justify-self: start; width: min(100%, 520px); }
}

@media (max-width: 1050px) {
  .brand-block { font-size: var(--fs-15); }
  .side-nav-item { min-width: 53px; padding: 9px 9px; }
  .songbook-layout { grid-template-columns: minmax(0, 1fr) 260px; }
}

@media (max-width: 760px) {
  .topbar { top: 0; left: 0; right: 0; min-height: 60px; padding: 8px 16px; }
  .brand-block span { display: inline; }
  .side-nav, body[data-theme="dark"] .side-nav {
    top: auto; left: 0; right: 0; bottom: 0; transform: none; width: 100%; justify-content: space-around; gap: 0; border-radius: 0;
    padding: 0 3px calc(4px + env(safe-area-inset-bottom, 0px)); border-left: 0; border-right: 0; border-bottom: 0;
  }
  body[data-page="home"][data-theme="dark"] .side-nav { background: rgba(16, 45, 60, 0.92); }
  body[data-page="home"][data-theme="light"] .side-nav { background: rgba(247, 251, 251, 0.96); }
  .side-nav-item, .side-nav-item[data-nav="home"], .side-nav-item[data-nav="calendar"], .side-nav-item[data-nav="songbook"], .side-nav-item[data-nav="story"], .side-nav-item[data-nav="game"] { display: flex; width: 20%; min-width: 0; height: 48px; padding: 0; border-radius: 0; }
  .side-nav-item span { font-size: var(--fs-12); }
  body.is-intro .side-nav { animation: home-fade-in .9s ease both; animation-delay: .2s; }
  .main-with-nav { padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px)); }

  .renewal-home { min-height: calc(100svh - 52px - env(safe-area-inset-bottom, 0px)); padding: 76px 18px 16px; }
  .home-scene { background-position: 62% center; }
  .home-content { display: grid; grid-template-columns: 1fr; gap: 18px; padding: 18px 0 24px; }
  .home-copy { display: contents; }
  .renewal-home .home-title { order: 1; margin: 0; font-size: clamp(2.6rem, 13vw, 3.4rem); }
  .home-frame { order: 2; width: min(100%, 440px); justify-self: center; }
  .home-agenda { order: 3; width: 100%; padding-top: 16px; }
  .home-agenda-item { padding: 10px 0 10px 12px; gap: 10px; }
  .home-footer { flex-wrap: wrap; gap: 9px 17px; padding-top: 12px; }

  .story-shell { padding: 72px 10px 80px; }
  .story-board { padding: 14px 10px; border-radius: var(--r-3xl); }
  .story-game-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .story-game-tabs button { flex: 0 0 auto; font-size: .8rem; }
  .story-summary { gap: 4px 18px; }
  .story-summary dd { font-size: var(--fs-15); }
  .story-journey { display: block; }
  .story-chapter-picker { display: grid; gap: 5px; padding: 12px 12px 0; font-size: var(--fs-12); font-weight: 700; color: var(--rn-muted); }
  .story-chapter-picker select { width: 100%; min-height: 42px; padding: 0 10px; border: 1px solid var(--rn-line); border-radius: var(--r-md); background: var(--rn-surface); color: var(--rn-ink); font: inherit; font-size: var(--fs-14); }
  .story-stepper { display: none; }
  .story-columns { padding: 10px; }
  .story-items { max-height: 62svh; }
  .story-card { width: 100%; }
  .story-replay-title { max-width: none; }

  .songbook-layout { display: block; margin-top: 14px; }
  .song-form-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .songbook-editor { padding: 14px; }
  .songbook-table-card { padding: 12px 9px; border-radius: var(--r-xl); }
  .renewal-song-search { display: grid; grid-template-columns: 1fr auto; gap: 5px; }
  .renewal-song-search label { grid-column: 1 / -1; }
  .renewal-song-search input { grid-column: 1; width: 100%; }
  .renewal-song-search span { grid-column: 2; }
  .song-item-content { display: flex; gap: 7px; padding: 8px 4px; }
  .song-title-row { flex: 1; }
  .song-title-block::after { display: none; }
  .song-item-content > :nth-child(2), .song-item-content > :nth-child(3), .song-item-content > :nth-child(4), .song-item-content > :nth-child(5) { display: none; }
  .song-artwork { flex-basis: 40px; width: 40px; height: 40px; }
  .song-detail { display: none; }
  .song-detail.is-open { display: block; position: fixed; z-index: 85; top: auto; left: 0; right: 0; bottom: 52px; max-height: calc(82svh - 52px); overflow: auto; border-radius: var(--r-3xl) var(--r-3xl) 0 0; padding: 17px; box-shadow: 0 -8px 35px rgba(10, 35, 45, 0.2); }
  .song-detail-art { width: 110px; height: 110px; }
  .song-detail-close { display: block; position: absolute; top: 13px; right: 13px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--rn-chip); color: var(--rn-ink); font-size: var(--fs-20); }
}


/* ---------- 모바일 앱 구성 ----------
   유튜브·멜론 같은 모바일 웹처럼: 위에는 고정된 얇은 상단 바, 아래에는 아이콘+이름이
   있는 탭 바(스크롤해도 숨지 않음), 그 사이 화면은 여백 없이 꽉 채운다.
   배경 사진은 모든 탭에서 유지하고, 각 탭 화면은 사진 위 반투명 판으로 둔다. */
@media (max-width: 760px) {

  .topbar { position: absolute; top: 0; left: 0; right: 0; height: calc(52px + env(safe-area-inset-top, 0px)); min-height: 0; padding: env(safe-area-inset-top, 0px) 12px 0; align-items: center; }
  body:not([data-page="home"]) .topbar { background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  body:not([data-page="home"]) .brand-block { color: #ffffff; text-shadow: 0 1px 8px rgba(10, 35, 45, 0.88); font-size: var(--fs-16); }
  .top-actions { position: relative; flex-wrap: nowrap; }
  .top-actions .auth-chip { position: absolute; top: calc(100% + 6px); right: 0; width: max-content; max-width: calc(100vw - 24px); white-space: normal; border-color: var(--rn-line); background: var(--rn-surface); color: var(--rn-ink); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16); }

  body .viewer-shell, body .songbook-shell, body .story-shell, body .game-shell { margin-top: 0; padding: calc(52px + env(safe-area-inset-top, 0px)) 0 calc(72px + env(safe-area-inset-bottom, 0px)); min-height: 100svh; }
  body .viewer-shell, body .songbook-shell, body .story-shell, body .game-shell { padding-top: calc(60px + env(safe-area-inset-top, 0px)); }
  body .viewer-board, body .songbook-board, body .story-board, body .game-board { margin: 0 8px; padding: 14px 12px 18px; border: 1px solid var(--border); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow-xl); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }

  /* 하단 탭 바 */
  .side-nav, body[data-theme="dark"] .side-nav, body[data-page="home"][data-theme] .side-nav {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; transform: none; justify-content: space-around; gap: 0;
    padding: 0 0 env(safe-area-inset-bottom, 0px); border: 0; border-top: 1px solid var(--rn-line); border-radius: 0;
    background: var(--rn-tab-bg); box-shadow: none; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .side-nav.is-nav-hidden { transform: none; }
  .side-nav .side-nav-item, body[data-page="home"][data-theme] .side-nav .side-nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    width: 20%; min-width: 0; height: 58px; padding: 0; border-radius: 0; background: transparent; color: var(--rn-muted);
  }
  .side-nav .side-nav-item svg { display: block; width: 22px; height: 22px; padding: 3px 14px; box-sizing: content-box; border-radius: var(--r-pill); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: background 160ms ease; }
  .side-nav .side-nav-item span { font-size: var(--fs-11); font-weight: 700; letter-spacing: -.01em; }
  .side-nav .side-nav-item.is-active, body[data-page="home"][data-theme] .side-nav .side-nav-item.is-active { color: var(--rn-accent-ink); background: transparent; }
  .side-nav .side-nav-item.is-active svg { background: var(--rn-accent-soft); }
  .main-with-nav { padding-bottom: 0; }
  /* 끝까지 스크롤하면 주소창이 접혀 화면이 길어진다(100lvh). 홈 그라데이션도 그 높이까지
     덮어야 아래에 경계선과 덮개 없는 사진이 드러나지 않는다. */
  .renewal-home { min-height: 100vh; min-height: 100lvh; padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }

  /* 노래책: 제목과 검색·랜덤을 한 줄에 */
  body .songbook-head { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; padding: 0 0 12px; }
  body .songbook-head h2 { font-size: var(--fs-22); }
  body .songbook-head-actions { display: flex; flex: none; width: auto; gap: 6px; margin: 0; }
  body .songbook-head-actions .song-random-button { flex: none; width: auto; height: 34px; padding: 0 12px; font-size: var(--fs-13); }
  body .songbook-table-card { padding: 12px 10px; border-radius: var(--r-lg); box-shadow: none; }
  body .song-detail.is-open { bottom: calc(59px + env(safe-area-inset-bottom, 0px)); max-height: calc(80svh - 59px); }

  /* 스토리·게임: 꽉 찬 화면에 맞춰 안쪽 여백 정리 */
  body .story-journey { border-radius: var(--r-xl); }

  /* 일정: 연·월을 한 줄로("‹ 2026년 10월 ›"), 연도 화살표는 감춘다(월 화살표가 해를 넘어감). */
  body .calendar-card { padding: 4px 2px 8px; background: transparent; border: 0; box-shadow: none; }
  body .calendar-head { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
  body .calendar-nav-wrap { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 2px; flex: 1 0 auto; min-width: max-content; width: auto; }
  body .calendar-nav-wrap .calendar-nav { display: contents; }
  body #year-prev, body #year-next { display: none; }
  body #month-prev { order: 1; } body #year-title { order: 2; } body #month-title { order: 3; } body #month-next { order: 4; }
  body .calendar-nav-wrap h2 { flex: none; width: auto; min-width: 0; margin: 0; padding: 0 2px; font-size: var(--fs-18); font-weight: 800; letter-spacing: -.03em; color: var(--rn-ink); background: none; }
  body .calendar-nav-wrap .nav-title-full { display: inline; } body .calendar-nav-wrap .nav-title-compact { display: none; }
  body .calendar-nav-wrap .icon-button.icon-button-small { width: 32px; height: 32px; min-height: 32px; border: 0; background: transparent; color: var(--rn-ink); font-size: var(--fs-20); box-shadow: none; }
  body .calendar-head-actions { flex: none; gap: 6px; }
  /* 카페 공지 링크는 제목 줄 아래 한 줄로 따로 둔다(같은 줄에 두면 제목과 겹쳤다). */
  body .calendar-head .calendar-notice-link:not(.hidden) { order: 3; flex: 1 0 100%; max-width: none; margin: 0; padding: 2px 4px 0; justify-content: flex-start; font-size: var(--fs-13); }
  body .calendar-head .calendar-notice-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body .calendar-head-actions .mobile-view-toggle, body .calendar-head-actions .calendar-search-trigger { height: 32px; border: 1px solid var(--rn-line); background: var(--rn-surface); color: var(--rn-ink); box-shadow: none; }

  .mday { display: grid; gap: 14px; }
  .mday-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; padding: 6px 2px; border-radius: var(--r-xl); background: var(--rn-surface); border: 1px solid var(--rn-line); }
  .mday-date { display: grid; justify-items: center; gap: 3px; padding: 6px 0 5px; border: 0; border-radius: var(--r-lg); background: transparent; color: var(--rn-ink); cursor: pointer; }
  .mday-weekday { font-size: var(--fs-11); font-weight: 700; color: var(--rn-muted); }
  .mday-date.is-sun .mday-weekday { color: #d1495b; } .mday-date.is-sat .mday-weekday { color: #3f73c8; }
  .mday-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: var(--fs-15); font-weight: 800; font-variant-numeric: tabular-nums; }
  .mday-date.is-today .mday-number { color: var(--rn-accent-ink); box-shadow: inset 0 0 0 1.5px currentColor; }
  .mday-date.is-active .mday-number { background: var(--c-teal-ink); color: #ffffff; box-shadow: none; }
  body[data-theme="dark"] .mday-date.is-active .mday-number { background: #9fe3d8; color: #18353b; }
  .mday-date.is-outside .mday-number, .mday-date.is-off .mday-number { opacity: .45; }
  .mday-date.is-active .mday-number { opacity: 1; }
  .mday-dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
  .mday-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 0 4px; }
  .mday-title h3 { margin: 0; font-size: var(--fs-18); font-weight: 800; letter-spacing: -.03em; color: var(--rn-ink); }
  .mday-today { margin-left: 4px; padding: 2px 7px; border-radius: var(--r-pill); background: var(--rn-accent-soft); color: var(--rn-accent-ink); font-size: var(--fs-11); vertical-align: middle; }
  .mday-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 5px 0 0; font-size: var(--fs-12); color: var(--rn-muted); }
  .mday-chip { padding: 2px 8px; border-radius: var(--r-pill); background: var(--rn-accent-soft); color: var(--rn-accent-ink); font-size: var(--fs-11); font-weight: 800; }
  .mday-chip.is-off { background: var(--rn-chip); color: var(--rn-muted); }
  .mday-meta .mobile-day-edit-button { margin-left: auto; height: 26px; padding: 0 10px; border: 1px solid var(--rn-line); border-radius: var(--r-pill); background: var(--rn-surface); color: var(--rn-ink); font-size: var(--fs-12); font-weight: 700; }
  .mday-arrows { display: flex; gap: 4px; }
  .mday-arrows .mobile-day-arrow { width: 34px; height: 34px; border: 1px solid var(--rn-line); border-radius: 50%; background: var(--rn-surface); color: var(--rn-ink); font-size: var(--fs-18); box-shadow: none; }
  .mday .mobile-entry-list { gap: 8px; }
  .mday .mobile-entry-card { padding: 12px 14px 12px 16px; border: 1px solid var(--rn-line); border-left: 4px solid var(--mobile-entry-color, var(--rn-line)); border-radius: var(--r-lg); background: var(--rn-surface); box-shadow: none; }
  .mday .mobile-entry-category { min-height: 0; padding: 0; background: none; color: var(--rn-muted); font-size: var(--fs-11); font-weight: 700; }
  .mday .mobile-entry-body { margin-top: 3px; }
  .mday .mobile-entry-title { color: var(--rn-ink); font-size: var(--fs-16); }
  .mday .mobile-day-empty { padding: 18px 14px; border: 1px dashed var(--rn-line); border-radius: var(--r-lg); background: transparent; color: var(--rn-muted); font-size: var(--fs-14); }
  .mday .mobile-day-note-card, .mday .mobile-day-image-card { border: 1px solid var(--rn-line); border-radius: var(--r-lg); background: var(--rn-surface); box-shadow: none; }
}


/* 페이지 끝을 넘어 당겼을 때 보이는 바탕(기본 흰색)을 하단 메뉴 색과 맞춘다. */
html:has(body[data-theme="light"]) { background-color: #f7fbfb; }
html:has(body[data-theme="dark"]) { background-color: var(--c-night-2); }

/* 밈: 화 안내기 1일차 (10/29). KCC은영체는 이 문구 글자만 잘라 넣었다. 문구는 취소선, 뒤에 (실패). */
@font-face { font-family: "KCC Eunyoung Anger"; src: url("/static/assets/fonts/kcc-eunyoung-anger.woff2") format("woff2"); font-display: swap; }
.anger-day-note { margin-top: auto; align-self: flex-end; padding: 0 2px; font: 400 1.2rem/1.1 "KCC Eunyoung Anger", "Gaegu", "Noto Sans KR", cursive; color: #e2574c; -webkit-text-stroke: .7px currentColor; letter-spacing: -.01em; white-space: nowrap; position: relative; z-index: 2; text-shadow: 0 0 3px #ffffff, 0 0 3px #ffffff; transform: rotate(-4deg); pointer-events: none; }
.anger-day-note s { text-decoration-thickness: 1px; text-decoration-color: rgba(226, 87, 76, 0.6); }
body[data-theme="dark"] .anger-day-note { color: #ff8f84; text-shadow: 0 0 3px var(--c-night-2), 0 0 3px var(--c-night-2); }
#mobile-day-view .anger-day-note { width: fit-content; margin: 12px 8px 4px auto; font-size: var(--fs-22); }

/* 개선안 반영: 칩 잘림, 최신 영상 빈칸, 편집 버튼 누르는 영역, 편집 창 저장 상태, 키보드 포커스 */
.day-tools { max-width: calc(100% - 18px); gap: 4px; }
.day-top .time-chip { padding: 4px 5px; letter-spacing: -.01em; }
@media (min-width: 761px) and (max-width: 1520px) {
  .youtube-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .video-card { grid-template-columns: 1fr; gap: 8px; }
}
.postit-row-button, .countdown-row-button { position: relative; width: 22px; height: 18px; font-size: var(--fs-12); }
.postit-row-button::after, .countdown-row-button::after { content: ''; position: absolute; inset: -7px -5px; }
.editor-time-grid { grid-template-columns: 108px minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
.editor-time-colon { margin-top: 8px; color: var(--muted); font-weight: 800; }
@media (max-width: 760px) { .editor-time-grid { grid-template-columns: 92px minmax(0, 1fr) auto minmax(0, 1fr); } }
.editor-head { flex-direction: column; gap: 2px; }
.editor-head .save-status { margin: 0; min-height: 1.2em; text-align: center; color: var(--muted); font-size: var(--fs-13); }
.editor-head .save-status:empty::before { content: '편집 중'; opacity: .75; }
.story-replay-edit, .story-replay-remove { padding: 0 11px; }
.story-replay-remove { margin-left: 4px; border-left-width: 1px; }
.story-replay-remove:hover { color: #c0392b; }
:where(button, a, [tabindex]:not(input):not(textarea)):focus-visible { outline: 2px solid #2f8f9f; outline-offset: 2px; }

/* 디자인 개선 시안 1·2·3·5 적용 */
/* 일정·노래책·스토리 판: 반투명 대신 바다색 단색 면 + 얇은 선 */
html body .viewer-board, html body .songbook-board, html body .story-board { background: var(--c-sea-100) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; border: 1px solid var(--c-sea-200) !important; box-shadow: none !important; border-radius: var(--r-md) !important; }
html body :is(.profile-card,.status-card,.calendar-card,.widget-card,.countdown-card,.memory-today-card,.countdown-item,.song-detail,.song-list-card,.story-chapter) { box-shadow: none !important; border-radius: var(--r-md) !important; }
html body :is(.countdown-card,.memory-today-card) { background: #f7fbfb !important; border: 1px solid var(--c-sea-200) !important; }
html body .countdown-item { background: var(--c-mist) !important; }
html body .countdown-item.soon { background: #f7fbfb !important; }
html body .countdown-item.urgent { background: #fff3e8 !important; }
html body .countdown-item.urgent.is-dday { background: #ffeef6 !important; }
html body[data-theme=dark] :is(.countdown-card,.memory-today-card) { background: var(--c-ink-deep) !important; border-color: var(--c-ink-grey) !important; }
html body[data-theme=dark] .countdown-item { background: #1d3140 !important; }
html body :is(.profile-card,.status-card,.calendar-card,.widget-card) { background: #f7fbfb !important; border: 1px solid var(--c-sea-200) !important; }
html body[data-theme=dark] .viewer-board, html body[data-theme=dark] .songbook-board, html body[data-theme=dark] .story-board { background: var(--c-navy) !important; border-color: var(--c-ink-grey) !important; }
html body[data-theme=dark] :is(.profile-card,.status-card,.calendar-card,.widget-card) { background: var(--c-ink-deep) !important; border-color: var(--c-ink-grey) !important; }
/* 카드 기울기·마스킹테이프 없애고 포스트잇은 연하게 */
html :is(.profile-card,.status-card,.postit-card,.countdown-card,.memory-today-card) { transform: none !important; }
html .postit-tape, html .postit-card::after { display: none !important; }
html .postit-card { background: #fff6df !important; border: 1px solid #e6dcae !important; box-shadow: none !important; border-radius: var(--r-md) !important; min-height: 0 !important; }
html body[data-theme=dark] .postit-card { background: #2a2a20 !important; border-color: #4a4630 !important; color: #ece6c8 !important; }
/* 노래책 필터 칩: 회색, 고른 것만 청록. 칩 앞 기호 숨김. 범례 점은 진하게 */
html .song-tag-filter-chip, html .song-tag-filter-chip[class*="tag-"] { border: 1px solid #c9d6dd !important; background: #ffffff !important; color: #44606e !important; box-shadow: none !important; }
html .song-tag-filter-chip.active, html .song-tag-filter-chip[class*="tag-"].active { border-color: var(--c-teal-ink) !important; background: var(--c-teal-ink) !important; color: #ffffff !important; }
html .legend-dot, html .legend-swatch { filter: saturate(1.8) brightness(.9); }
/* 홈 다음 일정: 세로선 대신 작은 네모 점, 시간은 바로 밑 */
html #hero .home-agenda-item { border-left: 0 !important; padding-left: 0 !important; }
html #hero .home-agenda-item .home-agenda-text strong::before { content: ''; display: inline-block; width: 8px; height: 8px; margin: 0 8px 3px 0; background: color-mix(in srgb, var(--dot) 55%, var(--sea-home-ink)); vertical-align: middle; }
html #hero .home-agenda-foot { border-top: 0 !important; padding-top: 0 !important; min-height: 0 !important; margin-top: -10px; }
html .song-tag-filter-chip :is(.song-tag-symbol, .song-tag-symbol-image) { display: none !important; }
html body[data-theme=dark] .song-tag-filter-chip, html body[data-theme=dark] .song-tag-filter-chip[class*="tag-"] { border-color: #2f4555 !important; background: var(--c-ink-deep) !important; color: #bcd0dc !important; }
html body[data-theme=dark] .song-tag-filter-chip.active, html body[data-theme=dark] .song-tag-filter-chip[class*="tag-"].active { border-color: #66b3bd !important; background: #2b6f7c !important; color: #ffffff !important; }
/* 남아 있던 카드·아이콘 그림자 정리: 그림자 대신 얇은 선 */
html body :is(.service-link, .status-live-link) { box-shadow: none !important; border: 1px solid var(--c-sea-200); }
html body[data-theme=dark] :is(.service-link, .status-live-link) { border-color: var(--c-ink-grey); }
html body :is(.songbook-table-card, .songbook-editor) { box-shadow: none !important; }

/* 편집 창 일정 하나를 한 줄로 (오른쪽 +/- 칸 폭 고정으로 줄마다 칸이 맞게) */
html .editor-slot { display: grid !important; grid-template-columns: 30px 150px minmax(0, 1fr) 170px 68px; align-items: center; gap: 8px; padding: 8px 10px !important; }
html .editor-slot-head { display: contents !important; }
html .editor-slot-title { grid-column: 1; grid-row: 1; }
html .editor-slot-title strong { display: none; }
html .editor-slot-actions { grid-column: 5; grid-row: 1; display: flex; justify-content: flex-end; gap: 6px; }
html .editor-slot > label { grid-row: 1; gap: 0 !important; }
html .editor-slot > label:nth-of-type(1) { grid-column: 2; }
html .editor-slot > label:nth-of-type(2) { grid-column: 3; }
html .editor-slot > label:nth-of-type(3) { grid-column: 4; }
html .editor-slot .editor-field-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html .editor-slot :is(select, textarea, input) { margin-top: 0 !important; padding: 9px 11px !important; }
html .editor-slot textarea { min-height: 40px !important; }
html .slot-list { gap: 6px !important; }
@media (max-width: 760px) {
  html .editor-slot { grid-template-columns: 30px minmax(0, 1fr) 68px; }
  html .editor-slot-actions { grid-column: 3; }
  html .editor-slot > label:nth-of-type(1) { grid-column: 2; grid-row: 1; }
  html .editor-slot > label:nth-of-type(2) { grid-column: 1 / -1; grid-row: 2; }
  html .editor-slot > label:nth-of-type(3) { grid-column: 1 / -1; grid-row: 3; }
}

/* 일정 순서 바꾸기: 끄는 줄은 들려서 손을 따라오고, 나머지는 부드럽게 비켜난다 */
.editor-slot-drag { cursor: grab; touch-action: none; }
.slot-list.is-sorting, .slot-list.is-sorting * { cursor: grabbing !important; user-select: none; }
.slot-list.is-sorting .editor-slot { transition: transform 160ms ease; }
.slot-list.is-sorting .editor-slot.is-lifted { position: relative; z-index: 5; transition: none; background: var(--panel-strong, #f7fbfb); border-color: #8fc7d1; box-shadow: 0 10px 24px rgba(16, 45, 60, 0.16); opacity: 1; }
.slot-list.is-sorting .editor-slot.is-lifted.is-dropping { transition: transform 150ms ease; }

/* 노래책: 50곡씩, 검색줄·칩 줄 위에 고정, 검색줄 오른쪽 작은 페이지 이동 (PC) */
@media (min-width: 761px) {
  html .songbook-table-card { overflow: visible !important; }
  html .renewal-song-search { position: sticky; top: 0; z-index: 4; margin: -18px -18px 0 !important; padding: 14px 18px 6px; background: var(--song-sticky-bg, #ffffff); border-radius: calc(var(--r-3xl) - 1px) calc(var(--r-3xl) - 1px) 0 0; }
  html .song-tag-filter-bar { position: sticky; top: var(--song-search-h, 60px); z-index: 4; margin: 0 -18px; padding: 4px 18px 12px !important; background: var(--song-sticky-bg, #ffffff); transition: box-shadow .15s; }
  html .songbook-table-card.is-stuck .song-tag-filter-bar { box-shadow: 0 1px 0 var(--c-sea-100), 0 10px 14px -12px rgba(16, 45, 60, 0.28); }
  html body[data-theme=dark] { --song-sticky-bg: #182a37; }
  html .song-pager-mini { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--c-sea-100); color: var(--rn-muted, var(--c-slate)); font-size: var(--fs-13); font-variant-numeric: tabular-nums; white-space: nowrap; }
  html .song-pager-mini b { color: var(--rn-ink, var(--c-ink)); font-weight: 700; }
  html .song-pager-mini span { padding: 0 4px; }
  html .song-pager-mini button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--rn-ink, var(--c-ink)); font-size: var(--fs-17); line-height: 1; cursor: pointer; }
  html .song-pager-mini button:hover:not(:disabled) { background: color-mix(in srgb, #2f8f9f 12%, transparent); }
  html .song-pager-mini button:disabled { opacity: .3; cursor: default; }
}
.renewal-song-search input:focus, .renewal-song-search input:focus-visible { outline: none; border-color: #5aa9b6; box-shadow: 0 0 0 3px rgba(47, 143, 159, 0.16); }

/* 날짜 보기 창, 사이트 확인창, 아래쪽 알림 */
.site-confirm { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 20px; background: rgb(var(--c-navy-deep-rgb) / 0.36); }
.site-confirm-box { width: min(380px, 100%); padding: 20px; border: 1px solid var(--c-sea-200); border-radius: var(--r-lg); background: #f7fbfb; color: var(--c-ink); box-shadow: 0 18px 40px rgb(var(--c-navy-deep-rgb) / 0.24); font-family: var(--font-sans); }
.site-confirm-box > p { margin: 0 0 18px; font-size: var(--fs-15); line-height: 1.6; word-break: keep-all; }
.site-confirm-box.has-list > p:first-child { margin-bottom: 12px; font-weight: 700; }
.site-confirm-list { display: grid; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.site-confirm-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--c-sea-200); border-radius: var(--r-md); background: #ffffff; }
.site-confirm-thumb { flex: none; display: grid; place-items: center; width: 40px; height: 40px; overflow: hidden; border-radius: 6px; background: var(--c-sea-100, #e6f0f1); color: var(--c-teal-ink); font-size: .72rem; font-weight: 700; }
.site-confirm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.site-confirm-item { display: grid; gap: 2px; min-width: 0; }
.site-confirm-item b { overflow: hidden; font-size: .94rem; white-space: nowrap; text-overflow: ellipsis; }
.site-confirm-item b small { margin-right: 6px; color: var(--c-teal-ink); font-size: .78rem; font-weight: 700; }
.site-confirm-item > span { overflow: hidden; color: #5d6f78; font-size: .82rem; white-space: nowrap; text-overflow: ellipsis; }
.site-confirm-box > p.site-confirm-note { margin: 0 0 16px; color: #42545d; font-size: .9rem; }
body[data-theme=dark] .site-confirm-list li { border-color: #2f4555; background: #1d3140; }
body[data-theme=dark] .site-confirm-thumb { background: #2a4252; color: var(--c-sea-100); }
body[data-theme=dark] .site-confirm-item b small { color: #7fc4cf; }
body[data-theme=dark] :is(.site-confirm-item > span, .site-confirm-box > p.site-confirm-note) { color: #a9bcc6; }
.site-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.site-confirm-actions button { min-width: 72px; height: 38px; padding: 0 14px; border: 1px solid var(--c-sea-200); border-radius: var(--r-md); background: #ffffff; color: var(--c-ink); font: 600 .88rem/1 'Noto Sans KR', sans-serif; cursor: pointer; }
.site-confirm-actions button.is-primary { border-color: var(--c-teal-ink); background: var(--c-teal-ink); color: #ffffff; }
.site-confirm-actions button.is-danger { border-color: #c0392b; background: #c0392b; color: #ffffff; }
body[data-theme=dark] .site-confirm-box { border-color: var(--c-ink-grey); background: var(--c-ink-deep); color: var(--c-sea-100); }
body[data-theme=dark] .site-confirm-actions button { border-color: #2f4555; background: #1d3140; color: var(--c-sea-100); }
body[data-theme=dark] .site-confirm-actions button.is-primary { border-color: #2b6f7c; background: #2b6f7c; }
.site-toast { position: fixed; left: 50%; bottom: 24px; z-index: 10001; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 11px 12px 11px 16px; border-radius: var(--r-md); background: var(--c-ink); color: #ffffff; font: 500 .88rem/1.4 'Noto Sans KR', sans-serif; box-shadow: 0 10px 26px rgb(var(--c-navy-deep-rgb) / 0.28); opacity: 0; visibility: hidden; transform: translate(-50%, 8px); transition: opacity .18s, transform .18s, visibility 0s .18s; }
.site-toast.is-open { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .18s, transform .18s; }
.site-toast button { padding: 6px 10px; border: 0; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.16); color: #ffffff; font: 700 .84rem/1 'Noto Sans KR', sans-serif; cursor: pointer; }
.day-view-box { width: min(440px, 100%); }
.day-view-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.day-view-head h3 { margin: 0; font-size: var(--fs-18); font-weight: 800; }
.day-view-status { padding: 3px 9px; border-radius: var(--r-pill); background: rgb(var(--c-accent-rgb) / 0.16); color: var(--c-teal-ink); font-size: var(--fs-12); font-weight: 700; }
.day-view-status.is-off { background: var(--c-sea-100); color: var(--c-slate); }
.day-view-status.is-external { background: rgba(139, 104, 214, 0.16); color: #6a4cb8; }
.day-view-list { display: grid; gap: 2px; margin: 0 0 14px; padding: 0; list-style: none; }
.day-view-list li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--c-sea-100); }
.day-view-list li:first-child { border-top: 0; }
.day-view-list li::before { content: ''; width: 8px; height: 8px; margin-top: 7px; background: var(--dot); }
.day-view-list strong { display: block; font-size: var(--fs-15); font-weight: 700; line-height: 1.5; word-break: keep-all; }
.day-view-list small { display: block; color: var(--c-slate); font-size: var(--fs-13); }
.day-view-list li > span { color: var(--c-slate); font-size: var(--fs-12); white-space: nowrap; }
.day-view-empty, .day-view-memo { margin: 0 0 14px; color: var(--c-slate); font-size: var(--fs-14); }
.day-view-memo { padding: 10px 12px; border-radius: var(--r-md); background: var(--c-mist); white-space: pre-wrap; }
body[data-theme=dark] :is(.day-view-list li) { border-color: var(--c-ink-grey); }
body[data-theme=dark] :is(.day-view-list small, .day-view-list li > span, .day-view-empty) { color: var(--c-steel); }
body[data-theme=dark] .day-view-memo { background: #1d3140; color: #c9d6dd; }
.calendar-day { cursor: pointer; }
/* 일정 탭 왼쪽 카드 간격을 16px로 통일 */
html .viewer-left .viewer-left-secondary > * { margin-top: 0 !important; margin-bottom: 0 !important; }
/* 달력 칸: 못 넣은 일정은 "외 N개" 표시만(칸을 누르면 날짜 보기) */
.day-more-count { display: block; margin-top: 2px; padding: 2px 4px; color: var(--muted, var(--c-slate)); font-size: var(--fs-12); font-weight: 600; }
.entry-chip.has-note { padding-right: 8px; }
/* 휴대폰 일정 카드: 기타를 제목 아래에 바로 */
.mobile-entry-note { display: block; margin-top: 3px; color: var(--rn-muted, var(--c-slate)); font-size: var(--fs-13); font-weight: 500; line-height: 1.45; word-break: keep-all; }

/* 달력: 기타가 있는 칩의 작은 점, 날짜 칸 마우스 미리보기, 날짜 메모 표시, 외 N개 */
.entry-note-dot { flex: 0 0 5px; width: 5px; height: 5px; border-radius: 50%; background: rgb(var(--c-night-rgb) / 0.36); }
.day-peek { position: absolute; z-index: 60; width: 260px; padding: 12px 14px; border: 1px solid var(--c-sea-200); border-radius: var(--r-md); background: #f7fbfb; color: var(--c-ink); box-shadow: 0 12px 28px rgb(var(--c-navy-deep-rgb) / 0.16); font-family: var(--font-sans); pointer-events: none; }
.day-peek-title { display: block; margin-bottom: 6px; font-size: var(--fs-14); font-weight: 800; }
.day-peek ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.day-peek li { display: grid; grid-template-columns: 6px minmax(0, 1fr); column-gap: 8px; font-size: var(--fs-13); line-height: 1.45; }
.day-peek li::before { content: ''; width: 6px; height: 6px; margin-top: 6px; background: color-mix(in srgb, var(--dot) 70%, var(--c-ink)); }
.day-peek li small { grid-column: 2; color: var(--c-slate); font-size: var(--fs-12); }
body[data-theme=dark] .day-peek { border-color: var(--c-ink-grey); background: var(--c-ink-deep); color: var(--c-sea-100); }
body[data-theme=dark] .day-peek li small { color: var(--c-steel); }

.day-peek-memo { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--c-sea-100); color: var(--c-slate); font-size: var(--fs-12); line-height: 1.5; white-space: pre-wrap; }
body[data-theme=dark] .day-peek-memo { border-color: var(--c-ink-grey); color: var(--c-steel); }
.day-memo-chip { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: var(--r-pill); background: var(--button-ghost, #eef2f4); color: var(--muted, var(--c-slate)); font-size: var(--fs-12); font-weight: 700; line-height: 1.16; white-space: nowrap; }
.calendar-day .entry-list { flex: 1 1 auto; }
.day-more-count { align-self: flex-end; margin: auto 0 0 !important; padding: 0 2px !important; }

/* 편집 창 간소화: 상태 버튼 줄, 짧은 시간 칸, 메모·이미지 한 줄, 일정 추가 버튼 하나 */
html .editor-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 10px; align-items: end; }
html .editor-form > :is(.editor-inline-fields, .slot-list, .editor-add-entry, #editor-day-image-preview) { grid-column: 1 / -1; }
html .editor-inline-fields { grid-template-columns: auto auto !important; justify-content: start; gap: 12px 18px !important; }
html #editor-external-field { grid-column: 1 / -1; }
html #editor-status-mode { display: none !important; }
html .editor-status-segments { display: inline-flex; margin-top: 8px; padding: 3px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-soft); }
html .editor-status-segments button { height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--muted); font: 700 .88rem/1 'Noto Sans KR', sans-serif; white-space: nowrap; cursor: pointer; }
html .editor-status-segments button[aria-checked="true"] { background: var(--c-teal-ink); color: #ffffff; }
html .editor-time-grid { grid-template-columns: 74px 52px auto 52px !important; }
html .editor-time-grid :is(input, select) { padding: 9px 8px !important; text-align: center; }
html .editor-day-note { margin: 0 !important; gap: 0 !important; }
html .editor-day-note .editor-field-title, html .editor-day-image-head, html .editor-day-image-help { display: none !important; }
html #editor-day-note { box-sizing: border-box; height: 42px; min-height: 42px !important; padding: 10px 13px !important; line-height: 20px !important; }
html .editor-day-note::before { content: none; }
html #editor-day-note::placeholder { color: var(--muted); }
html .editor-day-image { margin: 0 !important; }
html .editor-day-image-picker { height: 42px; display: inline-flex; align-items: center; padding: 0 14px !important; }
html .editor-slot { grid-template-columns: 30px 130px minmax(0, 1fr) 200px 30px !important; }
html .editor-row-button.add { display: none !important; }
html .editor-add-entry { height: 40px; border: 1px dashed var(--border); border-radius: var(--r-md); background: transparent; color: var(--muted); font: 700 .88rem/1 'Noto Sans KR', sans-serif; cursor: pointer; }
html .editor-add-entry:hover { border-color: #5aa9b6; color: var(--c-teal-ink); }
html .editor-add-entry[hidden] { display: none; }
@media (max-width: 760px) {
  html .editor-inline-fields { grid-template-columns: 1fr !important; }
  html .editor-status-segments { display: flex; }
  html .editor-status-segments button { flex: 1; padding: 0 6px; }
  html .editor-slot { grid-template-columns: 30px minmax(0, 1fr) 30px !important; }
}

/* 일정 검색 버튼: 이모지 대신 설정 톱니와 같은 선 아이콘 */
.calendar-search-trigger { display: inline-flex; align-items: center; justify-content: center; color: var(--rn-ink); }
.calendar-search-trigger .search-icon { display: block; flex: none; }

/* 일정 검색 창 (2026-11): 검색어가 맨 위 주인공, 그 아래 카테고리·기간(날짜 고르기), 결과는 상자 없이 줄로 나열 */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html body .calendar-search-dialog {
  display: flex; flex-direction: column; width: min(560px, calc(100vw - 24px)); max-height: min(86vh, 760px);
  padding: 20px !important; border: 1px solid var(--rn-line) !important; border-radius: var(--r-xl) !important;
  background: var(--rn-surface) !important; box-shadow: 0 18px 48px rgb(var(--c-night-rgb) / 0.22) !important; color: var(--rn-ink);
}
html body .calendar-search-form { display: grid; gap: 14px; margin: 0; padding: 0; border: 0; background: transparent; }
html body .calendar-search-head { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 0; }
html body .calendar-search-head h3 { margin: 0; font-size: var(--fs-18); font-weight: 800; letter-spacing: -0.01em; }
html body .calendar-search-close { width: 40px; height: 40px; margin: -8px -8px -8px 0; border: 0; border-radius: 50%; background: transparent; color: var(--rn-muted); font-size: 24px; line-height: 1; cursor: pointer; }
html body .calendar-search-close:hover { background: rgb(var(--c-accent-rgb) / 0.08); }
html body .calendar-search-query-field {
  display: flex; align-items: center; gap: 10px; height: 50px; margin: 0; padding: 0 14px;
  border: 1px solid var(--rn-line); border-radius: var(--r-lg); background: var(--rn-input); color: var(--rn-muted);
}
html body .calendar-search-query-field:focus-within { border-color: var(--c-teal-ink); box-shadow: 0 0 0 3px rgb(var(--c-accent-rgb) / 0.16); }
html body .calendar-search-query-field input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--rn-ink); font: inherit; font-size: var(--fs-16); }
html body .calendar-search-fields { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; margin: 0; padding: 0; }
html body .calendar-search-fields label, html body .calendar-search-range { display: grid; gap: 6px; margin: 0; }
html body .calendar-search-fields :is(label, .calendar-search-range) > span { color: var(--rn-muted); font-size: var(--fs-12); font-weight: 700; }
html body .calendar-search-fields :is(select, input) {
  width: 100%; min-width: 0; height: 42px; padding: 0 10px; border: 1px solid var(--rn-line); border-radius: var(--r-md);
  background: var(--rn-input); color: var(--rn-ink); font: inherit; font-size: var(--fs-14);
}
html body .calendar-search-range-inputs { display: flex; align-items: center; gap: 6px; }
html body .calendar-search-range-inputs > span { color: var(--rn-muted); }
html body .calendar-search-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 0; }
html body .calendar-search-reset { height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--rn-muted); font-size: var(--fs-14); font-weight: 700; cursor: pointer; }
html body .calendar-search-submit { height: 40px; padding: 0 22px; border: 0; border-radius: var(--r-md); background: var(--c-teal-ink); color: #ffffff; font-size: var(--fs-14); font-weight: 800; cursor: pointer; }
html body[data-theme=dark] .calendar-search-submit { background: var(--c-accent); color: var(--c-night); }
html body .calendar-search-results { display: grid; gap: 0; min-height: 0; margin: 14px 0 0; padding: 0; overflow-y: auto; border-top: 1px solid var(--rn-line); }
html body .calendar-search-empty { padding: 22px 0 6px; border: 0; background: transparent; color: var(--rn-muted); font-size: var(--fs-14); text-align: center; }
html body .calendar-search-result {
  display: grid; gap: 4px; width: 100%; margin: 0; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--rn-line); border-radius: 0;
  background: transparent; color: var(--rn-ink); text-align: left; box-shadow: none; cursor: pointer;
}
html body .calendar-search-result:hover { background: rgb(var(--c-accent-rgb) / 0.06); transform: none; }
html body .calendar-search-result-top { display: flex; align-items: center; gap: 8px; margin: 0; }
html body .calendar-search-result-date { color: var(--rn-muted); font-size: var(--fs-12); font-weight: 700; }
html body .calendar-search-result-category { padding: 2px 8px; border-radius: var(--r-pill); color: var(--c-night); font-size: var(--fs-11); font-weight: 700; }
html body .calendar-search-result-title { margin: 0; color: var(--rn-ink); font-size: var(--fs-15); font-weight: 700; }
html body .calendar-search-result-note { margin: 0; color: var(--rn-muted); font-size: var(--fs-13); }
@media (max-width: 760px) {
  html body .calendar-search-dialog { width: calc(100vw - 20px); max-height: calc(100svh - 40px); padding: 18px 16px !important; }
  html body .calendar-search-fields { grid-template-columns: 1fr; }
}

/* 노래책 태그 선 아이콘 */
.song-tag-symbol { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.song-tag-symbol .song-tag-icon { display: block; flex: none; }

/* 개인정보처리방침 창 (2026-11): 일정 검색 창과 같은 톤. 제목 줄은 고정, 본문만 스크롤 */
html body .policy-modal { background: rgb(var(--c-night-rgb) / 0.42); }
html body .policy-dialog {
  display: flex; flex-direction: column; width: min(640px, calc(100vw - 24px)); max-height: min(84vh, 820px);
  padding: 0 !important; overflow: hidden; border: 1px solid var(--rn-line) !important; border-radius: var(--r-xl) !important;
  background: var(--rn-surface) !important; box-shadow: 0 18px 48px rgb(var(--c-night-rgb) / 0.22) !important; color: var(--rn-ink);
}
html body .policy-head { flex: none; display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 18px 20px 14px; border-bottom: 1px solid var(--rn-line); }
html body .policy-head h3 { margin: 0; font-size: var(--fs-18); font-weight: 800; letter-spacing: -0.01em; }
html body .policy-close { width: 40px; height: 40px; margin: -8px -10px -8px 0; border: 0; border-radius: 50%; background: transparent; color: var(--rn-muted); font-size: 24px; line-height: 1; cursor: pointer; }
html body .policy-close:hover { background: rgb(var(--c-accent-rgb) / 0.08); }
html body .policy-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 22px; color: var(--rn-ink); font-size: var(--fs-14); line-height: 1.7; }
html body .policy-body > p:first-child, html body .policy-body > p:nth-child(2) { color: var(--rn-muted); }
html body .policy-body h4 { margin: 20px 0 6px; color: var(--rn-ink); font-size: var(--fs-15); font-weight: 800; }
html body .policy-body p, html body .policy-body ol, html body .policy-body ul { margin: 0 0 8px; }
html body .policy-body :is(ol, ul) { padding-left: 18px; color: var(--rn-ink); }
html body .policy-body li + li { margin-top: 2px; }
html body .policy-body a { color: var(--c-teal-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
html body[data-theme=dark] .policy-body a { color: var(--c-accent); }
@media (max-width: 760px) {
  html body .policy-dialog { width: calc(100vw - 20px); max-height: calc(100svh - 40px); }
  html body .policy-head { padding: 16px 16px 12px; }
  html body .policy-body { padding: 14px 16px 20px; }
}

/* 노래책 정렬: 분류 칩 줄 오른쪽 끝의 버튼 + 직접 그린 메뉴 */
.song-sort-trigger { display: inline-flex; flex: none; align-items: center; gap: 6px; height: 32px; margin-left: auto; padding: 0 11px 0 13px; border: 1px solid var(--rn-line); border-radius: var(--r-pill); background: var(--rn-surface); color: var(--rn-ink); font: inherit; font-size: var(--fs-13); font-weight: 700; white-space: nowrap; cursor: pointer; }
.song-sort-trigger svg { width: 12px; height: 12px; color: var(--rn-muted); transition: transform .15s; }
.song-sort-trigger[aria-expanded="true"] { border-color: var(--rn-accent-ink); }
.song-sort-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.song-sort-trigger:focus-visible, .song-sort-menu button:focus-visible { outline: 2px solid var(--rn-accent-ink); outline-offset: 2px; }
.song-sort-menu { position: fixed; z-index: 80; display: grid; min-width: 150px; padding: 5px; border: 1px solid var(--rn-line); border-radius: var(--r-lg); background: var(--rn-surface); box-shadow: 0 14px 34px rgba(16, 45, 60, 0.18); }
.song-sort-menu button { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 36px; padding: 0 10px 0 12px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--rn-ink); font: inherit; font-size: var(--fs-13); font-weight: 600; text-align: left; cursor: pointer; }
.song-sort-menu button:hover { background: var(--rn-chip); }
.song-sort-menu button svg { width: 14px; height: 14px; color: var(--rn-accent-ink); visibility: hidden; }
.song-sort-menu button[aria-checked="true"] { color: var(--rn-accent-ink); font-weight: 800; }
.song-sort-menu button[aria-checked="true"] svg { visibility: visible; }
body[data-theme=dark] .song-sort-menu { box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45); }
body[data-theme=dark] .song-sort-menu button[aria-checked="true"], body[data-theme=dark] .song-sort-menu button svg { color: #8fd3d6; }

/* 정렬했을 때 날짜·첫 글자 구분줄 */
.song-group-divider { display: flex; align-items: baseline; justify-content: space-between; padding: 18px 4px 8px; border-top: 1px solid var(--rn-line); color: var(--rn-ink); font-size: var(--fs-14); font-weight: 800; }
.song-group-divider:first-child { padding-top: 8px; }
.song-group-divider small { color: var(--rn-muted); font-size: var(--fs-12); font-weight: 600; font-variant-numeric: tabular-nums; }
.song-list-note { margin: 0; padding: 16px 4px 4px; border-top: 1px solid var(--rn-line); color: var(--rn-muted); font-size: var(--fs-12); }

/* 일정 날짜 보기의 "이날 부른 노래": 일정과 섞여 보이지 않게 따로 된 칸으로 */
.day-view-box { max-height: calc(100vh - 32px); overflow-y: auto; }
.day-songs { margin: 4px 0 14px; border: 1px solid var(--rn-line); border-radius: var(--r-lg); background: var(--rn-surface-2); }
.day-songs-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; list-style: none; cursor: pointer; user-select: none; }
.day-songs-head::-webkit-details-marker { display: none; }
.day-songs-head svg { width: 12px; height: 12px; color: var(--rn-muted); transition: transform .15s; }
.day-songs[open] > .day-songs-head svg { transform: rotate(180deg); }
.day-songs-head:focus-visible { outline: 2px solid var(--rn-accent-ink); outline-offset: -2px; border-radius: var(--r-lg); }
.day-songs-label { padding: 2px 8px; border-radius: var(--r-pill); background: var(--rn-accent-soft); color: var(--rn-accent-ink); font-size: var(--fs-11); font-weight: 800; }
.day-songs-head strong { color: var(--rn-ink); font-size: var(--fs-14); font-weight: 800; }
.day-songs-head small { margin-left: auto; color: var(--rn-muted); font-size: var(--fs-12); font-weight: 600; font-variant-numeric: tabular-nums; }
.day-songs ul { margin: 0; padding: 0 14px 6px; list-style: none; }
.day-songs li + li { border-top: 1px solid var(--rn-line); }
.day-songs button { display: flex; align-items: baseline; gap: 12px; width: 100%; padding: 8px 2px; border: 0; border-radius: 0; background: transparent; color: var(--rn-ink); font: inherit; text-align: left; cursor: pointer; }
.day-songs button b { flex: 1; min-width: 0; overflow: hidden; font-size: var(--fs-13); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.day-songs button span { flex: none; max-width: 45%; overflow: hidden; color: var(--rn-muted); font-size: var(--fs-12); text-overflow: ellipsis; white-space: nowrap; }
.day-songs button:hover b { color: var(--rn-accent-ink); text-decoration: underline; text-underline-offset: 3px; }
body[data-theme=dark] .day-songs-label { background: #1f3c42; color: #8fd3d6; }
.mobile-month-detail .day-songs, .mday-card .day-songs { margin: 12px 0 0; }
