/* =========================================================
   CUT STAND · 컷스탠드
   테마: 기본 레드 · 라이트 노랑&파랑 · 라이트 파랑&노랑
   모양은 같고, 색만 다르다
   ========================================================= */

:root {
  --font-ui: 'SUIT', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --font-disp: 'A2Z', 'SUIT', 'Malgun Gothic', sans-serif;
  --font-mono: 'D2Coding', 'Consolas', 'Menlo', 'SUIT', monospace;
  --font-lyric: var(--font-ui);
  --on-ink: #f6f6f6;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --fs: 36px;
  --lh: 1.3;
  --chs: .6;
}

/* ---------- 테마 변수 ---------- */
[data-theme="phantom"] {
  --bg: #0b0b0b; --bg-2: #161616; --bg-3: #242424;
  --fg: #f6f6f6; --fg-2: #cfcfcf; --fg-dim: #8c8c8c;
  --line: rgba(255, 255, 255, .14);
  --accent: #ff1f33; --accent-dark: #a3000f; --accent-ink: #fff;
  --accent-2: #ffffff; --accent-2-ink: #0b0b0b;
  --card-bg: #f4f4f4; --card-fg: #0b0b0b; --card-dim: #6a6a6a;
  --panel-bg: #111; --panel-fg: #f6f6f6; --panel-head: #ff1f33; --panel-head-fg: #fff;
  --input-bg: #1d1d1d; --input-fg: #fff;
  --bar-bg: #000; --bar-fg: #fff; --bar-dim: #8c8c8c; --bar-2: #1c1c1c;
  --ly: #ffffff;
  --ch-bg: #ff1f33; --ch-fg: #fff;
  --memo-bg: #ffffff; --memo-fg: #0b0b0b; --memo-edge: #ff1f33;
  --sec-bg: #ffffff; --sec-fg: #0b0b0b; --sec-short-bg: #ffffff; --sec-short-fg: #0b0b0b;
  --cm-bg: rgba(255, 31, 51, .14); --cm-fg: #ffffff; --cm-bd: #ff1f33;
  --ink: #000; --paper: #fff; --ink-soft: #333; --paper-dim: #666;
  --stripe: #fff; --ghost: #fff;
  --glow: rgba(255, 31, 51, .16);
  --skew: -10deg; --radius: 0px; --track: .02em;
  --shadow: 6px 6px 0 #000;
  --ok: #2bd96b;
}
/* 기본 테마와 같은 모양. 바탕 노랑, 포인트 파랑 */
[data-theme="sun"] {
  --bg: #fff3b0; --bg-2: #ffe98a; --bg-3: #ffd95a;
  --fg: #1a1a1a; --fg-2: #3a3420; --fg-dim: #7a6830;
  --line: rgba(20, 20, 20, .16);
  --accent: #1568ff; --accent-dark: #0c45b8; --accent-ink: #fff;
  --accent-2: #1a1a1a; --accent-2-ink: #fff3b0;
  --card-bg: #ffffff; --card-fg: #1a1a1a; --card-dim: #6a6248;
  --panel-bg: #fffdf4; --panel-fg: #1a1a1a; --panel-head: #1568ff; --panel-head-fg: #fff;
  --input-bg: #ffffff; --input-fg: #1a1a1a;
  --bar-bg: #fffdf6; --bar-fg: #1a1a1a; --bar-dim: #7a6830; --bar-2: #ffe98a;
  --ly: #1a1a1a;
  --ch-bg: #1568ff; --ch-fg: #fff;
  --memo-bg: #ffffff; --memo-fg: #1a1a1a; --memo-edge: #1568ff;
  --sec-bg: #ffffff; --sec-fg: #1a1a1a; --sec-short-bg: #111111; --sec-short-fg: #ffffff;
  --cm-bg: rgba(21, 104, 255, .12); --cm-fg: #1a1a1a; --cm-bd: #1568ff;
  --ink: #111; --paper: #fff; --ink-soft: #333; --paper-dim: #666;
  --stripe: #111; --ghost: #111;
  --glow: rgba(21, 104, 255, .18);
  --skew: -10deg; --radius: 0px; --track: .02em;
  --shadow: 6px 6px 0 #111;
  --ok: #0a9a46;
}
/* 기본 테마와 같은 모양. 바탕 파랑, 포인트 노랑 */
[data-theme="sky"] {
  --bg: #d9eeff; --bg-2: #c5e4ff; --bg-3: #aed6ff;
  --fg: #102033; --fg-2: #24364c; --fg-dim: #5c7390;
  --line: rgba(16, 32, 51, .16);
  --accent: #ffd000; --accent-dark: #e0b400; --accent-ink: #1a1400;
  --accent-2: #1568ff; --accent-2-ink: #fff;
  --card-bg: #ffffff; --card-fg: #102033; --card-dim: #5c7390;
  --panel-bg: #f5faff; --panel-fg: #102033; --panel-head: #ffd000; --panel-head-fg: #1a1400;
  --input-bg: #ffffff; --input-fg: #102033;
  --bar-bg: #f7fbff; --bar-fg: #102033; --bar-dim: #5c7390; --bar-2: #c5e4ff;
  --ly: #102033;
  --ch-bg: #ffd000; --ch-fg: #1a1400;
  --memo-bg: #ffffff; --memo-fg: #102033; --memo-edge: #1568ff;
  --sec-bg: #ffffff; --sec-fg: #102033; --sec-short-bg: #102033; --sec-short-fg: #ffffff;
  --cm-bg: rgba(255, 208, 0, .34); --cm-fg: #102033; --cm-bd: #e0b400;
  --ink: #102033; --paper: #fff; --ink-soft: #24364c; --paper-dim: #5c7390;
  --stripe: #102033; --ghost: #102033;
  --glow: rgba(255, 208, 0, .55);
  --skew: -10deg; --radius: 0px; --track: .02em;
  --shadow: 6px 6px 0 #102033;
  --ok: #0a9a46;
}
/* 섹션 종류별 색 */
.t-intro, .t-outro, .t-other { --tc: #8d8d8d; --tci: #fff; }
.t-verse { --tc: var(--sec-short-bg); --tci: var(--sec-short-fg); }
.t-prechorus { --tc: #ff9f1a; --tci: #111; }
.t-chorus { --tc: var(--accent); --tci: var(--accent-ink); }
.t-bridge { --tc: #b26bff; --tci: #fff; }
.t-solo { --tc: #00c2ff; --tci: #071018; }
/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-ui);
  background-color: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  word-break: keep-all;
  overflow-wrap: break-word;
  transition: background-color .25s;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
input, select, textarea { font: inherit; }
a { color: inherit; }
.ic { width: 1.25em; height: 1.25em; flex: 0 0 auto; display: block; }
kbd {
  font-family: var(--font-disp); font-size: 12px; font-weight: 700; padding: 2px 7px;
  background: var(--bg-3); color: var(--fg); border-radius: 3px; white-space: nowrap;
}

/* ---------- 배경 장식 ---------- */
.bg-deco { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.view { position: relative; z-index: 1; }

body {
  background-image:
    radial-gradient(1200px 600px at -10% -10%, var(--glow), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.045' stroke-width='3'%3E%3Cpath d='M120 14l25 77h81l-65 47 25 77-66-48-66 48 25-77-65-47h81z'/%3E%3Cpath transform='rotate(20 40 200) translate(-20 150) scale(.35)' d='M120 14l25 77h81l-65 47 25 77-66-48-66 48 25-77-65-47h81z'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170' viewBox='0 0 240 240'%3E%3Cpath transform='rotate(-18 120 120)' d='M120 14l25 77h81l-65 47 25 77-66-48-66 48 25-77-65-47h81z' fill='none' stroke='%23ffffff' stroke-opacity='.03' stroke-width='5'/%3E%3C/svg%3E");
  background-size: auto, 240px 240px, 170px 170px;
  background-position: 0 0, 0 0, 80px 60px;
  background-attachment: fixed;
}
[data-theme="sun"] body,
[data-theme="sky"] body {
  background-image:
    radial-gradient(1200px 600px at -10% -10%, var(--glow), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='none' stroke='%23111822' stroke-opacity='.09' stroke-width='3'%3E%3Cpath d='M120 14l25 77h81l-65 47 25 77-66-48-66 48 25-77-65-47h81z'/%3E%3Cpath transform='rotate(20 40 200) translate(-20 150) scale(.35)' d='M120 14l25 77h81l-65 47 25 77-66-48-66 48 25-77-65-47h81z'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170' viewBox='0 0 240 240'%3E%3Cpath transform='rotate(-18 120 120)' d='M120 14l25 77h81l-65 47 25 77-66-48-66 48 25-77-65-47h81z' fill='none' stroke='%23111822' stroke-opacity='.06' stroke-width='5'/%3E%3C/svg%3E");
}
.bolt { position: absolute; display: none; }
body[data-view="home"] .bolt { display: block; }
.bolt.b1 {
  right: -8vw; top: 18vh; width: 48vw; height: 82vh; background: var(--accent); opacity: .92;
  clip-path: polygon(62% 0, 100% 0, 70% 36%, 88% 37%, 30% 100%, 47% 55%, 28% 53%);
}
.bolt.b2 {
  left: -6vw; bottom: -6vh; width: 34vw; height: 46vh; background: var(--ghost); opacity: .06;
  clip-path: polygon(0 30%, 70% 0, 52% 40%, 100% 38%, 20% 100%, 38% 58%, 0 62%);
}
.tvbars { display: none; position: absolute; left: 0; right: 0; top: 0; height: 7px;
  background: linear-gradient(90deg, #fff 0 14.28%, #ffe500 0 28.57%, #00e5ff 0 42.85%, #00e060 0 57.14%, #ff00c8 0 71.42%, #ff1e1e 0 85.71%, #1e3cff 0); }
/* ---------- 버튼 · 입력 ---------- */
.pbtn, .sbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 8px 16px; border: 0; border-radius: var(--radius);
  font-weight: 800; font-size: 15px; letter-spacing: .01em; white-space: nowrap;
  transition: transform .12s var(--ease), box-shadow .12s, background .15s;
}
.pbtn { background: var(--accent); color: var(--accent-ink); }
.sbtn { background: var(--bg-3); color: var(--fg); box-shadow: inset 0 0 0 2px var(--line); }
.pbtn:hover:not(:disabled), .sbtn:hover:not(:disabled) { transform: translate(-1px, -2px); }
.pbtn:active, .sbtn:active { transform: translate(1px, 1px); }
.pbtn.big, .sbtn.big { min-height: 56px; font-size: 18px; padding: 10px 22px; }
.sbtn.danger, .pbtn.danger { background: #d4142a; color: #fff; box-shadow: none; }

.pbtn, .sbtn { transform: skewX(-8deg); }
.pbtn { box-shadow: 4px 4px 0 var(--ink), 4px 4px 0 2px var(--paper); }
.pbtn:hover:not(:disabled) { transform: skewX(-8deg) translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink), 6px 6px 0 2px var(--paper); }
.sbtn { background: var(--ink); color: var(--paper); box-shadow: inset 0 0 0 2px var(--paper); }
.sbtn:hover:not(:disabled) { transform: skewX(-8deg) translate(-2px, -2px); background: var(--paper); color: var(--ink); }
.pbtn:active, .sbtn:active { transform: skewX(-8deg) translate(1px, 1px); }
.ibtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; background: transparent; color: inherit; border-radius: var(--radius); opacity: .8;
  text-decoration: none;
}
.ibtn:hover { opacity: 1; background: var(--line); }
.ibtn .ic { width: 19px; height: 19px; }

.chip {
  border: 0; padding: 6px 11px; font-size: 13px; font-weight: 700; border-radius: 999px;
  background: var(--bg-3); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap;
}
.chip:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.chip.on, .chip.hot { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.chip { border-radius: 0; transform: skewX(-10deg); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.rbtn {
  width: 52px; height: 52px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--bg-3); color: var(--fg); font-weight: 900; font-family: var(--font-disp); font-size: 15px;
  box-shadow: inset 0 0 0 2px var(--line); flex: 0 0 auto;
}
.rbtn:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.rbtn:active { transform: scale(.94); }

input[type="text"], input[type="number"], input[type="search"], select, textarea, .prompt-input {
  width: 100%; background: var(--input-bg); color: var(--input-fg); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 9px 12px; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
textarea { resize: vertical; line-height: 1.55; }

.seg { display: inline-flex; flex-wrap: wrap; background: var(--bg-3); border-radius: var(--radius); padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; font-weight: 700; font-size: 14px; border-radius: var(--radius); color: var(--fg-2); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg button.on { transform: skewX(-8deg); }
.tgl { display: flex; align-items: center; gap: 12px; padding: 9px 0; cursor: pointer; }
.tgl input { position: absolute; opacity: 0; pointer-events: none; }
.tgl i { flex: 0 0 auto; width: 46px; height: 26px; border-radius: 99px; background: var(--bg-3); position: relative; transition: background .15s; box-shadow: inset 0 0 0 2px var(--line); }
.tgl i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--fg-dim); transition: transform .18s var(--ease), background .15s; }
.tgl input:checked + i { background: var(--accent); }
.tgl input:checked + i::after { transform: translateX(20px); background: var(--accent-ink); }
.tgl span { font-weight: 700; display: flex; flex-direction: column; }
.tgl small { font-weight: 500; color: var(--fg-dim); font-size: 12.5px; }

.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld > span { font-size: 12px; font-weight: 800; color: var(--fg-dim); letter-spacing: .04em; }
.fld > span small { font-weight: 500; }
.fld-inline { flex-direction: row; align-items: center; gap: 8px; }
.fld-inline input { width: 90px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.hint { color: var(--fg-dim); font-size: 13px; margin: 8px 0; }
.tb-label { font-family: var(--font-disp); font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--fg-dim); text-transform: uppercase; margin-right: 4px; white-space: nowrap; }

.search { position: relative; display: flex; align-items: center; flex: 1 1 260px; }
.search .ic { position: absolute; left: 12px; color: var(--fg-dim); width: 18px; height: 18px; pointer-events: none; }
.search input { padding-left: 38px; min-height: 44px; }
.search.sm input { min-height: 38px; }

/* =========================================================
   홈
   ========================================================= */
#view-home { max-width: 1320px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 36px) 28px; overflow-x: clip; }

/* 상단: 타이틀 · 탭 · 검색줄이 밴드 그림 위에 겹쳐 보인다 */
.home-top { position: relative; }
.home-top > :not(.hero), #view-home .tab-panel { position: relative; z-index: 1; }
.home-head {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "actions" "logo";
  align-items: end; gap: 4px 28px; padding: 16px 0 18px;
}
.home-head .logo { grid-area: logo; justify-self: start; margin: clamp(10px, 3vw, 40px) 0 18px; }
.logo { margin: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 16px; font-family: var(--font-disp); font-weight: 900; line-height: 1; position: relative; }
.logo-word { display: inline-flex; gap: 3px; align-items: flex-end; }
.lt { display: inline-block; font-size: clamp(40px, 6.4vw, 78px); padding: .04em .1em; }
.logo-ko { font-family: var(--font-ui); font-weight: 900; font-size: 15px; letter-spacing: .3em; align-self: center; padding: 6px 10px; }

.logo::before {
  content: ''; position: absolute; z-index: -1; left: -26px; top: -20px; right: -40px; bottom: -18px; background: var(--accent);
  clip-path: polygon(0 22%, 58% 0, 100% 30%, 84% 38%, 98% 70%, 44% 100%, 50% 78%, 4% 92%);
}
.lt0 { background: var(--paper); color: var(--ink); transform: rotate(-5deg); }
.lt1 { background: var(--ink); color: var(--paper); transform: rotate(4deg) translateY(5px); box-shadow: 0 0 0 3px var(--paper); }
.lt2 { color: var(--accent-ink); transform: rotate(-3deg) scale(1.12); text-shadow: 4px 4px 0 var(--ink); }
.lt3 { background: var(--paper); color: var(--accent); transform: rotate(6deg) translateY(-4px); }
.lt4 { background: var(--ink); color: var(--accent); transform: rotate(-4deg) translateY(3px); }
.lt5 { background: var(--paper); color: var(--ink); transform: rotate(3deg) scale(.92); }
.logo-ko { background: var(--ink); color: var(--paper); transform: skewX(-12deg) rotate(-3deg); box-shadow: 4px 4px 0 var(--paper); }

.head-actions { grid-area: actions; justify-self: end; display: flex; gap: 6px; flex-wrap: wrap; }

/* 메인 밴드 그림: 배경이 투명해서 페이지 배경이 그대로 보인다 */
.hero {
  position: absolute; z-index: 0; right: 0; top: 0; width: min(54%, 720px); aspect-ratio: 922 / 584;
  display: flex; justify-content: flex-end; align-items: flex-end; pointer-events: none; user-select: none;
}
.hero-art {
  position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; object-position: right bottom;
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 22%); mask: linear-gradient(90deg, transparent 0, #000 22%);
  animation: heroIn .6s var(--ease) both;
  /* 필터를 비트맵으로 한 번만 굽고, 아래 이동 애니메이션은 그 비트맵만 옮긴다 */
  transform: translateZ(0);
  backface-visibility: hidden;
}
@keyframes heroIn { from { opacity: 0; } to { opacity: 1; } }

/* 타이틀과 그림이 서로 반대로 천천히 좌우로 흔들린다. translate3d라 레이아웃을 다시 잡지 않는다 */
.home-head .logo { animation: titleDrift 8s ease-in-out infinite; }
.hero { animation: artDrift 10s ease-in-out infinite; }
@keyframes titleDrift { 0%, 100% { transform: translate3d(-6px, 0, 0); } 50% { transform: translate3d(10px, 0, 0); } }
@keyframes artDrift { 0%, 100% { transform: translate3d(14px, 0, 0); } 50% { transform: translate3d(-18px, 0, 0); } }
.hero-stage { position: absolute; z-index: 0; left: 6%; right: 6%; bottom: -2px; height: 9px; background: var(--accent); }
.hero-lines { position: absolute; z-index: 0; top: 12%; width: 22%; height: 64%; opacity: .5;
  background: repeating-linear-gradient(-28deg, var(--accent) 0 3px, transparent 3px 16px); }
.hero-lines { -webkit-mask: radial-gradient(closest-side, #000 35%, transparent); mask: radial-gradient(closest-side, #000 35%, transparent); }
.hero-lines.l1 { left: 4%; }
.hero-lines.l2 { right: 4%; }

.hero-art { filter: drop-shadow(4px 4px 0 var(--ink)) drop-shadow(5px 4px 0 var(--accent)); }
[data-theme="phantom"] .hero-art { filter: invert(1) drop-shadow(4px 4px 0 var(--ink)) drop-shadow(5px 4px 0 var(--accent)); }
.hero-stage { transform: skewX(-32deg); box-shadow: 0 -4px 0 var(--paper); }
.hero-lines { background: repeating-linear-gradient(-28deg, var(--stripe) 0 3px, transparent 3px 16px); opacity: .22; }
.home-foot {
  position: relative; z-index: 1; margin-top: 36px; padding: 14px 0 6px;
  border-top: 1px solid var(--line); text-align: center;
  color: var(--fg-dim); font-size: 13px; font-weight: 700; letter-spacing: .04em;
}
.home-foot a { color: var(--fg); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.home-foot a:hover { color: var(--accent); }
.hbtn {
  display: inline-flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; padding: 8px 8px 6px;
  background: var(--bg-2); border: 0; border-radius: var(--radius); color: var(--fg); font-size: 11.5px; font-weight: 800;
  box-shadow: inset 0 0 0 2px var(--line);
}
.hbtn .ic { width: 22px; height: 22px; }
.hbtn:hover { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); }
.hbtn { background: var(--ink); color: var(--on-ink); transform: skewX(-8deg); box-shadow: inset 0 0 0 2px var(--paper); }
.hbtn:hover { background: var(--accent); color: var(--accent-ink); box-shadow: 4px 4px 0 var(--paper); }
/* 탭 */
.tabs { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 18px; }
.tab {
  position: relative; display: flex; align-items: baseline; gap: 8px; padding: 10px 22px; border: 0;
  background: transparent; color: var(--fg-dim);
}
.tab b { font-family: var(--font-disp); font-weight: 900; font-size: clamp(22px, 3vw, 32px); letter-spacing: var(--track); }
.tab small { font-weight: 700; font-size: 13px; }
.tab-count { font-style: normal; font-family: var(--font-disp); font-weight: 900; font-size: 13px; padding: 1px 7px; background: var(--bg-3); color: var(--fg); border-radius: 99px; }
.tab.on { color: var(--fg); }
.tab { transform: skewX(-12deg); background: var(--ink); color: var(--on-ink); box-shadow: inset 0 0 0 2px var(--ink-soft); }
.tab.on { background: var(--paper); color: var(--ink); box-shadow: 7px 7px 0 var(--accent); }
.tab.on .tab-count { background: var(--accent); color: var(--accent-ink); }
.lib-switch { display: flex; gap: 8px; flex: 0 0 auto; }
.lib-switch button { border: 0; min-height: 44px; padding: 8px 16px; background: var(--ink); color: var(--on-ink); font-family: var(--font-ui); font-weight: 800; font-size: 15px; transform: skewX(-10deg); box-shadow: inset 0 0 0 2px var(--paper); }
.lib-switch button.on { background: var(--paper); color: var(--ink); box-shadow: 4px 4px 0 var(--accent); }
.account-mail { margin: 0 0 8px; font-weight: 800; word-break: break-all; }
.account-form { display: flex; flex-direction: column; gap: 12px; }
.sync-layer { position: fixed; inset: 0; z-index: 220; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.sync-pop { width: min(360px, 100%); text-align: center; padding: 28px 24px 22px; background: var(--panel-bg); color: var(--panel-fg); box-shadow: 0 0 0 3px var(--paper), 12px 12px 0 3px var(--accent); }
.sync-guitar { width: 96px; height: 96px; margin: 0 auto 8px; color: var(--accent); }
.sync-guitar svg { width: 100%; height: 100%; }
.sync-guitar.spin { animation: guitarSpin 1.05s linear infinite; }
@keyframes guitarSpin { to { transform: rotate(360deg); } }
.sync-msg { margin: 8px 0 16px; font-weight: 800; font-size: 17px; }
.sync-track { height: 12px; background: var(--bg-3); box-shadow: inset 0 0 0 2px var(--ink); }
.sync-track i { display: block; height: 100%; width: 0; background: var(--accent); }
.sync-pct { display: block; margin-top: 10px; font-family: var(--font-disp); font-weight: 900; font-size: 34px; letter-spacing: .04em; }
.sync-ok { margin-top: 18px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar select { width: auto; min-height: 44px; }
.toolbar-note { margin: 0; flex: 1 1 300px; color: var(--fg-dim); font-size: 14px; }
.lesson-contact { margin-bottom: 18px; padding: 22px 22px 18px; background: var(--panel-bg); color: var(--panel-fg); box-shadow: 0 0 0 3px var(--paper), 10px 10px 0 3px var(--accent); }
.lesson-kicker { margin: 0 0 6px; font-family: var(--font-disp); font-weight: 900; letter-spacing: .14em; color: var(--accent); }
.lesson-contact h2 { margin: 0; font-family: var(--font-disp); font-weight: 900; font-size: clamp(26px, 4vw, 40px); letter-spacing: .04em; line-height: 1; }
.lesson-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.lesson-brand { display: inline-flex; align-items: center; min-width: 210px; min-height: 56px; padding: 8px 26px 8px 12px; text-decoration: none; color: var(--ink); background: var(--paper); transform: skewX(-8deg); box-shadow: 4px 4px 0 var(--ink), 4px 4px 0 2px var(--paper); }
.lesson-brand-in { display: inline-flex; align-items: center; gap: 12px; transform: skewX(8deg); font-weight: 800; font-size: 16px; }
.lesson-logo { width: 34px; height: 34px; flex: 0 0 auto; }
.lesson-brand:hover { transform: skewX(-8deg) translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink), 6px 6px 0 2px var(--paper); }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.lesson-card { padding: 18px 18px 8px; background: var(--bg-2); color: var(--fg); box-shadow: inset 0 0 0 2px var(--line); }
.lesson-no { margin: 0; font-family: var(--font-disp); font-weight: 900; font-size: 28px; letter-spacing: .06em; color: var(--accent); line-height: 1; }
.lesson-card h3 { margin: 4px 0 8px; font-size: 22px; letter-spacing: -.02em; }
.lesson-card p { margin: 0 0 10px; color: var(--fg-2); }
.lesson-card ul { margin: 0; padding: 0 0 8px 1.1em; }
.lesson-card li { margin: 0 0 8px; }

/* 곡 카드 */
.song-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px 20px; }
.song-card {
  position: relative; isolation: isolate; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
  padding: 16px 16px 14px 14px; color: var(--card-fg); cursor: pointer; outline: none;
  animation: cardIn .4s var(--ease) both; animation-delay: calc(var(--i) * 35ms);
}
.song-card::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--card-bg); border-radius: var(--radius);
  transition: transform .18s var(--ease), box-shadow .18s;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.sc-no { font-family: var(--font-disp); font-weight: 900; font-size: 40px; line-height: .9; color: var(--accent); grid-row: span 2; min-width: 1.3em; }
.sc-main { min-width: 0; }
.sc-title { margin: 0; font-size: 20px; font-weight: 900; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; }
.sc-artist { margin: 2px 0 8px; font-size: 13.5px; color: var(--card-dim); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.sc-badges span { display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 8px; background: rgba(0, 0, 0, .07); font-size: 13px; border-radius: var(--radius); }
.sc-badges small { font-family: var(--font-disp); font-weight: 800; font-size: 10px; letter-spacing: .1em; opacity: .6; }
.sc-badges b { font-family: var(--font-disp); font-weight: 900; }
.sc-map { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 9px; }
.sc-map i { font-style: normal; font-family: var(--font-disp); font-weight: 800; font-size: 10.5px; padding: 1px 5px; background: var(--tc); color: var(--tci); border-radius: 2px; }
.sc-map .t-verse { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3); }
.sc-actions { grid-column: 1 / -1; display: flex; gap: 2px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(0, 0, 0, .15); }
.sc-open {
  position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-disp); font-weight: 900; font-size: 13px; letter-spacing: .08em; padding: 6px 10px;
  background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); transition: transform .15s var(--ease);
}
.sc-open .ic { width: 15px; height: 15px; }
.song-card:hover .sc-open, .song-card:focus-visible .sc-open { transform: translateX(4px); }

.song-card::before { transform: skewX(-5deg); box-shadow: 7px 7px 0 var(--ink), 7px 7px 0 2px rgba(255, 255, 255, .18); }
.song-card:hover::before, .song-card:focus-visible::before { transform: skewX(-5deg) translate(-3px, -3px); box-shadow: 10px 10px 0 var(--accent); }
.sc-no { color: var(--ink); -webkit-text-stroke: 0; text-shadow: 3px 3px 0 var(--accent); transform: skewX(-10deg); }
.sc-open { transform: skewX(-12deg); }
.song-card:hover .sc-open { transform: skewX(-12deg) translateX(4px); }
/* 셋리스트 */
.setlist-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px; }
.setlist-card { background: var(--card-bg); color: var(--card-fg); border-radius: var(--radius); overflow: hidden; }
.sl-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 18px; }
.sl-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sl-name b { font-size: 19px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-name small { color: var(--card-dim); font-weight: 700; }
.sl-actions { display: flex; align-items: center; gap: 4px; }
.sl-actions .pbtn { min-height: 38px; padding: 6px 14px; }
.sl-songs { list-style: none; margin: 0; padding: 0 0 8px; }
.sl-songs li { display: flex; align-items: center; gap: 12px; padding: 9px 18px; cursor: pointer; border-top: 1px solid rgba(0, 0, 0, .08); }
.sl-songs li:hover { background: rgba(0, 0, 0, .05); }
.sl-songs li.empty { cursor: default; color: var(--card-dim); }
.sl-no { font-family: var(--font-disp); font-weight: 900; font-size: 18px; color: var(--accent); min-width: 1.6em; }
.sl-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sl-t b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-t small { color: var(--card-dim); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-k { font-family: var(--font-disp); font-weight: 800; font-size: 13px; color: var(--card-dim); white-space: nowrap; }
.setlist-card { box-shadow: 8px 8px 0 var(--accent); }
.sl-head { background: var(--ink); color: var(--paper); }
.sl-name small { color: var(--paper-dim); }
.sl-no { color: var(--ink); text-shadow: 2px 2px 0 var(--accent); }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--fg-2); }
.empty-state b { display: block; font-family: var(--font-disp); font-weight: 900; font-size: 44px; letter-spacing: .08em; color: var(--accent); }
.empty-state .btn-row { justify-content: center; }
.empty-state.small b { font-size: 26px; }
.empty-state b { transform: skewX(-10deg); text-shadow: 4px 4px 0 var(--ink); }

/* =========================================================
   뷰어
   ========================================================= */
#view-viewer { position: fixed; inset: 0; display: flex; flex-direction: column; color: var(--ly); overflow: hidden; }

.v-top {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; min-height: 62px;
  padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top));
  background: var(--bar-bg); color: var(--bar-fg);
}
.v-top { box-shadow: 0 3px 0 var(--accent); }
.v-back {
  display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px 8px 6px; border: 0; min-height: 44px;
  background: var(--bar-2); color: var(--bar-fg); font-family: var(--font-disp); font-weight: 900; font-size: 13px;
  letter-spacing: .08em; border-radius: var(--radius); flex: 0 0 auto;
}
.v-back:hover { background: var(--accent); color: var(--accent-ink); }
.v-back { transform: skewX(-12deg); }

.v-title { min-width: 140px; flex: 1 1 160px; display: flex; flex-direction: column; line-height: 1.15; }
.v-song-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.v-song { font-family: var(--font-disp); font-weight: 900; font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.v-edit {
  flex: 0 0 auto; display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0;
  border-radius: var(--radius); background: var(--bar-2); color: var(--bar-fg); opacity: .85; transform: skewX(-10deg);
}
.v-edit .ic { width: 17px; height: 17px; }
.v-edit:hover { opacity: 1; background: var(--accent); color: var(--accent-ink); }
.v-sub { display: flex; gap: 10px; font-size: 12.5px; color: var(--bar-dim); font-weight: 700; white-space: nowrap; overflow: hidden; }
.v-setpos { color: var(--accent); }
.v-song { transform: skewX(-8deg); transform-origin: left; }
.v-badges { display: flex; gap: 6px; flex: 0 0 auto; }
.vbadge {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 10px; border: 0; min-height: 44px;
  background: var(--bar-2); color: var(--bar-fg); border-radius: var(--radius); align-items: center;
}
.vbadge small { font-family: var(--font-disp); font-weight: 800; font-size: 10px; letter-spacing: .12em; color: var(--bar-dim); }
.vbadge b { font-family: var(--font-disp); font-weight: 900; font-size: 20px; }
.vbadge em { font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--accent); }
.vbadge:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.vbadge.zero { display: none; }
.vbadge.concert { box-shadow: inset 0 0 0 2px var(--accent-2); }
.vbadge { background: var(--paper); color: var(--ink); transform: skewX(-12deg); }
.vbadge small { color: var(--paper-dim); }
.vbadge em { color: var(--accent); }
.vbadge:first-child { background: var(--accent); color: var(--accent-ink); }
.vbadge:first-child small, .vbadge:first-child em { color: var(--accent-ink); opacity: .85; }
.beat-led { width: 10px; height: 10px; border-radius: 50%; background: currentColor; opacity: .2; align-self: center; margin-right: 2px; }
.beat-led.on { animation: led .22s ease-out; }
.beat-led.on.acc { animation: ledAcc .26s ease-out; }
@keyframes led { from { opacity: 1; transform: scale(1.4); } to { opacity: .2; transform: none; } }
@keyframes ledAcc { from { opacity: 1; transform: scale(1.8); background: var(--accent); box-shadow: 0 0 14px var(--accent); } to { opacity: .2; transform: none; } }

.v-tools { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 0 1 auto; min-width: 0; }
.v-tools::-webkit-scrollbar { display: none; }
.vt {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 52px; min-height: 48px; padding: 4px 5px; border: 0; background: transparent; color: var(--bar-fg);
  border-radius: var(--radius); font-size: 10.5px; font-weight: 800; white-space: nowrap; flex: 0 0 auto; opacity: .78;
}
.vt .ic { width: 21px; height: 21px; }
.vt:hover { opacity: 1; background: var(--bar-2); }
.vt.on { opacity: 1; color: var(--accent); }
.vt.on::after { content: ''; width: 18px; height: 3px; background: var(--accent); border-radius: 2px; }
.vt-sm { min-width: 40px; }
.vt .aa { font-family: var(--font-disp); font-weight: 900; font-size: 15px; line-height: 21px; }
.vt .aa.big { font-size: 21px; }
.vt small { font-size: 12px; line-height: 1; }
.vt-sep { width: 1px; height: 30px; background: var(--line); margin: 0 4px; flex: 0 0 auto; }
.count-in { position: fixed; inset: 0; z-index: 180; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(0, 0, 0, .72); color: #fff; }
.count-in b { font-family: var(--font-disp); font-weight: 900; font-size: clamp(96px, 22vw, 180px); line-height: .85; color: var(--accent); text-shadow: 8px 8px 0 #000; }
.count-in span { font-weight: 800; letter-spacing: .16em; }
.yt-dock { position: fixed; right: 16px; bottom: 16px; z-index: 90; width: min(560px, calc(100% - 32px)); background: var(--panel-bg); color: var(--panel-fg); box-shadow: 0 0 0 3px var(--paper), 8px 8px 0 var(--accent); }
.yt-dock-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; }
.yt-dock-bar b { font-family: var(--font-disp); letter-spacing: .06em; white-space: nowrap; }
.yt-btns { display: flex; gap: 8px; }
.yt-btns .sbtn { min-height: 36px; padding: 6px 12px; font-size: 13.5px; }
/* 소리만: 영상은 작은 썸네일로 줄이고 iframe은 그대로 두어야 재생이 끊기지 않는다 */
.yt-dock.mini { display: flex; align-items: center; width: auto; max-width: calc(100% - 32px); }
.yt-dock.mini .yt-frame { order: -1; flex: none; width: 64px; margin-left: 8px; pointer-events: none; }
.yt-dock.mini .yt-dock-bar { flex: 1 1 auto; min-width: 0; }
.yt-frame { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.yt-frame iframe, .yt-frame #yt-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-fallback { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px 16px 16px; }
.yt-fallback p { margin: 0; font-weight: 700; line-height: 1.45; }
.yt-fallback a { text-decoration: none; }
.vt.on { color: var(--accent-ink); background: var(--accent); transform: skewX(-10deg); }
.vt.on::after { background: var(--accent-ink); }
.v-menu-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border: 0;
  background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); font-weight: 900; font-size: 14px;
}
.v-menu-btn .ic { width: 20px; height: 20px; }
.v-menu-btn { transform: skewX(-10deg); box-shadow: 3px 3px 0 var(--paper); }
/* 우상단 메뉴 */
.modal-layer.kind-menu { align-items: flex-start; justify-content: flex-end; padding: 64px 10px 10px; background: rgba(0, 0, 0, .35); }
.kind-menu .modal { width: min(330px, 100%); max-height: calc(100vh - 80px); transform: translateY(-10px); }
.kind-menu .modal-head { padding: 8px 8px 8px 16px; }
.kind-menu .modal-head h2 { font-size: 18px; }
.kind-menu .modal-head { padding-bottom: 14px; }
.kind-menu .modal-body { padding: 8px 8px 12px; }
.vmenu { display: flex; flex-direction: column; gap: 2px; }
.vm-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: transparent;
  color: var(--panel-fg); text-align: left; font-weight: 800; font-size: 15px; border-radius: var(--radius);
}
.vm-item:hover { background: var(--bg-3); }
.vm-item .ic { width: 20px; height: 20px; opacity: .85; }
.vm-item span { flex: 1; }
.vm-item em { font-style: normal; font-family: var(--font-disp); font-size: 10.5px; font-weight: 900; letter-spacing: .1em; padding: 2px 6px; background: var(--accent); color: var(--accent-ink); border-radius: 3px; }
.vm-item kbd { margin-left: 4px; }
.vm-item.vm-primary { background: var(--accent); color: var(--accent-ink); }
.vm-item.vm-primary em { background: var(--accent-ink); color: var(--accent); }
.vm-item.vm-primary kbd { background: rgba(0, 0, 0, .25); color: inherit; }
.vm-sep { display: block; height: 1px; margin: 5px 6px; background: var(--line); }
.vm-font { display: flex; align-items: center; gap: 8px; padding: 4px 12px; font-weight: 800; font-size: 15px; }
.vm-font span { flex: 1; }
.vm-font b { min-width: 52px; text-align: center; font-family: var(--font-disp); }
.vm-font .rbtn { width: 38px; height: 38px; }

/* 무대 */
.v-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.v-page-wrap { position: absolute; inset: clamp(14px, 2.6vh, 34px) clamp(16px, 4.2vw, 72px) clamp(8px, 1.4vh, 18px); }
.v-measure { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; contain: layout paint; }
.v-page { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: var(--gap, 0); align-content: start; }
.v-page.cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.v-page.cols-2 .v-col + .v-col { position: relative; }
/* 기울이면 긴 페이지에서 선이 옆 칸 가사로 넘어가므로 세로로 곧게 둔다 */
.v-page.cols-2 .v-col + .v-col::before {
  content: ''; position: absolute; left: calc(var(--gap) / -2 - 1px); top: 4px; bottom: 4px; width: 2px;
  background: linear-gradient(var(--accent) 0 28px, var(--line) 28px, transparent);
}
.v-col { min-width: 0; }

.v-page.in-next { animation: pgNext .3s var(--ease) both; }
.v-page.in-prev { animation: pgPrev .3s var(--ease) both; }
@keyframes pgNext { from { opacity: 0; transform: translateX(6%); } to { opacity: 1; transform: none; } }
@keyframes pgPrev { from { opacity: 0; transform: translateX(-6%); } to { opacity: 1; transform: none; } }
.v-page.in-next { animation-name: pgNextP; }
.v-page.in-prev { animation-name: pgPrevP; }
@keyframes pgNextP { from { opacity: 0; transform: translateX(7%) skewX(-6deg); } to { opacity: 1; transform: none; } }
@keyframes pgPrevP { from { opacity: 0; transform: translateX(-7%) skewX(6deg); } to { opacity: 1; transform: none; } }
.v-page.bump { animation: bump .32s ease-out; }
@keyframes bump { 0%, 100% { transform: none; } 25% { transform: translateX(-12px); } 60% { transform: translateX(8px); } }

.v-stage.slash::after {
  content: ''; position: absolute; top: -30%; bottom: -30%; left: 0; width: 34%; pointer-events: none; z-index: 2;
  background: var(--accent); opacity: .9; animation: slash .34s cubic-bezier(.4, 0, .2, 1) forwards;
}
@keyframes slash { from { transform: translateX(-120%) skewX(-24deg); } to { transform: translateX(420%) skewX(-24deg); } }
@keyframes scan { from { transform: translateY(-110%); } to { transform: translateY(400%); } }

/* ---------- 가사 · 코드 (뷰어 · 측정 · 미리보기 공통) ---------- */
.lyrics { font-family: var(--font-lyric); font-size: var(--fs); line-height: 1.22; font-weight: var(--lyric-weight, 700); color: var(--ly); letter-spacing: -.005em; }
[data-lyric-font="a2z"] .lyrics { --font-lyric: var(--font-disp); }
[data-lyric-font="suite"] .lyrics { --font-lyric: 'SUITE', var(--font-ui); }
[data-lyric-font="busan"] .lyrics { --font-lyric: 'BusanDandiMyeongjo', 'SourceHanSerifKR', serif; }
[data-lyric-font="serif"] .lyrics { --font-lyric: 'SourceHanSerifKR', 'Noto Serif KR', serif; }
[data-lyric-font="goyang"] .lyrics { --font-lyric: 'GeuriunXGukhanbakSingoyangI', var(--font-ui); --lyric-weight: 400; font-synthesis: none; }
/* 줄 사이 간격은 padding(--lh로 조절), 한 줄이 넘어간 부분은 line-height로 붙여 둔다 */
.ln { font-size: var(--fs); padding: calc(var(--fs) * ((var(--lh) - 1) * .55 + .04)) 0; word-break: keep-all; overflow-wrap: anywhere; }
.ln.gap { height: calc(var(--fs) * .45); padding: 0; }
.ln.ly.has-ch { line-height: 1.12; padding-top: calc(var(--fs) * ((var(--lh) - 1) * .55 + .06)); padding-bottom: calc(var(--fs) * ((var(--lh) - 1) * .55 + .02)); }
.w { display: inline-block; white-space: nowrap; vertical-align: bottom; }
.sg { display: inline-flex; flex-direction: column; vertical-align: bottom; }
.sg .tx { white-space: pre; }
.chd {
  align-self: flex-start; display: inline-flex; align-items: baseline;
  font-family: var(--font-disp); font-weight: 800; font-style: normal; white-space: nowrap;
  font-size: calc(var(--fs) * var(--chs)); line-height: 1.18; padding: .04em .26em .02em; margin: 0 .32em calc(var(--fs) * .08) 0;
  background: var(--ch-bg); color: var(--ch-fg); border-radius: calc(var(--radius) * .6); cursor: pointer;
}
.chd.nil { visibility: hidden; padding-left: 0; padding-right: 0; margin-right: 0; background: none; }
.chd .cq { font-size: .78em; font-weight: 700; margin-left: .03em; }
.chd .cb { font-size: .74em; font-weight: 700; opacity: .85; }
.chd { transform: skewX(-10deg); box-shadow: .12em .12em 0 var(--ink); }
.ln.cl { display: flex; flex-wrap: wrap; align-items: center; gap: .3em .5em; line-height: 1.2; padding-top: calc(var(--fs) * .14); padding-bottom: calc(var(--fs) * .14); }
.ln.cl .chd { margin: 0; font-size: calc(var(--fs) * var(--chs) * 1.15); }
.ln.cl .bar { font-family: var(--font-disp); font-weight: 700; font-size: calc(var(--fs) * var(--chs)); color: var(--fg-dim); }

.memo {
  display: inline-block; vertical-align: middle; margin-left: .55em; max-width: 100%;
  font-family: var(--font-ui); font-weight: 800; font-size: max(13px, calc(var(--fs) * .4)); line-height: 1.25; white-space: normal;
  padding: .22em .6em; background: var(--memo-bg); color: var(--memo-fg); border-left: .32em solid var(--memo-edge);
  border-radius: calc(var(--radius) * .6); transform: rotate(-1.5deg); letter-spacing: 0;
}
.ln.ly.has-ch .memo { vertical-align: bottom; margin-bottom: .15em; }
.ln.mm { padding: calc(var(--fs) * .1) 0; }
.ln.mm .memo { margin-left: 0; }
.ln.ly:not(.has-ch) .tx { white-space: pre-wrap; }

/* 메모 행: 가사 줄 사이에 원하는 위치로 놓는 메모 */
.ln.mrow { position: relative; height: max(30px, calc(var(--fs) * .8)); padding: 0; }
.ln.mrow .pm {
  position: absolute; top: 50%; margin: -.85em 0 0; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  left: min(calc(var(--x) * var(--fs) + var(--pl, 0px)), calc(100% - 3em));
}
.memo-mode .ln.mrow { outline: 1px dashed var(--line); outline-offset: -1px; cursor: copy; }
.memo-mode .ln.mrow .pm { cursor: grab; touch-action: none; }
.memo-mode .ln.mrow .pm.dragging { cursor: grabbing; opacity: .85; z-index: 2; }

.ins-bar { position: relative; height: max(20px, calc(var(--fs) * .46)); cursor: copy; }
.ins-bar::before { content: ''; position: absolute; left: 1.6em; right: 0; top: 50%; border-top: 2px dashed var(--line); transition: border-color .12s; }
.ins-bar i {
  position: absolute; left: 0; top: 50%; width: 18px; height: 18px; margin-top: -9px; display: grid; place-items: center;
  font: 900 14px/1 var(--font-disp); font-style: normal; color: var(--fg-dim); border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line);
}
.ins-bar:hover::before { border-color: var(--accent); }
.ins-bar:hover i { color: var(--accent-ink); background: var(--accent); box-shadow: none; }
.ins-bar::after, .ln.mrow::after {
  content: '+ 메모'; position: absolute; left: var(--hx, 0); top: 50%; transform: translateY(-50%); pointer-events: none; opacity: 0;
  font: 800 12px/1 var(--font-ui); padding: 4px 7px; background: var(--accent); color: var(--accent-ink); border-radius: 3px; white-space: nowrap;
}
.ins-bar.hov::after, .ln.mrow.hov::after { opacity: 1; }
.memo { box-shadow: .18em .18em 0 var(--accent); border-left: 0; transform: rotate(-2deg) skewX(-6deg); }
.ln.cm { padding: calc(var(--fs) * .14) 0; }
.cm-box {
  display: inline-block; font-family: var(--font-ui); font-weight: 800; font-size: max(14px, calc(var(--fs) * .46)); line-height: 1.3;
  padding: .25em .75em .25em .55em; background: var(--cm-bg); color: var(--cm-fg); box-shadow: inset 0 0 0 2px var(--cm-bd); border-radius: var(--radius);
}
.cm-box::before { content: '!'; display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; margin-right: .45em; background: var(--cm-bd); color: var(--bg); font-family: var(--font-disp); font-weight: 900; border-radius: 50%; font-size: .85em; vertical-align: .08em; }
.cm-box { transform: skewX(-8deg); }
.cm-box::before { color: var(--accent-ink); border-radius: 0; }
.sec-h {
  display: flex; align-items: center; flex-wrap: wrap; gap: .4em; padding-top: calc(var(--fs) * .55); padding-bottom: calc(var(--fs) * .16);
  font-family: var(--font-disp); font-size: max(13px, calc(var(--fs) * .46)); line-height: 1.15;
}
.sec-short { display: inline-block; min-width: 2.3em; text-align: center; padding: .16em .45em; font-weight: 900; background: var(--tc); color: var(--tci); border-radius: calc(var(--radius) * .6); }
.sec-name { display: inline-block; padding: .16em .1em; font-weight: 800; letter-spacing: var(--track); text-transform: uppercase; color: var(--sec-fg); }
.sec-name em { font-style: normal; opacity: .55; letter-spacing: 0; text-transform: none; }
.sec-h .memo { font-size: max(12px, calc(var(--fs) * .36)); }
.sec-short, .sec-name { transform: skewX(-12deg); }
.sec-name { background: var(--sec-bg); padding: .16em .6em; }
.t-chorus .sec-name { box-shadow: .2em .2em 0 var(--accent); }
.sec-h.cont { opacity: .7; padding-top: 0; }

/* ---------- 섹션 구분: 왼쪽 색 띠 + 종류별 배경 (본문 위치는 그대로) ---------- */
.lyrics { --sp: calc(var(--fs) * .42); }
.lyrics .s-sec {
  --bw: 3px; --pl: var(--sp);
  border-left: var(--bw) solid var(--tc);
  margin-left: calc(-1 * (var(--sp) + var(--bw)));
  padding-left: var(--sp);
}
.lyrics .s-sec.t-verse { --bw: 3px; border-left-color: color-mix(in srgb, var(--tc) 70%, transparent); }
.lyrics .s-sec.t-prechorus { --bw: 5px; background-color: color-mix(in srgb, var(--tc) 8%, transparent); }
.lyrics .s-sec.t-chorus { --bw: 8px; background-color: color-mix(in srgb, var(--tc) 15%, transparent); }
.lyrics .s-sec.t-bridge { --bw: 6px; background-color: color-mix(in srgb, var(--tc) 11%, transparent); }
.lyrics .s-sec.t-solo {
  --bw: 6px;
  background-image: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--tc) 14%, transparent) 0 10px, transparent 10px 20px);
  background-attachment: fixed;
}
.lyrics .s-sec.t-intro, .lyrics .s-sec.t-outro { --bw: 4px; border-left-style: double; }
.lyrics .s-sec.t-intro.ln, .lyrics .s-sec.t-outro.ln { color: color-mix(in srgb, var(--ly) 80%, transparent); }
.lyrics .s-sec.t-other { --bw: 3px; border-left-color: color-mix(in srgb, var(--tc) 60%, transparent); }

/* 섹션 머리: 오른쪽으로 이어지는 선 + 후렴은 더 크게 */
.sec-h.s-sec::after {
  content: ''; flex: 1 1 auto; min-width: 1.5em; height: .14em; margin-left: .3em; align-self: center;
  background: linear-gradient(90deg, var(--tc), transparent); opacity: .7; border-radius: 1px;
}
.sec-h.t-chorus { font-size: max(15px, calc(var(--fs) * .54)); }
.sec-h.t-chorus .sec-short { box-shadow: 0 0 0 .12em color-mix(in srgb, var(--tc) 35%, transparent); }
.sec-h.t-solo .sec-name::before { content: '♪ '; }
.sec-h.t-bridge .sec-name, .sec-h.t-chorus .sec-name { font-weight: 900; }
/* 메모 쓰기 모드 */
.mode-banner { display: none; position: absolute; left: 50%; top: 8px; transform: translateX(-50%); z-index: 4;
  align-items: center; gap: 12px; padding: 7px 8px 7px 16px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px; border-radius: var(--radius); box-shadow: var(--shadow); width: max-content; max-width: calc(100% - 20px); line-height: 1.3; }
.mode-banner button { flex: 0 0 auto; border: 0; background: var(--accent-ink); color: var(--accent); font-weight: 900; padding: 5px 12px; border-radius: var(--radius); }
.mode-banner span { display: none; }
.memo-mode .mode-banner, .chord-mode .mode-banner { display: flex; }
.memo-mode .mb-memo, .chord-mode .mb-chord { display: inline; }
.memo-mode .v-page-wrap, .chord-mode .v-page-wrap { top: 70px; }

/* 코드 쓰기 모드 */
.ln.ly.has-ch { white-space: pre-wrap; }

/* 긴 줄: 넘어간 부분은 들여쓰기 (첫 줄 위치는 그대로) */
.lyrics .ln.ly { padding-left: 1em; text-indent: -1em; }
.lyrics .ln.ly * { text-indent: 0; }
.lyrics .s-sec.ln.ly { padding-left: calc(var(--sp) + 1em); }
/* "한 줄 맞춤" 측정용: 줄바꿈 없이 실제 길이를 잰다 */
.v-measure.nowrap .ln.ly, .v-measure.nowrap .ln.ly .tx { white-space: pre !important; }
.v-measure.nowrap .ln.ly .memo { white-space: nowrap !important; }
.cg { display: inline-block; min-width: .5em; height: 1.9em; vertical-align: bottom; position: relative; cursor: pointer; white-space: pre; }
.cg.end { width: 1.4em; }
.cg::after {
  content: ''; position: absolute; left: 50%; top: 4%; bottom: 4%; width: 2px; margin-left: -1px;
  background: repeating-linear-gradient(var(--fg-dim) 0 3px, transparent 3px 6px); opacity: .45; border-radius: 1px;
}
.cg.end::after { left: 30%; }
.cg:hover::after { background: var(--accent); opacity: 1; width: 4px; margin-left: -2px; }
.cg:hover::before {
  content: '+'; position: absolute; left: 50%; top: 0; transform: translateX(-50%); font: 900 calc(var(--fs) * var(--chs)) / 1 var(--font-disp);
  color: var(--accent-ink); background: var(--accent); padding: .05em .25em; border-radius: 3px;
}
.chord-mode .v-page .cw { cursor: pointer; border-radius: 4px; transition: background .1s; }
.chord-mode .v-page .cw:hover { background: var(--line); }
.chord-mode .v-page .chd[data-cs] { cursor: pointer; outline: 2px dashed transparent; outline-offset: 1px; }
.chord-mode .v-page .chd[data-cs]:hover { outline-color: var(--accent); }
.chord-ed { display: flex; flex-direction: column; gap: 12px; }
.ce-target { display: flex; flex-direction: column; gap: 2px; }
.ce-target b { font-size: 19px; font-weight: 900; }
.ce-target small { color: var(--fg-dim); font-size: 12.5px; font-weight: 600; }
.ce-input { font-family: var(--font-disp) !important; font-weight: 800; font-size: 22px !important; }
.ce-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ce-row .tb-label { min-width: 52px; }
.ce-row .chip { min-width: 40px; font-family: var(--font-disp); }
.memo-mode .v-page [data-src]:not([data-src="-1"]) { cursor: pointer; border-radius: 4px; transition: background .12s; }
.memo-mode .v-page [data-src]:not([data-src="-1"]):hover { background: var(--line); }

/* 하단 바 */
.v-bottom {
  position: relative; z-index: 3; display: flex; align-items: stretch; gap: 10px; min-height: 74px;
  padding: 7px 10px; padding-bottom: max(7px, env(safe-area-inset-bottom)); background: var(--bar-bg); color: var(--bar-fg);
}
.v-bottom { box-shadow: 0 -3px 0 var(--accent); }
.nav-btn {
  flex: 0 0 auto; min-width: clamp(84px, 12vw, 150px); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: var(--radius); font-family: var(--font-disp); font-weight: 900; font-size: 19px; letter-spacing: .06em;
  background: var(--bar-2); color: var(--bar-fg); transition: transform .1s, background .15s;
}
.nav-btn .ic { width: 26px; height: 26px; }
.nav-btn.next { background: var(--accent); color: var(--accent-ink); }
.nav-btn:active { transform: scale(.96); }
.nav-btn { transform: skewX(-14deg); }
.nav-btn.prev { background: var(--paper); color: var(--ink); }
.nav-btn.next { box-shadow: 4px 4px 0 var(--paper); }
.nav-btn:active { transform: skewX(-14deg) scale(.96); }
.v-mid { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.secmap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.secmap::-webkit-scrollbar { display: none; }
.sm-chip {
  flex: 0 0 auto; border: 0; padding: 4px 9px; font-family: var(--font-disp); font-weight: 900; font-size: 13px; line-height: 1.1;
  background: var(--bar-2); color: var(--bar-dim); border-radius: calc(var(--radius) * .6);
}
.sm-chip:hover { color: var(--bar-fg); }
.sm-chip.on { background: var(--tc); color: var(--tci); }
.secmap .t-verse { --tc: var(--bar-fg); --tci: var(--bar-bg); }
.sm-chip { transform: skewX(-12deg); }
.next-peek { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; font-weight: 700; color: var(--bar-dim); white-space: nowrap; }
.pk-l { flex: 0 0 auto; font-family: var(--font-disp); font-weight: 900; font-size: 11px; letter-spacing: .14em; color: var(--accent); }
.pk-l.end { color: var(--bar-dim); }
.pk-s { flex: 0 0 auto; font-family: var(--font-disp); font-size: 12px; padding: 1px 6px; background: var(--bar-2); color: var(--bar-fg); border-radius: 3px; }
.pk-t { overflow: hidden; text-overflow: ellipsis; color: var(--bar-fg); opacity: .75; }
.v-counter { flex: 0 0 auto; display: flex; align-items: baseline; gap: 3px; padding: 0 8px; align-self: center; font-family: var(--font-disp); font-weight: 900; }
.v-counter .cur { font-size: 46px; line-height: 1; color: var(--bar-fg); }
.v-counter .sep { font-size: 22px; color: var(--accent); }
.v-counter .tot { font-size: 18px; color: var(--bar-dim); }
.v-counter { transform: skewX(-12deg); }
.v-counter .cur { text-shadow: 3px 3px 0 var(--accent); }
/* 집중 모드 */
.focus .v-top { display: none; }
.focus-exit { display: none; position: fixed; top: 10px; right: 10px; z-index: 5; width: 40px; height: 40px; place-items: center;
  background: var(--bar-bg); color: var(--bar-fg); border-radius: 50%; opacity: .35; cursor: pointer; }
.focus-exit:hover { opacity: 1; }
.focus .focus-exit { display: grid; }

.beat-flash { position: fixed; inset: 0; z-index: 6; pointer-events: none; box-shadow: inset 0 0 0 0 var(--accent); transition: box-shadow .1s ease-out; }
.beat-flash.on { box-shadow: inset 0 0 0 9px var(--accent); transition: none; }

/* 다음 곡 안내 */
.v-page.interstitial { display: grid; place-items: center; align-content: center; font-size: 16px; line-height: 1.3; }
.ist { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 90%; }
.ist-label span { display: inline-block; font-family: var(--font-disp); font-weight: 900; font-size: clamp(18px, 2.6vw, 30px); letter-spacing: .28em; padding: 6px 22px; background: var(--accent); color: var(--accent-ink); }
.ist-no { font-family: var(--font-disp); font-weight: 900; font-size: clamp(80px, 16vw, 200px); line-height: .9; color: var(--ly); }
.ist-no small { font-size: .22em; color: var(--fg-dim); margin-left: .2em; }
.ist-title { font-weight: 900; font-size: clamp(30px, 5vw, 64px); line-height: 1.15; word-break: keep-all; }
.ist-artist { font-size: clamp(16px, 2vw, 24px); color: var(--fg-dim); font-weight: 700; }
.ist-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.ist-badges span { font-family: var(--font-disp); font-weight: 700; font-size: 18px; padding: 6px 14px; background: var(--bg-3); color: var(--fg); border-radius: var(--radius); }
.ist-hint { margin-top: 14px; color: var(--fg-dim); font-weight: 700; font-size: 17px; }
.ist-label span { transform: skewX(-14deg) rotate(-3deg); box-shadow: 6px 6px 0 var(--paper); }
.ist-no { transform: skewX(-10deg); text-shadow: 8px 8px 0 var(--accent); }
.ist-title { background: var(--paper); color: var(--ink); padding: 4px 22px; transform: skewX(-8deg); }
/* =========================================================
   편집기
   ========================================================= */
#view-editor { min-height: 100vh; display: flex; flex-direction: column; }
.ed-head {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px clamp(12px, 2vw, 24px);
  background: var(--bar-bg); color: var(--bar-fg);
}
.ed-head { box-shadow: 0 3px 0 var(--accent); }
.ed-title { flex: 1; margin: 0; font-family: var(--font-disp); font-weight: 900; font-size: 24px; letter-spacing: var(--track); }
.ed-title small { font-family: var(--font-ui); font-size: 13px; letter-spacing: 0; color: var(--bar-dim); margin-left: 6px; }
.ed-title { transform: skewX(-10deg); }
.ed-head-actions { display: flex; gap: 10px; }
.ed-grid { flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; padding: 16px clamp(12px, 2vw, 24px) 40px; }
.ed-left { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ed-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ed-meta .fld.wide { grid-column: span 2; }
.ed-toolbar { display: flex; flex-direction: column; gap: 8px; }
.tb-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tb-group .tb-label { min-width: 44px; }
.ed-chordbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; background: var(--bg-2); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }
.ed-chordbar .tb-label b { color: var(--accent); font-size: 13px; }
.chordchip { border: 0; padding: 5px 10px; font-family: var(--font-disp); font-weight: 800; font-size: 14px; background: var(--ch-bg); color: var(--ch-fg); border-radius: calc(var(--radius) * .6); }
.chordchip:hover { transform: translateY(-2px); }
.chordchip { transform: skewX(-10deg); }
.chord-input { width: 120px !important; padding: 5px 10px !important; min-height: 32px; font-family: var(--font-disp); }
#ed-source { min-height: 56vh; font-family: var(--font-mono); font-size: 15.5px; line-height: 1.65; tab-size: 4; white-space: pre-wrap; }
.ed-help { background: var(--bg-2); border-radius: var(--radius); padding: 10px 14px; box-shadow: inset 0 0 0 1px var(--line); }
.ed-help summary { cursor: pointer; font-weight: 800; }
.ed-help-body p { margin: 8px 0; font-size: 14px; color: var(--fg-2); }
code { font-family: var(--font-mono); font-size: .92em; padding: 1px 6px; background: var(--bg-3); border-radius: 3px; color: var(--fg); }

.ed-right { position: sticky; top: 74px; align-self: start; display: flex; flex-direction: column; min-width: 0; max-height: calc(100vh - 92px); }
.ed-prev-head { display: flex; align-items: baseline; gap: 12px; padding: 8px 14px; background: var(--bar-bg); color: var(--bar-fg); border-radius: var(--radius) var(--radius) 0 0; }
.ed-prev-head b { font-family: var(--font-disp); font-weight: 900; letter-spacing: .14em; color: var(--accent); }
.ed-prev-head span { font-size: 13px; color: var(--bar-dim); font-weight: 700; }
.ed-preview { --fs: 22px; --lh: 1.3; --chs: .62; overflow: auto; padding: 6px 18px 24px; background: var(--bg-2); border-radius: 0 0 var(--radius) var(--radius); box-shadow: inset 0 0 0 1px var(--line); min-height: 300px; }
.pv-break { display: flex; align-items: center; gap: 10px; margin: 10px 0; color: var(--accent); font-family: var(--font-disp); font-size: 11px; font-weight: 900; letter-spacing: .2em; }
.pv-break::before, .pv-break::after { content: ''; flex: 1; border-top: 2px dashed currentColor; }

/* =========================================================
   모달 · 패널
   ========================================================= */
.modal-layer {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .18s;
}
.modal-layer.on { opacity: 1; }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: var(--panel-bg); color: var(--panel-fg); border-radius: var(--radius); overflow: hidden;
  transform: translateY(14px) scale(.98); transition: transform .22s var(--ease);
  --fg: var(--panel-fg);
}
.modal-layer.on .modal { transform: none; }
.modal-sm { width: min(420px, 100%); }
.modal-wide { width: min(900px, 100%); }
.kind-side { justify-content: flex-end; align-items: stretch; padding: 0; }
.kind-side .modal { width: min(470px, 100vw); max-height: none; height: 100%; border-radius: 0; transform: translateX(40px); }
.kind-sheet { align-items: flex-end; padding: 0; }
.kind-sheet .modal { width: min(780px, 100vw); max-height: 82vh; border-radius: var(--radius) var(--radius) 0 0; transform: translateY(40px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 12px 20px; background: var(--panel-head); color: var(--panel-head-fg); }
.modal-head h2 { margin: 0; display: flex; align-items: baseline; gap: 10px; min-width: 0; font-family: var(--font-disp); font-weight: 900; font-size: 22px; letter-spacing: var(--track); }
.modal-head h2 small { font-family: var(--font-ui); font-weight: 700; font-size: 13px; letter-spacing: 0; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-x { border: 0; background: transparent; color: inherit; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; flex: 0 0 auto; }
.modal-x:hover { background: rgba(0, 0, 0, .18); }
.modal-body { overflow: auto; padding: 18px 20px 24px; flex: 1 1 auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); }
.confirm-msg { margin: 4px 0; font-size: 16px; font-weight: 600; }
.modal { box-shadow: 0 0 0 3px var(--paper), 12px 12px 0 3px var(--accent); }
.kind-side .modal { box-shadow: -6px 0 0 var(--accent); }
.modal-head h2 .mh-title { display: inline-block; transform: skewX(-12deg); }
.modal-head { clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%); padding-bottom: 20px; }
.toast-root, #toast-root { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 10px 18px; background: var(--fg); color: var(--bg); font-weight: 800; font-size: 14.5px; border-radius: var(--radius); opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s var(--ease); max-width: 90vw; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.toast.on { opacity: 1; transform: none; }
.toast { background: var(--paper); color: var(--ink); transform: skewX(-10deg) translateY(10px); box-shadow: 5px 5px 0 var(--accent); }
.toast.on { transform: skewX(-10deg); }
/* 설정 */
.set-sec { margin-bottom: 26px; }
.set-sec h3 { margin: 0 0 10px; font-family: var(--font-disp); font-weight: 900; font-size: 15px; letter-spacing: .1em; color: var(--accent); }
.set-row { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.set-label { font-weight: 800; font-size: 14px; display: flex; justify-content: space-between; }
.set-label output { font-family: var(--font-disp); color: var(--accent); }
.set-hint { color: var(--fg-dim); font-size: 12px; font-weight: 600; }
.set-note { color: var(--fg-dim); font-size: 13.5px; margin: 0 0 6px; }
.set-note.warn { color: var(--fg); padding: 8px 10px; background: var(--bg-3); border-left: 4px solid var(--accent); border-radius: var(--radius); }
.folder-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fr-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fr-info b { font-size: 14.5px; }
.fr-info small { color: var(--fg-dim); font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.folder-row.is-set .fr-info small { color: var(--accent); font-weight: 800; }
.folder-row.need-grant .fr-info small { color: var(--fg); }
.fr-btns { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.fr-btns .sbtn { min-height: 36px; padding: 6px 12px; font-size: 13.5px; }
.fr-grant, .fr-clear { display: none !important; }
.folder-row.need-grant .fr-grant { display: inline-flex !important; }
.folder-row.is-set .fr-clear { display: inline-grid !important; }
.notice { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; padding: 10px 12px 10px 16px; background: var(--bg-2); color: var(--fg); border-left: 5px solid var(--accent); border-radius: var(--radius); font-weight: 700; font-size: 14px; }
.notice span { flex: 1; }
.notice .pbtn { min-height: 36px; padding: 6px 14px; }
.theme-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; border: 0; background: var(--bg-3); border-radius: var(--radius); text-align: left; box-shadow: inset 0 0 0 2px var(--line); }
.theme-card b { font-family: var(--font-disp); font-weight: 900; font-size: 12.5px; letter-spacing: .04em; }
.theme-card small { font-size: 11.5px; color: var(--fg-dim); }
.theme-card.on { box-shadow: inset 0 0 0 3px var(--accent); }
.tc-sw { width: 100%; height: 44px; margin-bottom: 6px; border-radius: calc(var(--radius) * .6); }
.tc-phantom .tc-sw { background: linear-gradient(115deg, #0b0b0b 0 46%, #ff1f33 46% 74%, #fff 74%); }
.tc-sun .tc-sw { background: linear-gradient(115deg, #fff3b0 0 46%, #1568ff 46% 74%, #111 74%); }
.tc-sky .tc-sw { background: linear-gradient(115deg, #d9eeff 0 46%, #ffd000 46% 74%, #102033 74%); }

/* 도움말 */
.help h3 { font-family: var(--font-disp); font-weight: 900; font-size: 15px; letter-spacing: .08em; color: var(--accent); margin: 22px 0 8px; }
.help h3:first-child { margin-top: 0; }
.help p { margin: 6px 0; color: var(--fg-2); font-size: 14.5px; }
.keys { width: 100%; border-collapse: collapse; font-size: 14px; }
.keys td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.keys td:first-child { width: 52%; }
.syntax { font-family: var(--font-mono); font-size: 13px; line-height: 1.7; background: var(--bg-3); padding: 12px 14px; border-radius: var(--radius); overflow-x: auto; color: var(--fg); }

/* 메트로놈 */
.metro { display: flex; flex-direction: column; gap: 12px; }
.metro-beats { display: flex; justify-content: center; gap: 12px; padding: 6px 0; }
.metro-beats i { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-3); box-shadow: inset 0 0 0 2px var(--line); transition: background .05s, transform .05s; }
.metro-beats i.acc { box-shadow: inset 0 0 0 3px var(--accent); }
.metro-beats i.on { background: var(--fg); transform: scale(1.18); }
.metro-beats i.acc.on { background: var(--accent); box-shadow: 0 0 18px var(--accent); }
.metro-bpm { display: flex; align-items: center; justify-content: center; gap: 8px; }
.bpm-big { min-width: 170px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.bpm-big b { font-family: var(--font-disp); font-weight: 900; font-size: 76px; line-height: 1; }
.bpm-big small { font-weight: 800; color: var(--fg-dim); letter-spacing: .08em; }
.bpm-big b { transform: skewX(-10deg); text-shadow: 5px 5px 0 var(--accent); }
.metro-main { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.metro-main .sbtn { flex-direction: column; gap: 0; font-family: var(--font-disp); font-weight: 900; }
.metro-main .sbtn small { font-family: var(--font-ui); font-size: 11px; font-weight: 700; opacity: .7; }

/* 튜너 */
.tuner { display: flex; flex-direction: column; gap: 12px; --tn: var(--fg-dim); }
.tuner.active { --tn: var(--accent); }
.tuner.in-tune { --tn: var(--ok); }
.tn-display { text-align: center; padding: 8px 0; }
.tn-note { font-family: var(--font-disp); font-weight: 900; font-size: 104px; line-height: 1; color: var(--tn); transition: color .15s; }
.tn-info { display: flex; justify-content: center; gap: 12px; color: var(--fg-dim); font-weight: 700; font-size: 14px; min-height: 22px; }
.tn-meter { position: relative; height: 54px; margin: 14px 18px 4px; }
.tn-ticks { position: absolute; inset: 10px 0; display: flex; justify-content: space-between; align-items: center; }
.tn-ticks i { width: 2px; height: 14px; background: var(--line); }
.tn-ticks i.major { height: 24px; background: var(--fg-dim); }
.tn-ticks i.zero { height: 34px; width: 4px; background: var(--ok); }
.tn-needle { position: absolute; top: 0; bottom: 0; left: 50%; width: 6px; margin-left: -3px; background: var(--tn); border-radius: 3px; transition: left .12s ease-out, background .15s; box-shadow: 0 0 12px var(--tn); }
.tn-flat, .tn-sharp { position: absolute; top: 50%; transform: translateY(-50%); font-size: 20px; font-weight: 900; color: var(--fg-dim); }
.tn-flat { left: -22px; } .tn-sharp { right: -22px; }
.tn-cents { font-weight: 800; color: var(--tn); min-height: 24px; }
.tn-strings { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.tn-strings button { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 8px 6px; border: 0; background: var(--bg-3); border-radius: var(--radius); box-shadow: inset 0 0 0 2px var(--line); }
.tn-strings button b { font-family: var(--font-disp); font-weight: 900; font-size: 22px; line-height: 1.1; }
.tn-strings button small { font-size: 11px; color: var(--fg-dim); font-weight: 700; }
.tn-strings button.near { box-shadow: inset 0 0 0 3px var(--tn); }
.tn-hint { text-align: center; margin: 0; color: var(--fg-dim); font-size: 12.5px; }
.tn-opts { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; }

/* 보컬 노트 */
.ntabs { display: flex; gap: 4px; margin-bottom: 14px; background: var(--bg-3); padding: 4px; border-radius: var(--radius); }
.ntabs button { flex: 1; border: 0; background: transparent; padding: 9px 6px; font-weight: 800; font-size: 14px; border-radius: var(--radius); color: var(--fg-2); }
.ntabs button.on { background: var(--accent); color: var(--accent-ink); }
.notes-text { min-height: 46vh; margin-top: 10px; font-size: 15px; }
.log-form { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.log-form textarea { min-height: 90px; }
.log-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.stars { display: flex; gap: 2px; }
.stars button { border: 0; background: transparent; padding: 2px; color: var(--fg-dim); }
.stars button .ic { width: 28px; height: 28px; }
.stars button.on { color: var(--accent); }
.stars button.on .ic { fill: currentColor; }
.log-list, .rec-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.log-list li, .rec-list li { padding: 10px 12px; background: var(--bg-3); border-radius: var(--radius); }
.log-list li.empty, .rec-list li.empty { background: transparent; color: var(--fg-dim); text-align: center; }
.log-meta, .rec-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fg-dim); }
.log-meta b, .rec-meta b { color: var(--fg); font-family: var(--font-disp); }
.log-meta .ibtn, .rec-meta .ibtn:first-of-type { margin-left: auto; }
.log-stars { color: var(--accent); letter-spacing: 1px; }
.log-list p { margin: 6px 0 0; white-space: pre-wrap; }
.rec-list audio { width: 100%; margin-top: 8px; height: 38px; }
.rec-box { display: flex; align-items: center; gap: 18px; padding: 6px 0 4px; }
.rec-btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border: 0; border-radius: 999px; background: #e0102a; color: #fff; font-weight: 900; font-size: 16px; }
.rec-btn .ic { width: 22px; height: 22px; }
.rec-btn.on { animation: recPulse 1.2s infinite; }
@keyframes recPulse { 50% { box-shadow: 0 0 0 10px rgba(224, 16, 42, .25); } }
.rec-time { font-family: var(--font-disp); font-weight: 900; font-size: 34px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; --fs: 30px; }
.legend li { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.legend .memo { margin: 0; font-size: 13px; }
.legend small { color: var(--fg-dim); font-size: 12px; }

/* 키 · 카포 */
.tp { display: flex; flex-direction: column; gap: 10px; }
.tp-row { display: grid; grid-template-columns: 1fr auto 1.3fr auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tp-label { display: flex; flex-direction: column; }
.tp-label b { font-family: var(--font-disp); font-weight: 900; font-size: 18px; letter-spacing: .1em; }
.tp-label small { color: var(--fg-dim); font-size: 12px; font-weight: 700; }
.tp-val { text-align: center; display: flex; flex-direction: column; }
.tp-val b { font-family: var(--font-disp); font-weight: 900; font-size: 52px; line-height: 1; color: var(--accent); }
.tp-val small { font-size: 12.5px; font-weight: 700; color: var(--fg-dim); min-height: 18px; }
.tp-sugg { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }

/* 운지표 */
.dg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.dg-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px 6px; border: 0; background: var(--bg-3); color: var(--fg); border-radius: var(--radius); }
.dg-card:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.dg-name { font-family: var(--font-disp); font-weight: 900; font-size: 20px; line-height: 1.1; }
.dg-name .cq { font-size: .78em; } .dg-name .cb { font-size: .72em; opacity: .8; }
.dg { width: 100%; max-width: 130px; height: auto; color: var(--fg); }
.dg-fret, .dg-str { stroke: currentColor; stroke-width: 1.3; opacity: .55; }
.dg-nut { fill: currentColor; }
.dg-dot { fill: var(--accent); }
.dg-o { fill: none; stroke: currentColor; stroke-width: 1.6; }
.dg-x { fill: currentColor; font-size: 13px; font-weight: 700; font-family: var(--font-ui); }
.dg-base { fill: currentColor; font-size: 10px; font-weight: 800; font-family: var(--font-disp); }
.dg-na { fill: currentColor; font-size: 30px; opacity: .4; }
.modal-chord { width: min(320px, 100%); }
.modal-chord .modal-head h2 .mh-title { font-size: 30px; }
.dg-one .dg { max-width: 230px; margin: 0 auto; }
.dg-frets { text-align: center; font-family: var(--font-disp); font-weight: 800; letter-spacing: .3em; color: var(--fg-dim); margin: 6px 0 0; }

/* 줄 메모 */
.memo-ed { display: flex; flex-direction: column; gap: 14px; }
.me-line { font-size: 20px; font-weight: 800; padding: 10px 14px; background: var(--bg-3); border-radius: var(--radius); box-shadow: inset 4px 0 0 var(--accent); }
.me-input { font-size: 17px !important; min-height: 50px; }

/* 셋리스트 편집 */
.sl-editor { display: flex; flex-direction: column; gap: 14px; }
.sle-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sle-col h4 { margin: 0 0 8px; font-family: var(--font-disp); font-weight: 900; letter-spacing: .1em; }
.sle-col h4 small { color: var(--fg-dim); font-family: var(--font-ui); letter-spacing: 0; }
.sle-col .search { margin-bottom: 8px; }
.sle-list { list-style: none; margin: 0; padding: 4px; display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow: auto; background: var(--bg-3); border-radius: var(--radius); }
.sle-list li { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; background: var(--panel-bg); border-radius: var(--radius); }
.sle-list li.empty { background: transparent; color: var(--fg-dim); justify-content: center; padding: 20px; }
.sle-list .sl-t small { color: var(--fg-dim); }
.sle-list .in { font-style: normal; font-family: var(--font-disp); font-weight: 900; font-size: 12px; padding: 1px 7px; background: var(--accent); color: var(--accent-ink); border-radius: 99px; }
.sle-list .add { color: var(--accent); opacity: 1; }

/* =========================================================
   반응형
   ========================================================= */
@media (max-width: 1100px) {
  .v-tools .vt span { display: none; }
  .vt { min-width: 42px; }
}
@media (max-width: 860px) {
  .ed-grid { grid-template-columns: 1fr; }
  .ed-right { position: static; max-height: none; }
  .ed-preview { max-height: 70vh; }
  .ed-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v-top { flex-wrap: wrap; row-gap: 4px; }
  .v-title { flex-basis: 0; }
  .v-tools { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .hbtn span { display: none; }
  .hbtn { min-width: 46px; }
  .hero { width: min(68%, 520px); top: 30px; }
  .sle-cols { grid-template-columns: 1fr; }
  .setlist-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero { width: 96%; top: 150px; right: -4%; }
  .home-top .tabs { margin-top: 128px; }
  .hero-lines { display: none; }
  .v-badges .vbadge small { display: none; }
  .vbadge { padding: 6px 8px; }
  .vbadge b { font-size: 17px; }
  .v-back span { display: none; }
  /* 좁은 화면에서는 곡 제목이 한 글자로 줄지 않도록 배지와 메뉴 버튼을 줄인다 */
  .v-menu-btn { padding: 6px 12px; }
  .v-menu-btn span { display: none; }
  .vb-bpm em { display: none; }
  .v-top { gap: 6px; }
  .v-badges { gap: 3px; }
  .v-song { font-size: 17px; }
  .v-sub { font-size: 11.5px; }
  .v-tools { display: none; }
  .v-edit { display: none; }
  .v-top { flex-wrap: nowrap; }
  .v-title { min-width: 0; flex: 1 1 0; }
  .nav-btn { min-width: 64px; font-size: 0; }
  .nav-btn span { display: none; }
  .v-counter { padding: 0 2px; }
  .v-counter .cur { font-size: 32px; }
  .v-counter .tot { font-size: 14px; }
  .secmap { display: none; }
  .next-peek { flex-wrap: wrap; row-gap: 0; white-space: normal; font-size: 13.5px; line-height: 1.3; max-height: 2.7em; overflow: hidden; }
  .v-page-wrap { inset: 12px 14px 8px; }
  .song-grid { grid-template-columns: 1fr; }
  .theme-picks { grid-template-columns: 1fr; }
  .tp-row { grid-template-columns: auto 1fr auto; }
  .tp-label { grid-column: 1 / -1; }
  .dg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-head { padding-top: 26px; }
  .tab { padding: 8px 14px; }
  .tab small { display: none; }
  .ed-head .sbtn span, .ed-head .pbtn span { font-size: 14px; }
  .tn-note { font-size: 84px; }
  .legend { grid-template-columns: 1fr; }
}
/* 휴대폰 폭에서도 SONGS · SETLIST · LESSON 세 탭이 한 줄에 놓이게 한다 */
@media (max-width: 440px) {
  .tabs { gap: 7px; }
  .tab { padding: 7px 9px; gap: 5px; }
  .tab b { font-size: 16px; }
  .tab-count { font-size: 11.5px; padding: 1px 6px; }
  .tab.on { box-shadow: 5px 5px 0 var(--accent); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
