* { box-sizing:border-box; }
body { margin:0; font-family:'Pretendard','Malgun Gothic','Apple SD Gothic Neo',sans-serif;
       background:#f4f4f2; color:#111; }
.app { display:flex; height:100vh; }
.editor { width:620px; flex:0 0 620px; background:#fff; padding:16px;
          overflow-y:auto; min-width:300px; }
#splitter { flex:0 0 7px; background:#e2e2de; cursor:col-resize;
            border-left:1px solid #d5d5d0; border-right:1px solid #d5d5d0; }
#splitter:hover, #splitter.on { background:#b9b9b2; }
.viewer { flex:1 1 auto; overflow:auto; padding:24px; }

h1 { font-size:15px; margin:0 0 14px; letter-spacing:-0.3px; }
label { display:block; font-size:11px; font-weight:700; color:#666; margin:10px 0 4px; }
input, textarea, select { width:100%; font-family:inherit; font-size:12px; padding:6px 8px;
      border:1px solid #ccc; border-radius:4px; background:#fff; }
textarea { font-family:'D2Coding','Consolas','Menlo',monospace; font-size:14.5px;
           line-height:2.0; height:520px; resize:vertical; white-space:pre;
           caret-color:#e01b24; tab-size:4; }
textarea:focus { outline:2px solid #111; outline-offset:-1px; }
.grid4 { display:grid; grid-template-columns:1fr 1fr 1fr 1fr; gap:8px; }
#caretinfo { font-size:11px; color:#888; text-align:right; margin-top:4px;
             font-family:'D2Coding',monospace; }
#barinfo { font-size:11px; color:#2a6; margin-top:3px; font-family:'D2Coding',monospace;
           min-height:15px; }
#warn { display:none; font-size:11px; line-height:1.7; color:#a11; background:#fdf0f0;
        border:1px solid #f0cfcf; border-radius:5px; padding:9px 11px; margin-top:8px; }
.help { font-size:11px; color:#666; line-height:1.75; background:#f7f7f5;
        border:1px solid #e5e5e2; border-radius:5px; padding:10px 11px; margin-top:10px; }
.help code { background:#e8e7e3; padding:1px 5px; border-radius:3px; font-size:11px; }
.help b { color:#111; }
button { width:100%; margin-top:14px; padding:11px; font-family:inherit; font-size:13px;
         font-weight:700; background:#111; color:#fff; border:0; border-radius:5px;
         cursor:pointer; }
button:hover { background:#333; }
.btnrow { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:12px; }
.btnrow button { margin-top:0; background:#fff; color:#111; border:1px solid #bbb;
                 font-weight:600; }
.btnrow button:hover { background:#f0f0ee; }

/* ---------- 악보 (A4 고정) ---------- */
.sheet { background:#fff; width:210mm; height:297mm; padding:13mm 12mm;
         margin:0 auto 22px; box-shadow:0 1px 6px rgba(0,0,0,.14); overflow:hidden; }

/* 헤더: 좌우 2단 */
.sheethead { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; }
.hl { min-width:0; }
.hr { text-align:right; flex:0 0 auto; }
.title  { font-size:25px; font-weight:800; letter-spacing:-0.6px; line-height:1.15; }
.artist { font-size:13px; color:#444; margin-top:3px; }
.meta   { font-size:12px; color:#333; white-space:nowrap; }
.formbox{ display:inline-block; border:1.5px solid #111; border-radius:4px;
          padding:5px 14px; font-size:15px; font-weight:800; margin-top:7px; }
.rule   { border:0; border-top:1px solid #ccc; margin:11px 0 10px; }

/* 2페이지 이후 러닝헤드 */
.runhead { font-size:11px; color:#555; text-align:right; font-weight:600;
           border-bottom:1px solid #ccc; padding-bottom:5px; margin-bottom:11px; }

.block { margin-bottom:16px; }
.row   { display:flex; align-items:flex-start; }
.label { width:66px; flex:0 0 66px; position:relative; font-size:11px; font-weight:800;
         color:#666; padding-top:3px; }
.tsig  { position:absolute; right:3px; top:21px; font-size:12px; font-weight:800;
         line-height:12px; text-align:center; color:#111; }
.grid  { flex:1 1 auto; }

.marks  { height:15px; position:relative; }
.mark   { position:absolute; bottom:0; font-size:11px; font-weight:800; font-style:italic;
          white-space:nowrap; color:#111; }
.ebr    { position:absolute; bottom:0; height:11px; border-top:1.2px solid #111;
          border-left:1.2px solid #111; }
.ebrno  { position:absolute; bottom:1px; left:3px; font-size:10px; font-weight:800; }

.chords { height:22px; position:relative; }
.chord  { position:absolute; bottom:1px; font-size:13.5px; font-weight:800;
          white-space:nowrap; letter-spacing:-0.3px; }

.ruler  { height:16px; position:relative; border-bottom:1.1px solid #111; }
.barline{ position:absolute; top:0; bottom:0; border-left:1.1px solid #111; }
.thick  { position:absolute; top:0; bottom:0; border-left:2.6px solid #111; }
.dot    { position:absolute; width:3px; height:3px; border-radius:50%; background:#111; }
.tick   { position:absolute; bottom:0; height:7px; border-left:1px solid #666; }
.tick.t8{ height:4px; border-left:1px solid #c8c8c8; }

.lyric  { height:24px; position:relative; }
.syl    { position:absolute; bottom:2px; font-size:13.5px; white-space:nowrap;
          letter-spacing:-0.4px; }
.syl.tight { border-bottom:1.5px dotted #d33; }
.versno { position:absolute; left:-15px; bottom:2px; font-size:11px; color:#999; }

@media print {
  @page { size:A4; margin:0; }
  body { background:#fff; }
  .editor, #splitter { display:none; }
  .app, .viewer { display:block; height:auto; overflow:visible; padding:0; }
  .viewer { zoom:1 !important; }
  .sheet { box-shadow:none; margin:0; height:auto; page-break-after:always; }
  .sheet:last-child { page-break-after:auto; }
  .syl.tight { border-bottom:0; }
}

/* 새 곡 · 저장 · 불러오기 3칸 */
.btnrow.three { grid-template-columns:1fr 1fr 1fr; }

/* ---------- 로그인 · 내 악보 ---------- */
[hidden] { display:none !important; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 14px; }
.topbar h1 { margin:0; }
.acct { display:flex; align-items:center; gap:6px; flex:0 0 auto; }
.acct #acct_in { display:flex; align-items:center; gap:4px; }
.savestate { font-size:11px; color:#888; margin-right:4px; white-space:nowrap; }
.savestate.err { color:#a11; }
button.mini { width:auto; margin:0; padding:5px 11px; font-size:11px; border-radius:4px; }
button.linkbtn { width:auto; margin:0; padding:3px 4px; background:none; color:#666; font-size:11px;
                 font-weight:600; text-decoration:underline; }
button.linkbtn:hover { background:none; color:#111; }

dialog.dlg { border:0; border-radius:8px; padding:22px 24px 16px; width:min(360px, calc(100vw - 32px));
             box-shadow:0 6px 30px rgba(0,0,0,.25); font-family:inherit; color:#111; }
dialog.dlg.wide { width:min(480px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background:rgba(0,0,0,.35); }
.dlg h2 { font-size:15px; margin:0 0 6px; letter-spacing:-0.3px; }
.dlgsub { font-size:12px; color:#666; line-height:1.6; margin:0; }
button.oauth { background:#fff; color:#111; border:1px solid #bbb; }
button.oauth:hover { background:#f0f0ee; }
.or { font-size:11px; color:#888; text-align:center; margin:16px 0 6px; }
.emailform button { margin-top:8px; }
.dlgnote { font-size:11px; color:#2a6; line-height:1.6; margin:10px 0 0; }
.dlgnote:empty { display:none; }
.dlgnote.err { color:#a11; }
button.linkbtn.dlgclose { display:block; margin:10px auto 0; }

.songlist { list-style:none; padding:0; margin:12px 0 0; max-height:55vh; overflow-y:auto;
            border-top:1px solid #eee; }
.songlist li { display:flex; align-items:center; gap:8px; border-bottom:1px solid #eee; padding:6px 0; }
.songlist button.open { flex:1 1 auto; width:auto; margin:0; padding:6px 8px; text-align:left; background:none;
                        color:#111; font-size:13px; font-weight:700; border-radius:4px; overflow:hidden;
                        text-overflow:ellipsis; white-space:nowrap; }
.songlist button.open:hover { background:#f4f4f2; }
.songlist li.cur button.open::after { content:'  편집 중'; color:#2a6; font-size:11px; font-weight:600; }
.songlist .date { font-size:11px; color:#888; white-space:nowrap; }
.songlist .empty { color:#888; font-size:12px; padding:14px 2px; display:block; }
.dlglegal { font-size:11px; color:#888; margin-top:12px; }
.dlglegal a { color:#666; }
