:root{--ink:#193c37;--muted:#687873;--green:#176657;--paper:#fffefa;--line:#dfe5dc;--bg:#f3f4ed;--gold:#c99a52}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.55 'Segoe UI',sans-serif}button,input,select{font:inherit}button,a,input,select{touch-action:manipulation}button,a{ -webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}a{color:var(--green);text-decoration:none}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #c99a52;outline-offset:3px}.top{height:78px;border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 36px;gap:16px;background:var(--paper)}.brand{font-size:26px;font-weight:650;letter-spacing:-.8px}.brand span{font-size:20px;letter-spacing:-.4px;margin-left:6px}.badge{font-size:10px;letter-spacing:1.6px;padding:4px 9px;border:1px solid #c9d9ce;border-radius:4px}.local{margin-left:auto;font-size:12px;color:var(--muted)}.layout{display:grid;grid-template-columns:320px minmax(0,1fr);gap:32px;max-width:1700px;margin:auto;padding:32px}.intro{padding:6px 2px 20px}.eyebrow{font-size:10px;font-weight:700;letter-spacing:1.8px;color:var(--muted)}h1{font-family:Georgia,'Times New Roman',serif;font-weight:500;font-size:34px;line-height:1.25;letter-spacing:-.6px;margin:14px 0}p{color:var(--muted)}.intro p{font-size:14px;margin-bottom:6px}.card{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:20px;margin-bottom:16px}h2{font-size:17px;margin:0 0 16px;font-weight:600}.card h2{color:#8a9d91;font-size:14px;display:flex;gap:10px}.card h2 span{color:var(--ink)}label{display:block;font-size:12px;font-weight:600;margin:12px 0 8px}input:not([type=checkbox]):not([type=range]),select{display:block;width:100%;padding:10px 11px;margin-top:6px;background:#fff;color:var(--ink);border:1px solid #ced8cf;border-radius:7px;min-width:0}input[type=checkbox]{accent-color:var(--green);width:16px;height:16px;flex:none}.drop{border:1px dashed #aebfb1;border-radius:9px;padding:20px 8px;text-align:center;background:#f5f8f1;cursor:pointer;overflow-wrap:anywhere}.drop strong,.drop small{display:block}.drop small{font-size:11px;font-weight:400;color:var(--muted);margin-top:5px}.file-icon{font-size:26px;color:var(--green);display:block}.drop input{font-size:11px!important;padding:6px!important;max-width:100%}.primary,.secondary{display:inline-flex;justify-content:center;align-items:center;gap:8px;border-radius:7px;padding:10px 14px;line-height:1.4;border:1px solid var(--line);font-size:13px;font-weight:600}.primary{background:var(--green);color:white;border-color:var(--green);width:100%;margin-top:12px;justify-content:space-between}.primary:hover:not(:disabled){background:#0f5144}.secondary{background:var(--paper);color:var(--ink)}.secondary:hover{background:#eef3e9}.hint{font-size:12px;color:var(--muted)}.check{display:flex;gap:8px;align-items:flex-start;font-weight:400}.workspace{min-width:0;padding-top:10px}.workspace-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:22px}.workspace-head h2{font-family:Georgia,serif;font-size:29px;line-height:1.3;margin:10px 0;overflow-wrap:anywhere;font-weight:400}.export{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.pill{display:inline-block;border:1px solid #d7e2d7;background:#edf2e8;border-radius:30px;padding:4px 10px;font-size:11px;color:#526d5c}#status{font-size:13px;min-height:44px;padding:11px 14px;background:#e9efe5;border-radius:8px;margin-bottom:12px;overflow-wrap:anywhere}#status.error{background:#fff0e9;color:#9b3f28}#warnings{border-left:3px solid var(--gold);padding:10px 16px;background:#fff8e7;font-size:12px;margin-bottom:16px;max-height:180px;overflow:auto}#warnings p{margin:4px 0;color:#79572f}.tabs{display:flex;gap:20px;border-bottom:1px solid var(--line);margin-top:16px}.tabs button{background:none;border:none;border-bottom:2px solid transparent;padding:12px 0;color:var(--muted);font-size:13px}.tabs button.active{border-bottom-color:var(--green);color:var(--green);font-weight:650}.player{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:16px 0}.player label{margin:0;display:flex;align-items:center;gap:8px;font-size:11px}.player select{width:130px;padding:7px;margin:0}.player input{width:100px;accent-color:var(--green)}.player output{font-size:11px;width:55px}.play{border:0;border-radius:50%;width:42px;height:42px;background:var(--green);color:white}.player #position{margin-left:auto;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}.paper{background:white;min-height:600px;border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 28px #173b3210;padding:28px 18px;overflow-x:auto}#empty{text-align:center;padding:100px 10px;color:var(--muted)}#empty h3{font-family:Georgia,serif;font-size:26px;font-weight:400;color:var(--ink)}#empty p{font-size:14px}.keys{font-size:70px;line-height:1;color:#abc3b4}#score{min-width:280px}#score svg{max-width:100%;height:auto}footer{text-align:center;color:var(--muted);font-size:11px;padding:24px 0}.history button{width:100%;text-align:left;border:0;border-bottom:1px solid var(--line);padding:10px 0;background:none;color:var(--ink);font-size:12px;overflow-wrap:anywhere}.history button small{display:block;color:var(--muted);font-size:10px}.history #history{max-height:300px;overflow:auto}#sourcePreview iframe{width:100%;height:650px;border:0;margin-top:20px}#sourcePreview img{max-width:100%;margin-top:20px}.edit-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:12px}details{margin-top:20px}summary{cursor:pointer;font-size:13px}[hidden]{display:none!important}
@media(max-width:1100px){.layout{grid-template-columns:280px minmax(0,1fr);padding:20px;gap:20px}.workspace-head{display:block}.export{justify-content:flex-start;margin-top:14px}.player{gap:8px}.edit-grid{grid-template-columns:1fr 1fr}}
@media(max-width:720px){.top{height:64px;padding:0 18px}.brand span{font-size:17px}.local{display:none}.layout{display:flex;flex-direction:column;padding:16px;gap:12px}aside{display:contents}.intro{order:0;padding-bottom:4px}.intro h1{font-size:31px}.upload{order:1}.layout>aside>.card{margin-bottom:0}.workspace{order:3}.history{order:4}.workspace-head h2{font-size:25px}.paper{min-height:400px;padding:10px 4px}#empty{padding:65px 12px}.edit-grid{grid-template-columns:1fr 1fr}.tabs{gap:18px}.player label{flex-wrap:wrap}.player input{width:85px}}
@media print{@page{size:A4 portrait;margin:12mm}body{background:white}.top,aside,.workspace-head,.tabs,.player,#status,#warnings,#sourcePanel,#editor,footer{display:none!important}.layout{display:block;padding:0}.workspace{padding:0}.paper{display:block!important;border:0;box-shadow:none;padding:0;overflow:visible}#score svg{width:100%;break-inside:avoid;page-break-inside:avoid}.paper #empty{display:none}}
@media(max-width:720px){.layout>aside>.card:not(.upload):not(.history){order:2}}
@media print{.paper{min-height:0!important}#score,#score>div{height:auto!important;min-height:0!important}#score svg{display:block}}
@media print{#score>div{break-after:page;page-break-after:always}#score>div:last-child{break-after:auto;page-break-after:auto}}
@font-face{font-family:'Piano Noto Sans';font-style:normal;font-weight:400;font-display:swap;src:url('/static/fonts/NotoSans-Regular.ttf') format('truetype')}
@font-face{font-family:'Piano Noto Sans';font-style:normal;font-weight:600 900;font-display:swap;src:url('/static/fonts/NotoSans-SemiBold.ttf') format('truetype')}
body,button,input,select,textarea,h1,h2,h3,.workspace-head h2,#empty h3{font-family:'Piano Noto Sans',sans-serif}
h1,.workspace-head h2,#empty h3{letter-spacing:normal;line-height:1.45}
.eyebrow{line-height:1.8;letter-spacing:1px}
.paper{overflow-x:auto}#score{min-width:700px}
@media print{#score{min-width:0}}
.notation-pending::before{content:'Đang chuẩn bị sheet nhạc…';display:block;padding:12px;color:#526d5c}
@media print{.notation-pending #score,.notation-pending #practiceGuide{display:none!important}}

.reading-options{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:0 0 14px}
.reading-options label{margin:0}
.reading-options select{width:260px;margin:0}
.reading-options p{flex-basis:100%;margin:0}

.guided #score,.guide-sheet-header{
  width:194mm;min-width:194mm;max-width:194mm;margin:0 auto;
  font-family:Arial,'Piano Noto Sans',sans-serif;color:#1e2b37;
}
.guide-sheet-header{padding:0 0 12px;line-height:1.35;break-inside:avoid;break-after:avoid}
.guide-sheet-header .guide-song{font-family:inherit;color:inherit;font-size:24px;line-height:1.2;
  font-weight:700;overflow-wrap:anywhere;margin:0 0 2px}
.guide-sheet-header p{font:inherit;color:inherit;margin:3px 0}
.guide-sheet-header .guide-tempo{font-size:12px}
.guide-sheet-header .guide-instructions,.guide-sheet-header .guide-dynamics,.guide-sheet-header .guide-notice{font-size:11px}
.guide-dynamics span{margin-right:10px}
.left-hand{color:#aa5107}.right-hand{color:#1764a9}
.guided .strength-soft{color:#116326;font-weight:400}
.guided .strength-medium-soft{color:#116326;font-weight:700}
.guided .strength-medium-loud{color:#b51c27;font-weight:400}
.guided .strength-loud{color:#b51c27;font-weight:700}

.paper #score>.practice-system{
  height:auto!important; margin:0 0 22px; line-height:1.25;
  break-inside:avoid;page-break-inside:avoid;
}
#score .system-notation{width:100%;height:auto;display:block}
.bar-tables{display:grid;align-items:start;margin-top:3px}
.measure-card{min-width:0;padding:0 4px}
.measure-card+.measure-card{border-left:1px dotted #cad2d7}
.bar-keyboards{display:flex;justify-content:center;align-items:flex-start;gap:6px;min-height:52px;margin:0 0 3px}
.bar-keyboards>div{min-width:0}
.bar-keyboards.separate{flex-wrap:wrap;justify-content:flex-start}
.bar-keyboards.separate small{font-size:10px;display:block}
#score .bar-keyboards svg{display:block;max-width:100%;height:52px;width:auto;overflow:visible}
.measure-card table{width:100%;border-collapse:collapse;line-height:1.32;color:#1e2b37;font-variant-numeric:tabular-nums}
.measure-card table+table{margin-top:5px;border-top:1px dotted #c6cdd1}
.measure-card td,.measure-card th{vertical-align:top;text-align:center;padding:1px .5px;border:0}
.measure-card th:first-child{text-align:left;width:1px;white-space:nowrap;font-size:11px;padding-right:3px}
.system-notation .measure-title{fill:#c02020;font:700 18px Arial,sans-serif}
.measure-card th.beat-start,.measure-card td.beat-start{border-left:1px solid #d6dfe3}
.measure-card td span{white-space:nowrap}
.measure-card .bar-tip{font-size:10px;font-weight:bold;color:#1764a9;line-height:1.3;margin:4px 0}
@media(max-width:720px){.reading-options select{width:100%}}
@media print{
  @page practice-sheet{size:A4 portrait;margin:8mm;
    @bottom-right{content:counter(page) " / " counter(pages);font:8pt Arial,sans-serif;color:#364553}}
  .reading-options{display:none!important}
  .guided{page:practice-sheet;print-color-adjust:exact;-webkit-print-color-adjust:exact}
  .guided #score,.guide-sheet-header{margin:0;width:100%;min-width:0;max-width:none}
  .guide-sheet-header{break-after:avoid-page;page-break-after:avoid}
  #score>.practice-system{break-after:auto;page-break-after:auto}
  #score>.practice-system.new-sheet-page{break-before:page;page-break-before:always}
  #score>.practice-system.large-system{break-inside:auto;page-break-inside:auto}
  .practice-system table{break-inside:avoid}
}

.tabs{flex-wrap:wrap;column-gap:18px;row-gap:0}
.easy-paper{container-type:inline-size}
.easy-paper #score{min-width:0;max-width:1120px;margin:auto;font-family:Arial,sans-serif;color:#192635}
.easy-header{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:4px 18px;margin-bottom:16px}
.easy-header h2{margin:0;font-size:24px}.easy-header strong{font-size:17px}
.easy-header p{flex-basis:100%;margin:0;color:#394951;font-size:13px}
.easy-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.easy-card{min-width:0;padding:6px 0 10px;margin-bottom:8px;border-bottom:1px solid #c5cccf;line-height:1.25}
.easy-card h3{color:#b31920;font-size:17px;margin:0 0 3px}
.easy-keyboards{display:flex;flex-wrap:wrap;align-items:end;justify-content:center;gap:6px;margin:4px 0 7px}
.easy-keyboards>div{flex:1 1 36%;min-width:0;text-align:center;color:#57636b;font-size:12px}
.easy-keyboards small{display:block}
.easy-paper #score .easy-keyboards svg{display:block;width:auto;max-width:100%;height:auto;margin:0 auto}
.easy-card table{width:100%;border-collapse:collapse;font-size:12px;font-variant-numeric:tabular-nums}
.easy-card table+table{margin-top:4px}
.easy-card th,.easy-card td{padding:2px;text-align:center;overflow-wrap:anywhere}
.easy-card th{text-align:left;width:1%;white-space:nowrap;padding-right:6px}
.easy-card tr:nth-child(-n+2){background:#eff3f3;font-weight:600}
.easy-card td.beat-start{border-left:1px solid #ccd4d5}
@container (max-width:780px){.easy-row{grid-template-columns:1fr;gap:0}}
@media print{
  @page easy-sheet{size:A4 landscape;margin:7mm 9mm;
    @bottom-right{content:counter(page) " / " counter(pages);font:8pt Arial,sans-serif}}
  body:has(.easy-paper){page:easy-sheet}
  .easy-paper{page:easy-sheet;container-type:normal;print-color-adjust:exact;-webkit-print-color-adjust:exact}
  .easy-header{break-after:avoid;margin-bottom:6px;gap:2px 18px;line-height:1.25}
  .easy-header p{font-size:10px}
  .easy-paper #score>.easy-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;
    break-after:auto;page-break-after:auto;break-inside:avoid;page-break-inside:avoid}
  .easy-card{padding:3px 0;margin:0 0 3px}
  .easy-card h3{font-size:16px;margin:0}
  .easy-keyboards{margin:0 0 3px}
  .easy-card table{font-size:11px;line-height:1.17}
  .easy-card th,.easy-card td{padding:.5px 2px}
}

