/* Leapinity 뮤직 화면 모양
   - 색·글꼴·버튼·위아래 막대는 lp-brand.css(Leapinity 공통, _leapinity-style 에서 복사)를 써요.
   - 여기는 뮤직에만 필요한 모양. 색은 모두 변수로 써서 밝게·어둡게가 같이 바뀌어요.
   - 사이트 고유 색: 장미(로즈) #db2777 (흰 글자 4.6:1) / 흰 바탕 글자 #be185d (5.6:1 이상) / 어두운 바탕 글자 #f9a8d4
   - style-src 'self' 라서 HTML 에 style="…" 을 쓰지 않아요 (자바스크립트의 el.style.setProperty 는 괜찮아요) */
:root {
  --lp-accent: #db2777; --lp-accent-ink: #be185d; --lp-accent-ink-dark: #f9a8d4; --lp-on-accent: #ffffff;
  --c-accent-soft: #fdeaf3;
  --c-warn: #8a4b00; --c-warn-bg: #fff4e0;
  --cell-bg: #eef0f8; --cell-bg-alt: #e2e5f2; --cell-line: #d5d9ea;
  --now-bg: #fbcfe8; --now-ring: #be185d;
  --k: #e11d48; --s: #d97706; --c: #ea580c; --h: #0284c7; --o: #0891b2; --t: #7c3aed; --r: #65a30d; --y: #059669;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --c-accent-soft: #3d1530;
  --c-warn: #ffd18a; --c-warn-bg: #3a2a10;
  --cell-bg: #1f2755; --cell-bg-alt: #283163; --cell-line: #34407a;
  --now-bg: #6b2350; --now-ring: #f9a8d4;
  --k: #fb7185; --s: #fbbf24; --c: #fb923c; --h: #38bdf8; --o: #22d3ee; --t: #a78bfa; --r: #a3e635; --y: #34d399;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --c-accent-soft: #3d1530;
  --c-warn: #ffd18a; --c-warn-bg: #3a2a10;
  --cell-bg: #1f2755; --cell-bg-alt: #283163; --cell-line: #34407a;
  --now-bg: #6b2350; --now-ring: #f9a8d4;
  --k: #fb7185; --s: #fbbf24; --c: #fb923c; --h: #38bdf8; --o: #22d3ee; --t: #a78bfa; --r: #a3e635; --y: #34d399;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; }
body { min-height: 100vh; display: flex; flex-direction: column; font-size: 16px; line-height: 1.65; }
main { flex: 1; padding-bottom: 8px; }
a { color: var(--lp-accent-ink); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--lp-focus); outline-offset: 2px; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.3; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--lp-card); color: var(--lp-ink); padding: 10px 16px; border-radius: 12px; }
.skip:focus { top: 12px; }
.muted { color: var(--lp-mute); }
[hidden] { display: none !important; }
.copy-helper { position: fixed; left: -9999px; top: 0; opacity: 0; }
button { font-family: var(--lp-font); }

/* 위 막대 */
.bar-link { min-height: 44px; padding: 0 16px; font-size: 14px; }
@media (max-width: 380px) { .bar-link { padding: 0 12px; } }

/* 머리 */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding-top: 14px; font-size: 14px; color: var(--lp-mute); }
.crumbs a { color: var(--lp-soft); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.crumbs a:hover { text-decoration: underline; }
.page-head { padding-top: 6px; padding-bottom: 14px; }
.page-head h1 { font-size: clamp(26px, 6vw, 38px); font-weight: 800; margin: 4px 0 6px; display: flex; align-items: center; gap: 10px; }
.h1-emoji { font-size: .9em; }
.lead { color: var(--lp-soft); margin: 0; font-size: 17px; }
.hero { padding-top: 28px; padding-bottom: 8px; text-align: center; }
.hero h1 { font-size: clamp(28px, 7vw, 46px); font-weight: 800; letter-spacing: -0.03em; margin: 8px 0 10px; }
.hero .lead { max-width: 640px; margin: 0 auto; }
@media (max-width: 480px) { .hero { padding-top: 18px; } .hero .lead { font-size: 15.5px; } }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.btn-row.center { justify-content: center; }
.big-btn { min-height: 52px; padding: 0 24px; font-size: 16.5px; cursor: pointer; }
.warn { background: var(--c-warn-bg); color: var(--c-warn); padding: 10px 14px; border-radius: 12px; }

/* ---------- 음악 만들기 판 ---------- */
.app { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.transport { position: sticky; top: calc(61px + env(safe-area-inset-top)); z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 20px; background: color-mix(in srgb, var(--lp-card) 92%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.play-btn { min-width: 116px; min-height: 52px; font-size: 17px; }
.play-ico { display: inline-block; width: 1.1em; text-align: center; }
.t-info { margin: 0; flex: 1 1 auto; min-width: max-content; display: flex; flex-wrap: wrap; gap: 0 12px; align-items: center; color: var(--lp-soft); font-size: 15px; font-weight: 600; white-space: nowrap; }
.t-info b { color: var(--lp-ink); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.t-steps { color: var(--lp-ink); font-weight: 800; }
.t-clear { padding: 0 16px; }
.t-clear.armed { background: var(--c-accent-soft); border-color: var(--lp-accent); color: var(--lp-accent-ink); }
@media (max-width: 480px) {
  .transport { gap: 6px; padding: 8px; flex-wrap: nowrap; }
  .play-btn { min-width: 84px; padding: 0 12px; flex: none; }
  .transport > .lp-chip { padding: 0 10px; flex: none; }
  .t-info { flex: 1 1 0; min-width: 0; overflow: hidden; flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.25; font-size: 13.5px; }
  .t-clear { flex: none; }
  .t-info b { font-size: 16px; }
  .t-clear { padding: 0; width: 44px; }
  .t-clear:not(.armed) [data-clear-txt] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .t-clear.armed { width: auto; padding: 0 12px; }
}

.panel { padding: 16px; }
@media (max-width: 480px) { .panel { padding: 12px 8px; border-radius: 20px; } }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0 4px 8px; }
.panel-h { margin: 0; font-size: 19px; font-weight: 800; }
.panel-sub { margin: 0; color: var(--lp-soft); font-size: 14px; }
.preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 4px 12px; }
.preset-lab { font-size: 14px; font-weight: 700; color: var(--lp-soft); margin-right: 2px; }
.preset-row .lp-chip { padding: 0 14px; }

/* 칸판 */
.grid { display: flex; flex-direction: column; gap: 14px; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.gblock { --n: 16; --lab: 64px; }
.grow { display: grid; grid-template-columns: var(--lab) repeat(var(--n), minmax(0, 1fr)); column-gap: 3px; margin-bottom: 3px; align-items: stretch; }
.ghead { margin-bottom: 2px; }
.gsp { display: block; }
.gnum { white-space: nowrap; overflow: visible; font-size: 12px; font-weight: 700; color: var(--lp-mute); text-align: left; padding-left: 2px; line-height: 20px; font-variant-numeric: tabular-nums; border-radius: 4px; }
.gnum.now { color: var(--lp-accent-ink); }
.grow > .beat:not(:nth-child(2)) { margin-left: 4px; }
.glab { min-height: 44px; min-width: 0; padding: 0 6px; border-radius: 12px; border: 1px solid var(--lp-line); background: var(--lp-chip); color: var(--lp-ink);
  font: 700 13px/1.1 var(--lp-font); display: flex; align-items: center; gap: 5px; justify-content: flex-start; overflow: hidden; white-space: nowrap; }
.glab::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--lp-accent)); }
.cell { height: 44px; min-width: 0; padding: 0; border-radius: 7px; border: 1px solid var(--cell-line); background: var(--cell-bg); cursor: pointer;
  transition: background-color .08s, transform .08s; }
.cell.alt { background: var(--cell-bg-alt); }
.cell[aria-pressed="true"] { background: var(--dot); border-color: transparent; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
.cell.now { box-shadow: inset 0 0 0 2px var(--now-ring); }
.cell.now:not([aria-pressed="true"]) { background: var(--now-bg); }
.cell.now[aria-pressed="true"] { transform: scale(1.08); filter: brightness(1.12); }
@media (hover: hover) { .cell:not([aria-pressed="true"]):hover { border-color: var(--dot); } }
.dot-k, .c-k { --dot: var(--k); } .dot-s, .c-s { --dot: var(--s); } .dot-c, .c-c { --dot: var(--c); } .dot-h, .c-h { --dot: var(--h); }
.dot-o, .c-o { --dot: var(--o); } .dot-t, .c-t { --dot: var(--t); } .dot-r, .c-r { --dot: var(--r); } .dot-y, .c-y { --dot: var(--y); }
@media (max-width: 760px) {
  .gblock { --lab: 44px; }
  .grow { column-gap: 1px; }
  .grow > .beat:not(:nth-child(2)) { margin-left: 3px; }
  .glab { padding: 0 3px; font-size: 11.5px; letter-spacing: -.04em; justify-content: center; border-radius: 10px; }
  .glab::before { display: none; }
  .glab { box-shadow: inset 3px 0 0 var(--dot); }
  .cell { border-radius: 4px; }
  .gnum { font-size: 11px; padding-left: 1px; }
}
/* 휴대폰: 한 줄 8칸(칸 폭 36~40px). 칸판 카드는 화면 끝까지 넓혀요 */
@media (max-width: 480px) {
  .panel-grid { margin: 0 -12px; padding: 12px 6px; border-radius: 18px; }
  .panel-grid .panel-head, .panel-grid .preset-row { margin-left: 8px; margin-right: 8px; }
  .gblock { --lab: 36px; }
  .grow { column-gap: 2px; }
  .grow > .beat:not(:nth-child(2)) { margin-left: 6px; }
  .glab { font-size: 10.5px; padding: 0 1px; letter-spacing: -.06em; }
  .gnum { font-size: 12px; padding-left: 3px; }
  .grid { gap: 10px; }
}

/* 소리 조절 */
.mixer { margin-top: 12px; border-top: 1px solid var(--lp-line); padding-top: 4px; }
.mixer > summary, .fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 6px;
  font-weight: 800; font-size: 16px; border-radius: 12px; }
.mixer > summary::-webkit-details-marker, .fold > summary::-webkit-details-marker { display: none; }
.mixer > summary::after, .fold > summary::after { content: '▾'; margin-left: auto; color: var(--lp-mute); transition: transform .2s; }
.mixer[open] > summary::after, .fold[open] > summary::after { transform: rotate(180deg); }
.sum-sub { font-weight: 600; font-size: 13.5px; color: var(--lp-soft); }
.mix-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px 16px; }
.mix-row { display: grid; grid-template-columns: minmax(84px, 1fr) auto auto minmax(90px, 1.2fr); align-items: center; gap: 6px; }
.mix-name { min-height: 44px; border: 1px solid var(--lp-line); background: var(--lp-chip); color: var(--lp-ink); border-radius: 12px; font: 700 14px/1.2 var(--lp-font);
  cursor: pointer; padding: 0 10px; text-align: left; box-shadow: inset 4px 0 0 var(--dot); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix-btn { padding: 0 10px; gap: 4px; min-width: 44px; justify-content: center; }
.mix-btn-t { font-size: 13px; }
.mix-vol { display: flex; align-items: center; min-width: 0; }
input[type="range"] { width: 100%; min-height: 44px; margin: 0; accent-color: var(--lp-accent); cursor: pointer; background: transparent; }
@media (max-width: 400px) {
  .mix-list { grid-template-columns: 1fr; }
  .mix-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .mix-vol { grid-column: 1 / -1; }
}

/* 아래 설명 */
.content { margin-top: 30px; }
.content h2 { font-size: 21px; font-weight: 800; margin: 0 0 10px; }
.content p, .content li { color: var(--lp-ink); }
.faq { background: var(--lp-card); border: 1px solid var(--lp-line); border-radius: 16px; padding: 4px 16px; margin-bottom: 8px; }
.faq p { margin: 0 0 12px; color: var(--lp-soft); }
.faq summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: '▸'; color: var(--lp-accent-ink); transition: transform .2s; flex: none; }
.faq[open] summary::before { transform: rotate(90deg); }
.legal h2 { font-size: 18px; margin-top: 24px; }
.legal a { overflow-wrap: anywhere; }
.nf { text-align: center; padding-top: 40px; }
.nf h1 { justify-content: center; }
.nf-emoji { font-size: 56px; margin: 0; }
.nf .lp-btn { margin-top: 18px; }
.feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.feat { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; text-decoration: none; color: var(--lp-ink); transition: transform .25s var(--lp-ease), border-color .2s; }
.feat:hover { border-color: var(--lp-accent); }
@media (hover: hover) { .feat:hover { transform: translateY(-2px); } }
.feat-e { font-size: 28px; line-height: 1.2; flex: none; }
.feat-t { display: flex; flex-direction: column; gap: 2px; }
.feat-t b { font-size: 16.5px; font-weight: 800; }
.feat-t span { color: var(--lp-soft); font-size: 14px; line-height: 1.5; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--lp-card); border: 1px solid var(--lp-line); border-radius: 18px; padding: 14px 16px; }
.steps li > span:last-child { display: flex; flex-direction: column; }
.steps b { font-weight: 800; }
.steps li span span { color: var(--lp-soft); font-size: 14px; }
.step-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--lp-accent); color: var(--lp-on-accent); font-weight: 800; }
.more-link a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--lp-accent-ink); }

/* 사용법 */
.guide .toc { background: var(--lp-card); border: 1px solid var(--lp-line); border-radius: 18px; padding: 10px 16px; }
.toc-h { margin: 4px 0; font-weight: 800; }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 14px; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; color: var(--lp-accent-ink); font-weight: 700; }
.g-sec { margin-top: 30px; scroll-margin-top: 76px; }
.g-sec > p { margin: 0 0 10px; }
.g-sec li { margin-bottom: 6px; }
.cta { text-align: center; margin-top: 30px; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; background: var(--lp-chip); padding: 1px 6px; border-radius: 6px; }

/* 아래쪽 */
.lp-foot-links a { min-width: 44px; justify-content: center; }
.foot-cats { display: flex; flex-wrap: wrap; gap: 0 18px; width: 100%; }
.foot-cats a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.foot-cats a:hover { color: var(--lp-foot-hi); }
.ad-slot { margin-top: 20px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0;
  background: var(--lp-ink); color: var(--lp-bg); padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 15px;
  transition: opacity .25s, transform .25s; pointer-events: none; z-index: 90; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Leapinity의 다른 도구 ---------- */
.lp-more { margin-top: 40px; margin-bottom: 8px; }
.lp-more-h { margin: 0 0 12px; font-size: 15px; font-weight: 700; letter-spacing: .01em; color: var(--lp-soft); }
.lp-more-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lp-more-card { display: flex; align-items: center; gap: 12px; min-height: 64px; height: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 18px;
  background: var(--lp-card); border: 1px solid var(--lp-line); color: var(--lp-ink); text-decoration: none; transition: transform .25s ease, border-color .25s; }
.lp-more-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--lp-vio) 45%, var(--lp-line)); }
.lp-more-ic { flex: none; width: 40px; height: 40px; }
.lp-more-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.lp-more-txt b { font-size: 15.5px; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
.lp-more-txt span { font-size: 13.5px; color: var(--lp-soft); line-height: 1.4; word-break: keep-all; }
.lp-more-go { flex: none; font-size: 22px; line-height: 1; color: var(--lp-mute); }
@media (max-width: 720px) {
  .lp-more { margin-top: 32px; }
  .lp-more-list { grid-template-columns: 1fr; gap: 8px; }
  .lp-more-card { min-height: 56px; padding: 10px 12px; }
  .lp-more-ic { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .faq summary::before, .feat, .cell, .lp-more-card, .mixer > summary::after, .fold > summary::after { transition: none; }
  .feat:hover, .lp-more-card:hover, .cell.now[aria-pressed="true"] { transform: none; }
}
@media print {
  .lp-bar, .lp-foot, .ad-slot, .crumbs, .transport { display: none; }
}

/* ---------- 2단계: 칸 + 빠르기 ---------- */
a.t-info { text-decoration: none; min-height: 44px; border-radius: 12px; padding: 0 4px; }
a.t-info:hover .t-bpm b { text-decoration: underline; }
.t-plus { color: var(--lp-mute); font-weight: 800; }
@media (max-width: 480px) { .t-plus { display: none; } }
.tempo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tbox { background: var(--lp-bg-soft); border: 1px solid var(--lp-line); border-radius: 18px; padding: 12px 14px; min-width: 0; }
.tbox-bpm { grid-row: span 2; }
.tlab { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 8px; font-weight: 800; font-size: 15.5px; }
.tlab-sub { font-weight: 600; font-size: 13px; color: var(--lp-soft); }
.tval { color: var(--lp-accent-ink); font-variant-numeric: tabular-nums; }
.thint { margin: 4px 0 0; font-size: 13.5px; color: var(--lp-soft); line-height: 1.5; }
.bpm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.step-btn { width: 44px; justify-content: center; padding: 0; font-size: 22px; font-weight: 800; }
.bpm-num { width: 92px; text-align: center; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 4px 6px; }
.tap-btn { flex: 1 1 auto; }
.tap-btn.tapped { animation: tap .18s ease-out; }
@keyframes tap { from { transform: scale(.93); } to { transform: scale(1); } }
.tscale { display: flex; justify-content: space-between; margin: 0; font-size: 12.5px; color: var(--lp-soft); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row .lp-chip { padding: 0 16px; }
.sections { margin-top: 14px; }
.sec-h { margin: 0 0 2px; font-size: 16px; font-weight: 800; }
.sec-list { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sec-list:empty { display: none; }
.sec-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: var(--lp-bg-soft); border: 1px solid var(--lp-line); border-radius: 16px; padding: 8px 10px; }
.sec-f { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.sec-num { width: 76px; text-align: center; font-weight: 800; padding: 6px; }
.sec-del { margin-left: auto; }
.sec-warn { width: 100%; margin: 0; font-size: 13.5px; color: var(--c-warn); }
@media (max-width: 640px) {
  .tempo-grid { grid-template-columns: 1fr; }
  .tbox-bpm { grid-row: auto; }
}
@media (prefers-reduced-motion: reduce) { .tap-btn.tapped { animation: none; } }
.tbl { width: 100%; border-collapse: collapse; margin: 8px 0 12px; background: var(--lp-card); border-radius: 14px; overflow: hidden; font-size: 15px; }
.tbl caption { text-align: left; font-weight: 800; padding: 4px 0 6px; }
.tbl th, .tbl td { border: 1px solid var(--lp-line); padding: 8px 10px; text-align: center; }
.tbl th { background: var(--lp-chip); }
