/* Tab Editor */
.te-page { max-width: 1500px; }
.te-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.te-filebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.te-save { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border2); color: var(--muted); }
.te-save.saved { color: var(--green); border-color: rgba(53, 208, 127, .35); }
.te-save.saving { color: var(--amber); }
.te-save.unsaved { color: var(--amber); border-color: rgba(255, 180, 59, .4); }
.te-sel { background: var(--surface2); border: 1px solid var(--border2); border-radius: 9px; padding: 7px 10px; font-size: 13px; min-width: 0; max-width: 100%; }
.te-sel.sm { padding: 4px 6px; }
.te-num { width: 64px; background: var(--surface2); border: 1px solid var(--border2); border-radius: 8px; padding: 5px 8px; font-size: 13px; }
.te-text { flex: 1; min-width: 0; background: var(--surface2); border: 1px solid var(--border2); border-radius: 8px; padding: 6px 9px; font-size: 13px; }

.te-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.te-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.te-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; padding-right: 2px; }
@media (max-width: 1100px) { .te-grid { grid-template-columns: 1fr; } .te-side { position: static; max-height: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }

/* palette */
.te-pal { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 10px 12px; }
.te-grp { display: flex; flex-direction: column; gap: 4px; }
.te-glab { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; }
.te-gbtns { display: flex; flex-wrap: wrap; gap: 3px; }
.te-tb { min-width: 34px; height: 34px; padding: 0 7px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border2); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 3px; transition: .12s; }
.te-tb:hover { border-color: var(--accent); }
.te-tb.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: color-mix(in srgb, var(--accent) 40%, white); }
.te-tb .sym { font-size: 17px; line-height: 1; }
.te-tb small { font-size: 9.5px; color: var(--muted); }
.te-tb.flip svg { transform: scaleX(-1); }

/* player */
.te-player { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; }
.te-play { min-width: 96px; }
.te-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; min-width: 92px; }
.te-speed { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.te-speed input { width: 110px; accent-color: var(--accent); }
.te-speedlab { min-width: 38px; font-variant-numeric: tabular-nums; }
.te-snd { font-size: 12px; margin-left: auto; }

/* sheet */
.te-sheet { position: relative; padding: 0; overflow: hidden; }
.te-loading { padding: 40px; text-align: center; color: var(--muted); }
.te-scroll { height: calc(100vh - 330px); min-height: 360px; overflow: auto; outline: none; }
.te-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.te-wrap { position: relative; }
.te-host { position: relative; min-height: 200px; }
.te-host.busy { opacity: .92; }
.te-host .at-surface { cursor: text; }
.te-cur { position: absolute; border: 2px solid var(--accent); border-radius: 5px; box-shadow: 0 0 0 3px rgba(255, 90, 54, .25); pointer-events: none; z-index: 5; transition: left .06s, top .06s; }
.te-col { position: absolute; background: rgba(255, 90, 54, .07); border-radius: 6px; pointer-events: none; z-index: 1; }
.te-selbox { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.te-selb { position: absolute; background: rgba(90, 169, 255, .18); border-top: 2px solid rgba(90, 169, 255, .6); }
.te-host.playing ~ .te-cur, .te-host.playing ~ .te-col { opacity: .35; }
/* alphaTab playback cursor */
.te-host .at-cursor-bar { background: rgba(255, 180, 59, .08); }
.te-host .at-cursor-beat { background: var(--amber); width: 3px; }
.te-host .at-highlight * { fill: var(--amber); stroke: var(--amber); }
.te-host .at-selection div { background: rgba(90, 169, 255, .15); }

.te-status { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.te-status .warn { color: var(--amber); }

/* side panels */
.te-panel { padding: 12px 14px; }
.te-ph { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.te-ph h3 { font-size: 14px; }
.te-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.te-frow { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.te-frow > label:first-child { width: 58px; font-size: 12px; color: var(--muted); flex: none; }
.te-frow.btns { margin-top: 10px; }
.te-track { border: 1px solid var(--border); border-radius: 10px; padding: 7px 8px; margin-bottom: 6px; }
.te-track.on { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: rgba(255, 90, 54, .04); }
.te-trow { display: flex; align-items: center; gap: 6px; }
.te-trow + .te-trow { margin-top: 6px; }
.te-trow.mix { font-size: 11px; }
.te-trow.mix input { flex: 1; min-width: 0; accent-color: var(--accent); }
.te-trow.opts .te-sel { flex: 1; }
.te-tpick { color: var(--accent); width: 18px; flex: none; }
.te-tname { flex: 1; min-width: 0; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 3px 5px; font-weight: 600; font-size: 13px; }
.te-tname:hover, .te-tname:focus { border-color: var(--border2); background: var(--surface2); }
.te-ms { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border2); font-size: 11px; font-weight: 700; color: var(--muted); flex: none; }
.te-ms.on { background: var(--amber); color: #1a1205; border-color: var(--amber); }
.te-ms.solo.on { background: var(--blue); border-color: var(--blue); color: #06121f; }
.te-capo { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.te-capo .te-num { width: 52px; }
.te-files { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.te-file { display: flex; align-items: center; gap: 4px; border-radius: 8px; }
.te-file.on { background: var(--accent-soft); }
.te-fopen { flex: 1; min-width: 0; text-align: left; padding: 6px 8px; display: flex; flex-direction: column; }
.te-fopen b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.te-fopen small { font-size: 11.5px; }
.te-fdel { padding: 6px; color: var(--faint); }
.te-fdel:hover { color: #ff8a8a; }

.te-help { padding: 14px 16px; }
.te-help[hidden] { display: none; }
.te-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 18px; font-size: 12.5px; }
.te-keys div { display: flex; gap: 10px; align-items: baseline; }
.te-keys kbd { min-width: 92px; font: 600 11.5px/1.4 ui-monospace, Consolas, monospace; color: var(--text); background: var(--surface2); border: 1px solid var(--border2); border-radius: 6px; padding: 1px 6px; text-align: center; }
@media (max-width: 700px) { .te-scroll { height: 60vh; } .te-snd { margin-left: 0; } }
.te-credit { font-size: 11px; margin-top: 2px; }
.te-speedlab.muted0 { color: var(--amber); font-weight: 700; }

/* guide drawer */
.te-guide { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--surface); border-left: 1px solid var(--border2); box-shadow: var(--shadow); z-index: 1000; display: flex; flex-direction: column; padding: 16px 18px 0; }
.te-guide[hidden] { display: none; }
.te-ghead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.te-ghead h2 { font-size: 19px; }
.te-gq { width: 100%; background: var(--surface2); border: 1px solid var(--border2); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.te-gq:focus { outline: none; border-color: var(--accent); }
.te-gcount { font-size: 12px; margin: 6px 2px 8px; }
.te-gcols { flex: 1; min-height: 0; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px; }
.te-gtoc { overflow: auto; display: flex; flex-direction: column; gap: 2px; padding-bottom: 16px; border-right: 1px solid var(--border); padding-right: 8px; }
.te-gtoc a { font-size: 12.5px; padding: 5px 8px; border-radius: 7px; color: var(--muted); }
.te-gtoc a:hover { background: var(--surface2); color: var(--text); }
.te-gbody { overflow: auto; padding: 0 6px 40px 0; font-size: 13.5px; line-height: 1.65; }
.te-gsec { padding: 6px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 14px; scroll-margin-top: 6px; }
.te-gsec h3 { font-size: 16px; margin-bottom: 6px; color: var(--text); }
.te-gsec h4 { font-size: 13.5px; margin: 12px 0 4px; color: color-mix(in srgb, var(--accent) 45%, white); }
.te-gsec p { margin: 6px 0; color: #d6d6e0; }
.te-gsec ul, .te-gsec ol { margin: 6px 0 6px 20px; color: #d6d6e0; }
.te-gsec li { margin: 3px 0; }
.te-gsec a { color: var(--blue); }
.te-gsec code { font: 12px ui-monospace, Consolas, monospace; background: var(--surface2); padding: 1px 5px; border-radius: 5px; }
.te-gsec kbd { font: 600 11.5px/1.4 ui-monospace, Consolas, monospace; background: var(--surface2); border: 1px solid var(--border2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; }
.te-gsec table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 12.5px; }
.te-gsec th, .te-gsec td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.te-gsec th { color: var(--muted); font-weight: 600; }
.te-gsec mark { background: rgba(255, 180, 59, .35); color: inherit; border-radius: 3px; padding: 0 1px; }
@media (max-width: 640px) { .te-gcols { grid-template-columns: 1fr; } .te-gtoc { display: none; } }

/* tool drawers */
.te-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100vw); background: var(--surface); border-left: 1px solid var(--border2); box-shadow: var(--shadow); z-index: 1000; display: flex; flex-direction: column; padding: 16px 18px 0; }
.te-dbody { flex: 1; min-height: 0; overflow: auto; padding: 4px 4px 40px 0; }
.te-dbody h4.te-bkh { font-size: 13px; margin: 16px 0 6px; color: color-mix(in srgb, var(--accent) 45%, white); }
.te-bkp { font-size: 12.5px; line-height: 1.6; margin: 4px 0 8px; }
.te-bkstat { padding: 10px 12px; border: 1px solid var(--border2); border-radius: 10px; background: var(--surface2); font-size: 13px; }
.te-bkdock { position: fixed; left: 16px; bottom: 16px; width: 320px; background: var(--surface); border: 1px solid var(--border2); border-radius: 12px; box-shadow: var(--shadow); z-index: 900; overflow: hidden; }
.te-bkdock .te-bkbar { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 4px 10px; font-size: 12px; color: var(--muted); }
.te-bkdock iframe { display: block; width: 320px; height: 180px; }
.te-bkdock.mini { width: 220px; } .te-bkdock.mini iframe { width: 220px; height: 124px; }
/* command palette */
.te-cmd { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 1100; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.te-cmdbox { width: min(620px, 94vw); background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; }
.te-cmdlist { max-height: 52vh; overflow: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.te-cmdrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-align: left; font-size: 13.5px; }
.te-cmdrow.on { background: var(--accent-soft); }
.te-cmdrow kbd { font: 600 11px/1.4 ui-monospace, Consolas, monospace; background: var(--surface2); border: 1px solid var(--border2); border-radius: 5px; padding: 0 5px; }
.te-cmdrow .faint { font-size: 11.5px; }
.te-cmdhint { font-size: 11.5px; margin-top: 8px; }
/* chords */
.te-chhere { font-size: 12px; color: var(--muted); margin: 6px 0 10px; }
.te-chgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.te-chcard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border: 1px solid var(--border2); border-radius: 12px; background: var(--surface2); color: var(--text); }
.te-chcard:hover { border-color: var(--accent); }
.te-chcard b { font-size: 14px; } .te-chcard small { font: 11px ui-monospace, Consolas, monospace; color: var(--muted); }
.te-chsvg { color: #d8d4cf; }
/* scales */
.te-scinfo { font-size: 13px; margin: 6px 0 8px; color: #d6d6e0; }
.te-fb { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: #191512; }
.te-fbgrid { display: grid; gap: 0; min-width: 560px; }
.te-fbn { font-size: 10px; color: var(--faint); text-align: center; }
.te-fbs { font-size: 11px; color: var(--muted); display: flex; align-items: center; }
.te-fbc { height: 26px; border-left: 2px solid #6b5f52; position: relative; display: flex; align-items: center; justify-content: center; background: linear-gradient(transparent 12px, #9a8f84 12px, #9a8f84 14px, transparent 14px); }
.te-fbc.open { border-left: 0; background: linear-gradient(transparent 12px, #9a8f8466 12px, #9a8f8466 14px, transparent 14px); }
.te-fbd { position: relative; z-index: 1; min-width: 22px; height: 20px; border-radius: 10px; background: #e7e1d8; color: #241c14; font: 700 10px/20px Inter, sans-serif; padding: 0 3px; }
.te-fbd.root { background: var(--accent); color: #fff; }
.te-fbd:hover { outline: 2px solid var(--amber); }
.te-scfit { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.te-scrow { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); text-align: left; font-size: 13px; }
.te-scrow:hover { border-color: var(--accent); }
/* lyrics */
.te-lyr { width: 100%; min-height: 200px; background: var(--surface2); border: 1px solid var(--border2); border-radius: 10px; padding: 10px; font-size: 14px; line-height: 1.6; resize: vertical; margin: 8px 0; }
/* rig */
.rig-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.rig-p { border: 1px solid var(--border2); border-radius: 12px; padding: 10px 12px; background: var(--surface2); opacity: .7; }
.rig-p.on { opacity: 1; border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.rig-ph { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rig-sw { width: 38px; height: 20px; border-radius: 999px; background: var(--surface3); position: relative; border: 1px solid var(--border2); }
.rig-sw i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: .15s; }
.rig-p.on .rig-sw { background: var(--accent); } .rig-p.on .rig-sw i { left: 20px; background: #fff; }
.rig-ks { display: flex; flex-direction: column; gap: 4px; }
.rig-k { display: grid; grid-template-columns: 74px 1fr 62px; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.rig-k input[type=range] { accent-color: var(--accent); width: 100%; }
.rig-v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.rig-out { flex: 1; min-width: 260px; }
.te-drawer .te-ghead > span { white-space: nowrap; }

/* speed trainer */
.te-player { position: relative; }
.te-trpop { position: absolute; z-index: 60; top: calc(100% + 6px); left: 12px; width: 320px; padding: 12px 14px; box-shadow: var(--shadow); }
.te-trbadge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 4px 3px 10px; border-radius: 999px; background: rgba(255, 180, 59, .14); color: var(--amber); }
.te-trbadge[hidden] { display: none; }
.te-trbadge span { color: var(--muted); }
