/* ChordTool 음악용어사전 — 모바일 퍼스트. 테마: 잉크 그린 · 앰버 (license.css 구조를 따름) */
@font-face { font-family: 'ChordTool Glyphs'; src: url('/assets/glyph/ct-glyphs.woff2') format('woff2'); font-display: block; }
:root {
  --bg: #f6f7f4; --surface: #ffffff; --surface-2: #eef2ee; --text: #17201c; --muted: #5d6a64; --line: #dbe2dc;
  --accent: #134e4a; --accent-ink: #ffffff; --accent-soft: #e3efec; --amber: #b45309; --amber-soft: #fdf1df; --link: #0f6b62;
  --ok: #1f8a4c; --warn: #b45309; --radius: 14px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1513; --surface: #15201d; --surface-2: #1c2a26; --text: #ecf3ef; --muted: #9db0a8; --line: #2a3a35; --accent: #5eead4; --accent-ink: #062320; --accent-soft: #163a34; --amber: #fbbf24; --amber-soft: #33270c; --link: #7ee0d0; --ok: #4ade80; --warn: #fbbf24; color-scheme: dark; }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
ul, ol { padding-left: 20px; margin: 0 0 .8em; }
.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }
.lead { color: var(--muted); }
.muted, .hint { color: var(--muted); font-size: .86rem; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-bar { display: flex; align-items: center; gap: 10px; height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 26px/1 'ChordTool Glyphs'; padding-bottom: 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-size: 1.02rem; letter-spacing: -.02em; }
.brand-text small { font-size: .7rem; color: var(--amber); font-weight: 800; letter-spacing: .04em; }
.h-search { flex: 1; min-width: 0; position: relative; }
.h-search input { width: 100%; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .92rem; }
.icon-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--text); border-radius: 10px; cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.header-menu { display: none; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; }
.header-menu.is-open { display: flex; }
.header-menu a { padding: 6px 11px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: .86rem; font-weight: 600; }
.header-menu a:hover { background: var(--accent-soft); text-decoration: none; }
@media (min-width: 760px) { .header-menu { display: flex; } .header-menu.is-closed { display: none; } }

/* 자동완성 */
.ac { position: absolute; left: 0; right: 0; top: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); overflow: hidden; z-index: 40; }
.ac a { display: block; padding: 9px 14px; color: var(--text); border-top: 1px solid var(--line); font-size: .92rem; }
.ac a:first-child { border-top: 0; }
.ac a:hover, .ac a.on { background: var(--accent-soft); text-decoration: none; }
.ac small { color: var(--muted); margin-left: 6px; }

main.wrap { padding-top: 16px; padding-bottom: 40px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: .82rem; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.card > h2:first-child { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .88rem; font-weight: 600; }
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip small { color: var(--muted); font-weight: 500; }
.chip.ext::after { content: '↗'; font-size: .75em; color: var(--muted); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* 기호 */
.sym { display: inline-flex; align-items: center; justify-content: center; color: var(--text); white-space: nowrap; }
.sym-g { font-family: 'ChordTool Glyphs'; font-style: normal; line-height: 1; }
.sym-t { font-family: "Times New Roman", Georgia, "Noto Serif KR", serif; font-style: italic; font-weight: 700; }
.sym-ts { flex-direction: column; line-height: .5; }
.sym-ts span { display: block; }
.sym-svg svg { display: block; height: 100%; width: auto; }
.sym-lg { min-width: 120px; height: 120px; font-size: 76px; padding: 0 10px; }
.sym-lg.sym-t { font-size: 34px; }
.sym-lg.sym-ts { font-size: 54px; gap: 10px; }
.sym-lg.sym-svg { height: 96px; }
.sym-md { height: 64px; font-size: 36px; }
.sym-md.sym-t { font-size: 22px; }
.sym-md.sym-ts { font-size: 34px; gap: 6px; }
.sym-md.sym-svg { height: 52px; }
.sym-sm { height: 30px; min-width: 28px; font-size: 20px; }
.sym-sm.sym-t { font-size: 13px; }
.sym-sm.sym-ts { font-size: 15px; gap: 3px; }
.sym-sm.sym-svg { height: 24px; }

/* 용어 머리 */
.term-head { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: center; }
@media (min-width: 640px) { .term-head { grid-template-columns: auto 1fr; gap: 22px; } }
.term-sym { display: grid; place-items: center; background: var(--surface-2); border-radius: 16px; min-height: 140px; padding: 10px 14px; }
.term-head h1 { font-size: 1.7rem; margin-bottom: 4px; }
.term-head h1 .orig { font-size: .9rem; color: var(--muted); font-weight: 600; margin-left: 4px; }
.meaning { font-size: 1.25rem; font-weight: 800; color: var(--accent); margin: 2px 0 10px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.badge.lv1 { background: var(--accent-soft); color: var(--accent); }
.badge.draft { background: var(--amber-soft); color: var(--amber); }
.summary { font-size: 1.05rem; }
.section h2 { font-size: 1.08rem; padding-left: 10px; border-left: 4px solid var(--accent); }
.tips li { margin-bottom: 4px; }
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 8px 0 0; }
.cmp { border-top: 1px solid var(--line); padding: 10px 0; }
.cmp:first-of-type { border-top: 0; }
.notice { background: var(--amber-soft); color: var(--text); border-radius: 12px; padding: 12px 14px; font-size: .9rem; margin-bottom: 14px; }
.pager { display: flex; justify-content: space-between; gap: 10px; }
.pager a { flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager small { display: block; color: var(--muted); font-size: .78rem; }
.pager .next { text-align: right; }

/* 용어 목록 (분류·가나다·검색) */
.tlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 640px) { .tlist { grid-template-columns: 1fr 1fr; } }
.tlist a { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); height: 100%; }
.tlist a:hover { border-color: var(--accent); text-decoration: none; }
.tlist .s .sym-svg svg { max-width: 60px; }
.tlist .s { display: grid; place-items: center; height: 48px; background: var(--surface-2); border-radius: 10px; overflow: hidden; }
.tlist b { display: block; }
.tlist b small { color: var(--muted); font-weight: 500; font-size: .8rem; margin-left: 4px; }
.tlist span.m { color: var(--muted); font-size: .9rem; }
.tlist .bpm { color: var(--amber); font-size: .8rem; font-weight: 700; margin-left: 4px; }

/* 홈 */
.hero { padding: 22px 0 6px; }
.hero h1 { font-size: 1.8rem; }
.hero form { display: flex; gap: 8px; margin: 14px 0 8px; position: relative; }
.hero input { flex: 1; min-width: 0; height: 50px; padding: 0 18px; border-radius: 14px; border: 2px solid var(--accent); background: var(--surface); font-size: 1rem; }
.hero button { height: 50px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 800; cursor: pointer; }
.hero .ac { top: 54px; }
.cat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
.cat-grid a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); height: 100%; }
.cat-grid a:hover { border-color: var(--accent); text-decoration: none; }
.cat-grid b { display: block; }
.cat-grid small { color: var(--muted); }
.sym-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .sym-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.sym-grid .sym { max-width: 100%; overflow: hidden; }
.sym-grid .sym-svg svg { max-width: 100%; }
.sym-grid a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-size: .8rem; text-align: center; }
.sym-grid a:hover { border-color: var(--accent); text-decoration: none; }

/* 빠르기 막대 */
.bpm-chart { display: grid; gap: 4px; margin-top: 8px; font-size: .84rem; }
.bpm-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; }
.bpm-row a { color: var(--text); font-weight: 600; }
.bpm-bar { position: relative; height: 18px; background: var(--surface-2); border-radius: 6px; }
.bpm-bar i { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 6px; opacity: .85; }
.bpm-bar span { position: absolute; top: 0; font-size: .72rem; line-height: 18px; color: var(--muted); padding-left: 6px; white-space: nowrap; }

/* 총정리표 */
.sheet { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--surface); }
.sheet th, .sheet td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: middle; }
.sheet th { background: var(--surface-2); text-align: left; }
.sheet td.s { width: 84px; text-align: center; }
.sheet td.s .sym { height: 38px; }
.print-btn { float: right; }
@media print {
  .site-header, .site-footer, .breadcrumb, .ad-slot, .print-btn, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11px; }
  .card { border: 0; padding: 0; }
  .sheet { page-break-inside: auto; }
  .sheet tr { page-break-inside: avoid; }
  a { color: #000; }
}

/* 퀴즈 */
.quiz-box { text-align: center; }
.quiz-q { min-height: 120px; display: grid; place-items: center; margin: 8px 0 14px; }
.quiz-q .big { font-size: 1.6rem; font-weight: 800; }
.quiz-opts { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 640px) { .quiz-opts { grid-template-columns: 1fr 1fr; } }
.quiz-opts button { padding: 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 700; font-size: 1rem; }
.quiz-opts button:hover { border-color: var(--accent); }
.quiz-opts button.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.quiz-opts button.no { border-color: #dc2626; background: color-mix(in srgb, #dc2626 12%, var(--surface)); }
.quiz-bar { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.quiz-modes { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 800; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: var(--surface-2); color: var(--text); }

/* 비교 */
.vs { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .vs { grid-template-columns: 1fr 1fr; } }
.vs .card { text-align: center; }
.vs .meaning { font-size: 1.1rem; }

.ad-slot { margin: 14px 0; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-label { display: block; font-size: .7rem; color: var(--muted); margin-bottom: 2px; }

.site-footer { border-top: 1px solid var(--line); padding: 22px 0 34px; color: var(--muted); font-size: .84rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; }
.footer-links a { color: var(--muted); }
.tlist .s .sym-t { font-size: 11px; white-space: normal; text-align: center; line-height: 1.15; padding: 0 3px; }
