.tabedit-main-editor[hidden],.tabedit-mode-panel[hidden]{display:none!important}
.tabedit-content-tabs{display:flex;align-items:center;gap:5px;overflow-x:auto;scrollbar-width:thin;padding:2px 2px 9px;margin-bottom:9px;border-bottom:1px solid rgba(255,255,255,.13)}
.tab-mode-button{box-sizing:border-box;border:1px solid rgba(255,255,255,.16);border-radius:9px;background:#29272a;color:#f2e9df;min-height:29px;padding:4px 10px;font:inherit;font-size:.76rem;white-space:nowrap;cursor:pointer}.tab-mode-button:hover{border-color:rgba(var(--songbook-accent-rgb),.55);background:#39333a}.tab-mode-button.is-active,.tab-mode-button.is-primary{background:rgba(var(--songbook-accent-rgb),.25);border-color:rgba(var(--songbook-accent-rgb),.7);color:#fff}.tab-mode-button.is-danger{color:#ffbdad;border-color:#aa655b}.tab-mode-button.is-remove{color:#f2aaa2;padding:2px 7px;min-height:24px}.tab-mode-button:disabled{opacity:.55;cursor:wait}
.tabedit-mode-panel{box-sizing:border-box;width:100%;min-height:300px;padding:4px 2px 10px;color:#fff7ec}.tab-mode-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:4px}.tab-mode-heading h2{font-size:1.02rem;margin:0}.tab-mode-status{font-size:.74rem;color:#b9cfac}.tab-mode-status.is-error{color:#ffb6a8}.tab-mode-help{font-size:.77rem;color:#b8aba4;line-height:1.4;margin:5px 0 10px}.tab-mode-section-tabs,.tab-mode-part-tabs{display:flex;align-items:center;gap:5px;overflow-x:auto;scrollbar-width:thin;padding:3px 1px 8px;margin-bottom:7px}.tab-mode-section-tabs{border-bottom:1px solid rgba(255,255,255,.1)}.tab-mode-part-tabs .tab-mode-button{min-width:30px;padding:4px 8px}.tab-mode-cue{display:flex;align-items:center;gap:8px;margin:7px 0;font-size:.74rem;color:#bcb1a7}.tab-mode-cue input,.tab-mode-musician-meta input[type=text]{min-width:0;flex:1;border:1px solid #4d4546;border-radius:7px;background:#161619;color:#fff;padding:6px 8px;font:inherit;font-size:.78rem}
.tab-mode-parts{display:grid;gap:8px}.tab-mode-part-card{border:1px solid rgba(255,255,255,.13);border-radius:10px;background:#1c1b1e;padding:9px}.tab-mode-part-header{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-bottom:7px}.tab-mode-part-header h3{font-size:.82rem;margin:0 auto 0 0}.tab-mode-line-count{font-size:.7rem;color:#9bb5a0}.tab-mode-line-count.is-long{color:#ffc982}.tab-mode-block,.tab-mode-slide-block{box-sizing:border-box;width:100%;min-width:0;resize:vertical;border:1px solid #4b4749;border-radius:8px;background:#111114;color:#fff;font:inherit;font-family:Roboto Mono,monospace;font-size:.88rem;line-height:1.5;padding:9px 11px}.tab-mode-block:focus,.tab-mode-slide-block:focus{outline:2px solid rgba(var(--songbook-accent-rgb),.45)}.tab-mode-part-tools{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin:7px 0}.tab-mode-slide-block{min-height:55vh;max-height:70vh}.tab-mode-footer{display:flex;justify-content:flex-end;position:sticky;bottom:0;padding:9px 2px 1px;background:linear-gradient(180deg,transparent,#1a191b 35%)}
.tab-mode-musician-meta{display:flex;gap:8px;align-items:center;margin:8px 0}.tab-mode-musician-meta input[type=color]{width:39px;height:31px;border:1px solid #5b5558;border-radius:7px;background:#1b1b1e;padding:2px}.tab-mode-musician-body{max-height:62vh;overflow:auto;border:1px solid rgba(255,255,255,.12);border-radius:9px;padding:9px;background:#141417}.tab-mode-musician-source{display:flex;align-items:center;gap:7px;min-height:28px}.tab-mode-source-number{width:27px;flex:0 0 27px;text-align:right;color:#817f83;font-size:.7rem}.tab-mode-musician-source pre{flex:1;min-width:0;overflow-x:auto;margin:0;white-space:pre;font-size:.8rem;color:#e1dcd5}.tab-mode-musician-source .tab-mode-button{min-height:21px;padding:0 6px}.tab-mode-musician-note{display:flex;align-items:center;gap:6px;margin:3px 0 5px 34px;border-left:3px solid var(--note-color);padding-left:7px}.tab-mode-musician-note input{min-width:0;flex:1;border:0;border-bottom:1px solid var(--note-color);background:#212125;color:var(--note-color);font:inherit;font-size:.82rem;padding:5px 7px}.tab-mode-musician-note input::placeholder{color:#9e9b9e}
@media(max-width:700px){.tabedit-content-tabs{gap:3px}.tab-mode-button{font-size:.69rem;padding:4px 7px}.tab-mode-heading{display:block}.tab-mode-heading h2{margin-bottom:4px}.tab-mode-cue{display:block}.tab-mode-cue input{width:100%}.tab-mode-part-header h3{width:100%}.tab-mode-musician-body{max-height:55vh}}
.tab-musician-versions{display:flex;gap:5px;overflow-x:auto;padding:7px 3px;border-bottom:1px solid rgba(255,255,255,.14)}.tab-musician-versions button{border:1px solid rgba(255,255,255,.18);border-radius:8px;background:#252427;color:#e7e2dc;font:inherit;font-size:.76rem;padding:5px 10px;white-space:nowrap;cursor:pointer}.tab-musician-versions button.is-active{border-color:rgba(var(--songbook-accent-rgb),.7);background:rgba(var(--songbook-accent-rgb),.22);color:#fff}.tab-musician-content{padding:10px 6px;overflow:auto}.tab-musician-content[hidden],#tab-content[hidden]{display:none!important}.tab-musician-base{margin:0;min-height:1.4em;white-space:pre;overflow:visible;color:#f6f1eb;font:inherit;font-family:Roboto Mono,monospace;line-height:1.45}.tab-musician-note{min-height:1.4em;margin:2px 0 2px 12px;padding-left:9px;border-left:3px solid var(--note-color);color:var(--note-color);white-space:pre-wrap;font:inherit;font-family:Roboto Mono,monospace;line-height:1.45}

.tab-mode-overview{display:grid;gap:8px}.tab-mode-overview-section{border:1px solid rgba(255,255,255,.12);border-radius:8px;background:#171719;padding:9px 12px}.tab-mode-overview-section h3{font-size:.85rem;margin:0 0 7px;color:#e8d6c5}.tab-mode-overview-section pre{margin:0;white-space:pre-wrap;font:inherit;font-family:Roboto Mono,monospace;font-size:.84rem;line-height:1.45;color:#f0ede9}.tab-mode-animation-toolbar{display:flex;gap:7px;align-items:center;margin:8px 0}.tab-mode-animation{cursor:grab;border-color:#8294a1;background:#24313a;color:#cde6f6}.tab-mode-section-block{min-height:320px;max-height:75vh;overflow:auto;line-height:1.55}.tab-mode-musician-source{min-height:23px;gap:5px}.tab-mode-musician-source .tab-mode-button,.tab-mode-musician-add{min-width:22px;width:22px;height:22px;min-height:22px;padding:0;border-radius:5px;flex:0 0 22px}.tab-mode-musician-source pre{font-size:.78rem}.tab-mode-musician-add{margin-bottom:5px}.tab-mode-musician-note{margin:1px 0 2px 27px;min-height:25px;padding-left:5px}.tab-mode-musician-note input{font-size:.78rem;padding:2px 5px}

/* Compact TAB metadata and keep Find/Replace directly below the view tabs. */
.tabedit-workspace .metadata-section.tabedit-card{padding:10px 12px!important}
.tabedit-workspace .tabedit-metadata-grid.tabedit-metadata-groups{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.68fr);gap:8px;align-items:stretch}
.tabedit-workspace .tabedit-meta-group{padding:7px 9px;gap:7px;border-radius:10px;align-items:end}
.tabedit-workspace .tabedit-meta-group-version{grid-template-columns:minmax(0,1fr) minmax(70px,.42fr) minmax(65px,.38fr)}
.tabedit-workspace .tabedit-meta-group-performance{grid-template-columns:minmax(75px,1fr) minmax(65px,.55fr)}
.tabedit-workspace .tabedit-meta-field{justify-content:flex-end;gap:3px}
.tabedit-workspace .tabedit-meta-field input,.tabedit-workspace .tabedit-meta-field select{box-sizing:border-box;height:32px;min-height:32px;margin:0!important;padding:3px 8px;line-height:24px}
.tabedit-workspace .tabedit-meta-field[for="tab-capo"]{justify-content:flex-end}
.tabedit-workspace .tabedit-meta-field[for="tab-capo"] #tab-capo{height:32px;min-height:32px;align-self:stretch}
.tabedit-workspace .tabedit-search-card{width:100%!important;max-width:100%;margin:2px 0 10px;padding:6px 8px;border-radius:9px}
.tabedit-workspace .tabedit-longtext-stack{margin-top:7px;gap:5px}
.tabedit-workspace .tabedit-longtext-stack textarea{min-height:58px;padding:6px 8px}
@media(max-width:840px){.tabedit-workspace .tabedit-metadata-grid.tabedit-metadata-groups{grid-template-columns:1fr}}
@media(max-width:560px){.tabedit-workspace .tabedit-meta-group-version,.tabedit-workspace .tabedit-meta-group-performance{grid-template-columns:1fr 1fr}.tabedit-workspace .tabedit-meta-field-name{grid-column:1/-1}}
/* The eight-line guide is paint only; no separator characters enter the lyrics. */
.tab-mode-section-block{--karaoke-line-height:1.55em;line-height:var(--karaoke-line-height);background-color:#111114;background-image:repeating-linear-gradient(to bottom,transparent 0,transparent calc(12.4em - 2px),rgba(226,192,117,.55) calc(12.4em - 2px),rgba(226,192,117,.55) 12.4em);background-origin:content-box;background-clip:content-box;background-attachment:local}
.tab-mode-musician-source,.tab-mode-musician-note{box-sizing:border-box;min-height:1.45em;height:1.45em;line-height:1.45em;margin:0;padding:0;border:0;background:none}
.tab-mode-musician-note{display:flex;align-items:center;gap:5px;color:var(--note-color)}
.tab-mode-musician-note input{height:1.45em;min-height:0;padding:0;border:0;border-radius:0;background:none;color:var(--note-color);font-family:Roboto Mono,monospace;line-height:1.45em}
.tab-mode-musician-note input:focus{outline:none;box-shadow:inset 0 -1px var(--note-color)}
.tab-mode-musician-note .tab-mode-source-number{flex:0 0 27px;width:27px}
.tab-mode-musician-note .is-remove{opacity:.55;min-height:18px;height:18px;line-height:16px}

.tab-mode-musician-note.is-chord-line input,.tab-musician-note.is-chord-line{font-family:Roboto Mono,monospace;white-space:pre;letter-spacing:.02em}

/* Restore two metadata rows and make Find/Replace a compact tool row. */
.tabedit-workspace .tabedit-metadata-grid.tabedit-metadata-groups{grid-template-columns:1fr;gap:7px}
.tabedit-workspace .tabedit-meta-group{width:100%;box-sizing:border-box}
.tabedit-workspace .tabedit-meta-group-version{grid-template-columns:minmax(0,1fr) minmax(100px,.45fr) minmax(95px,.4fr)}
.tabedit-workspace .tabedit-meta-group-performance{grid-template-columns:minmax(0,1fr) minmax(100px,.45fr)}
.tabedit-workspace .tabedit-search-card{gap:6px;padding:4px 6px;margin:0 0 7px}
.tabedit-workspace .tabedit-search-input{font-size:.75rem;min-height:24px;height:24px;padding:2px 7px;border-radius:7px}
.tabedit-workspace .tabedit-search-card .action-btn{font-size:.75rem;min-height:24px;padding:2px 8px;line-height:1.1}
/* Guides are drawn in an overlay and positioned by JS scrollTop. */
.tab-mode-karaoke-editor{position:relative;min-width:0}
.tab-mode-section-block{display:block;position:relative;z-index:1;background:#111114!important;background-image:none!important}
.tab-mode-karaoke-guides{position:absolute;z-index:2;inset:0;pointer-events:none;overflow:hidden;border-radius:8px}
.tab-mode-karaoke-guides-inner{position:absolute;inset:0;background-repeat:repeat-y;pointer-events:none}
/* Insert controls occupy the gap between source lines. */
.tab-mode-musician-insert{height:14px;display:flex;align-items:center;margin:0 0 1px}
.tab-mode-musician-insert .tab-mode-button{width:21px;height:18px;min-height:18px;min-width:21px;padding:0;line-height:16px;border-radius:5px}
.tab-mode-musician-source,.tab-mode-musician-note{height:1.45em;min-height:1.45em;margin:0}
.tab-mode-musician-note input{box-shadow:none}
/* Instrumentist view inherits the complete TAB viewer frame and type scale. */
.tab-musician-content.tabviewer-pre{box-sizing:border-box;white-space:pre;line-height:1.42;overflow:visible;padding:16px 18px 18px}
.tab-musician-content .tab-musician-base,.tab-musician-content .tab-musician-note{box-sizing:border-box;margin:0;padding:0;min-height:1.42em;line-height:inherit;font-size:inherit;font-family:inherit;white-space:pre;color:inherit;border:0;overflow:visible}
.tab-musician-content .tab-musician-note{color:var(--note-color)}
@media(max-width:560px){.tabedit-workspace .tabedit-meta-group-version{grid-template-columns:1fr 1fr}.tabedit-workspace .tabedit-meta-field-name{grid-column:1/-1}.tabedit-workspace .tabedit-meta-group-performance{grid-template-columns:1fr 1fr}}

.tab-content-stack.has-presentation-bar .tab-musician-content.tabviewer-pre{padding:0 0 calc(18px + 10em);border:0;border-radius:0;background:transparent}
.tab-musician-content .tab-musician-note .chord{color:var(--note-color);background:transparent;font-size:inherit;line-height:inherit}
@media(max-width:700px){.tab-musician-content.tabviewer-pre{padding-left:2px;padding-right:2px}}

.tab-mode-karaoke-guides-inner{background:none!important;will-change:transform}
.tab-mode-karaoke-guide-line{position:absolute;left:10px;right:10px;height:1px;background:rgba(226,192,117,.68)}
.tab-mode-karaoke-guide-line.is-section{background:rgba(124,163,187,.53)}

.tab-mode-karaoke-band{position:absolute;left:10px;right:10px;background:rgba(221,178,102,.018)}
.tab-mode-karaoke-band.is-alternate{background:rgba(127,170,200,.05)}
.tab-mode-karaoke-section-title{position:absolute;left:10px;right:10px;box-sizing:border-box;border-top:1px solid rgba(124,163,187,.7);border-bottom:1px solid rgba(124,163,187,.7);background:rgba(124,163,187,.065)}

/* Whole sections alternate two near-black grays; each subsection reserves eight rows. */
.tab-mode-karaoke-band{background:#161719}
.tab-mode-karaoke-band.is-alternate{background:#1c1e20}
.tab-mode-karaoke-section-title{left:10px;right:10px;padding:0 3px;display:flex;align-items:center;background:#202b34;color:#f5f1e9;font-family:Roboto Mono,monospace;font-size:.88rem;font-weight:800;line-height:1.55;border-top:1px solid #637e90;border-bottom:1px solid #637e90;white-space:pre}
.tab-mode-karaoke-guide-line{background:rgba(202,207,211,.35)}
/* TAB editor uses the same surface and base text colors as the reading view. */
.tabedit-workspace .CodeMirror{background:linear-gradient(180deg,rgba(42,42,42,.98),rgba(30,30,30,.96))!important;color:var(--pre-text-color)!important;font-family:Roboto Mono,monospace;font-size:13px;line-height:1.42}
.tabedit-workspace .CodeMirror-lines,.tabedit-workspace .CodeMirror pre.CodeMirror-line,.tabedit-workspace .CodeMirror pre.CodeMirror-line-like{color:var(--pre-text-color)!important}
.tabedit-workspace .CodeMirror-gutters{background:rgba(32,32,32,.96);border-right:1px solid rgba(255,255,255,.08)}
.tabedit-workspace .CodeMirror-cursor{border-left-color:var(--pre-text-color)}
.tabedit-format-tools{display:flex;align-items:center;gap:4px;margin-left:auto}
.tabedit-format-tools button,.tabedit-text-color{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;width:25px;height:24px;border:1px solid rgba(255,255,255,.15);border-radius:6px;background:rgba(255,255,255,.05);color:var(--pre-text-color);font-size:.78rem;cursor:pointer}
.tabedit-format-tools button:hover,.tabedit-text-color:hover{border-color:rgba(var(--songbook-accent-rgb),.6)}
.tabedit-text-color{position:relative;overflow:hidden}
.tabedit-text-color span{font-weight:800;text-decoration:underline;text-decoration-color:#f2c875;text-decoration-thickness:2px}
.tabedit-text-color input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.tab-rich-bold{font-weight:800}.tab-rich-italic{font-style:italic}.tab-rich-underline{text-decoration:underline}
@media(max-width:620px){.tabedit-format-tools{margin-left:0}}
.tab-mode-karaoke-band{background:rgba(255,255,255,.022)}
.tab-mode-karaoke-band.is-alternate{background:rgba(255,255,255,.065)}

/* Dense frozen TAB lines: the first and last 55px insert without extra rows. */
.tab-mode-musician-source{cursor:text;position:relative}
.tab-mode-musician-source:hover{background:rgba(255,255,255,.035)}
.tab-mode-musician-source:focus-visible{outline:1px solid rgba(97,197,232,.6);outline-offset:-1px}
.tab-mode-animation-toolbar{position:relative}
.tab-mode-animation-menu{position:absolute;z-index:5;top:100%;left:0;display:flex;gap:5px;padding:6px;border:1px solid #657986;border-radius:7px;background:#21292d;box-shadow:0 6px 18px #0008}
.tab-mode-animation-menu[hidden]{display:none}
.tab-mode-block-size{display:inline-flex;align-items:center;gap:6px;color:#d7d5d1;font-size:.8rem}
.tab-mode-block-size select{height:29px;border:1px solid #687984;border-radius:6px;background:#20272d;color:#fff}
.tab-content-presentation-bar .tab-musician-versions{flex-basis:100%;width:100%;box-sizing:border-box;margin-top:5px;padding:5px 0 0;border-top:1px solid rgba(255,255,255,.12);border-bottom:0}

/* Editing surfaces match the centred karaoke and On Air projections. */
.tab-mode-section-block,.tab-mode-slide-block{text-align:center}
.tab-mode-karaoke-section-title{color:transparent}
.tab-mode-karaoke-band{left:0;right:0}
.tab-mode-karaoke-guide-line{left:10px;right:10px}
.tabedit-content-tabs .tab-mode-button.is-add{margin-left:auto;background:#173e50;border-color:#4eafcf;color:#e2f7ff;font-weight:700}
.tabedit-content-tabs .tab-mode-button.is-add:hover{background:#215c72}
.tabedit-workspace .tabedit-meta-group-version>.tabedit-meta-field{min-width:0;overflow:hidden;align-items:stretch}
.tabedit-workspace .tabedit-meta-group-version>.tabedit-meta-field>span{display:block;max-width:100%;white-space:normal!important;overflow-wrap:anywhere;font-size:.66rem;line-height:1.15;min-height:2.3em}
.tabedit-workspace .tabedit-meta-group-version>.tabedit-meta-field input{min-width:0;width:100%}
.tab-musician-content.is-lyrics-preview{text-align:center;white-space:pre-wrap;font-family:Roboto Mono,monospace;line-height:1.5}
.tab-musician-content.is-karaoke-preview{text-align:center;white-space:normal}
.tab-preview-karaoke-heading{margin:1.1em 0 .5em;padding:.25em;border-top:1px solid #637e90;border-bottom:1px solid #637e90;background:#202b34;font-weight:800}
.tab-preview-karaoke-block{min-height:9em;margin:0 0 .35em;padding:.6em;white-space:pre-wrap;background:rgba(255,255,255,.04);line-height:1.5}

/* Theme-driven controls and clean musician annotations. */
.tab-mode-karaoke-section-title{color:#f5f1e9;background:#202b34}
.tabedit-content-tabs .tab-mode-button.is-add{background:linear-gradient(135deg,var(--songbook-accent),var(--songbook-accent-strong));border-color:rgba(var(--songbook-accent-rgb),.7);color:var(--songbook-accent-contrast)}
.tabedit-content-tabs .tab-mode-button.is-add:hover{filter:brightness(1.08);background:linear-gradient(135deg,var(--songbook-accent),var(--songbook-accent-strong))}
.tab-mode-musician-note{border-left:0!important;padding-left:0!important}
.tab-mode-musician-note input,.tab-mode-musician-note input:focus{border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;padding:0!important}
.tab-mode-musician-note input::placeholder{color:transparent}
.tab-mode-context-menu{position:fixed;z-index:100000;min-width:180px;padding:5px;border:1px solid rgba(255,255,255,.19);border-radius:9px;background:#242428;box-shadow:0 14px 30px #0009}
.tab-mode-context-menu .tab-mode-button{display:block;width:100%;text-align:left;border:0;background:transparent;color:#f3c5c0}
.tab-mode-context-menu .tab-mode-button:hover{background:rgba(255,255,255,.08)}
.tab-mode-animation-menu{border-color:rgba(var(--songbook-accent-rgb),.45)}
body:not(.theme-accent-sunset) .tabedit-text-color span{text-decoration-color:var(--songbook-accent)}

/* Optional timing stays beside the cue, without becoming TAB text. */
.tab-mode-animation-controls{position:absolute;z-index:5;inset:0;overflow:hidden;pointer-events:none}
.tab-mode-animation-controls-inner{position:absolute;inset:0;pointer-events:none}
.tab-mode-duration-square{position:absolute;width:42px;min-width:42px;min-height:0;padding:0 2px;border:1px solid rgba(var(--songbook-accent-rgb),.6);border-radius:5px;background:#252527;color:var(--songbook-accent);font-size:.72rem;line-height:1;pointer-events:auto}
.tab-mode-duration-square:hover{background:rgba(var(--songbook-accent-rgb),.18)}
.tab-mode-duration-popover{position:fixed;z-index:100001;width:198px;padding:10px;border:1px solid rgba(var(--songbook-accent-rgb),.5);border-radius:9px;background:#252528;color:#fff;box-shadow:0 14px 30px #000a}
.tab-mode-duration-popover label{display:grid;gap:6px;font-size:.78rem}
.tab-mode-duration-popover input{width:100%;box-sizing:border-box;padding:5px;border:1px solid #6d6d72;border-radius:5px;background:#151519;color:#fff}
.tab-mode-duration-actions{display:flex;gap:5px;margin-top:8px}
.tab-mode-duration-actions button{flex:1;padding:5px;font-size:.7rem}

/* Shared, theme-aware editing controls. */
.tab-mode-animation-toolbar{flex-wrap:wrap;gap:8px;padding:8px;border:1px solid rgba(var(--songbook-accent-rgb),.18);border-radius:10px;background:rgba(255,255,255,.025)}
.tab-mode-animation-toolbar>.tab-mode-button,.tab-mode-block-size{min-height:34px;box-sizing:border-box}
.tab-mode-animation{cursor:pointer;border-color:rgba(var(--songbook-accent-rgb),.35);background:rgba(var(--songbook-accent-rgb),.09);color:var(--songbook-accent)}
.tab-mode-animation:hover{background:rgba(var(--songbook-accent-rgb),.16)}
.tab-mode-animation-menu{top:calc(100% + 4px);left:8px;padding:8px;background:#242220}
.tab-mode-block-size{gap:10px;padding:0 0 0 10px;border:1px solid rgba(255,255,255,.16);border-radius:8px;color:#e6e1d8;font-weight:500;font-size:.76rem}
.tab-mode-block-size select{height:32px;min-width:48px;padding:0 7px;border:0;border-left:1px solid rgba(255,255,255,.12);border-radius:0 7px 7px 0;background:#292724;color:var(--songbook-accent);font:inherit;font-weight:700;cursor:pointer}
.tab-mode-refresh{min-height:34px;border-color:rgba(var(--songbook-accent-rgb),.3);color:var(--songbook-accent);background:rgba(var(--songbook-accent-rgb),.055)}
.tab-mode-animation-toolbar>.tab-mode-refresh{margin-left:auto}
.tab-mode-button:focus-visible,.tab-mode-block-size select:focus-visible,.tab-mode-musician-meta input:focus-visible{outline:2px solid var(--songbook-accent);outline-offset:2px}
.tab-mode-karaoke-section-title,.tab-preview-karaoke-heading{background:color-mix(in srgb,var(--songbook-accent) 9%,#111114);border-color:rgba(var(--songbook-accent-rgb),.32);color:#f5f1e9}
.tab-mode-musician-source:focus-visible{outline-color:rgba(var(--songbook-accent-rgb),.6)}
.tab-mode-musician-meta input[type=text]{min-height:36px;box-sizing:border-box;background:#1c1b19;border-color:rgba(var(--songbook-accent-rgb),.28);font-size:.88rem}
.tab-mode-musician-meta input[type=color]{height:36px;width:42px;box-sizing:border-box}
@media(max-width:620px){.tab-mode-animation-toolbar>.tab-mode-refresh{margin-left:0}.tab-mode-animation-toolbar{gap:6px}.tab-mode-refresh{white-space:normal;text-align:left}}

/* Each musician version keeps its own saved transposition. */
.tab-mode-musician-transpose{display:inline-flex;flex:0 0 auto;align-items:center;gap:3px;padding:3px;border:1px solid rgba(var(--songbook-accent-rgb),.4);border-radius:9px;background:rgba(var(--songbook-accent-rgb),.06)}
.tab-mode-musician-transpose>.tab-mode-button{min-width:28px;min-height:28px;padding:2px 7px;border-radius:6px}
.tab-mode-musician-transpose .tab-mode-musician-transpose-value{display:flex;flex-direction:column;align-items:center;gap:1px;min-width:42px;border:0;background:transparent;padding:0 4px;line-height:1.1}
.tab-mode-musician-transpose-value strong{font-size:.78rem;color:#f4ecdd}.tab-mode-musician-transpose-value span{font-size:.65rem;color:var(--songbook-accent)}
.tab-mode-musician-source.is-chord-line pre{color:var(--songbook-accent)}
.tab-mode-musician-source pre .chord{color:inherit;font:inherit;background:none}
@media(max-width:480px){.tab-mode-musician-meta{flex-wrap:wrap}.tab-mode-musician-meta input[type=text]{flex-basis:calc(100% - 54px)}.tab-mode-musician-transpose{margin-left:auto}}

/* Inserting a musician note preserves the selected source line and viewport. */
.tab-mode-musician-body,.tab-mode-musician-body *{overflow-anchor:none}
/* Optional chord recognition stays on the normal editable TAB document. */
.tabedit-format-tools .tabedit-highlight-chords{width:auto;padding:0 8px;white-space:nowrap;font-size:.7rem}
.tabedit-highlight-chords.is-active{border-color:var(--songbook-accent);background:rgba(var(--songbook-accent-rgb),.13);color:var(--songbook-accent)}
.tabedit-chord-controls{display:inline-flex;align-items:center;gap:3px;padding:2px;border:1px solid rgba(var(--songbook-accent-rgb),.38);border-radius:7px;background:rgba(var(--songbook-accent-rgb),.05)}
.tabedit-chord-controls[hidden]{display:none!important}
.tabedit-chord-readout{display:flex;flex-direction:column;align-items:center;min-width:34px;line-height:1.05}
.tabedit-chord-key{font-size:.72rem}.tabedit-chord-offset{font-size:.6rem;color:var(--songbook-accent)}

.CodeMirror .tabedit-identified-chord-line{background:transparent!important}
.CodeMirror-gutter.tabedit-line-kind{width:20px}
.tabedit-line-kind-marker{display:block;text-align:center;color:#777;font:600 9px/1.6 monospace}
.tabedit-line-kind-marker.is-chord{color:var(--songbook-accent,#ffc000)}
@media(max-width:700px){.tabedit-format-tools{flex-wrap:wrap}}
.tabedit-format-tools .tabedit-highlight-chords[hidden]{display:none!important}

/* Reserve one slot for either the entry button or the complete transpose controls. */
.tabedit-format-tools .tabedit-chord-slot{display:inline-flex;flex:0 0 166px;width:166px;min-width:166px;align-items:center}
.tabedit-format-tools .tabedit-chord-slot[hidden]{display:none!important}
.tabedit-format-tools .tabedit-chord-slot>.tabedit-highlight-chords{width:100%;height:30px;box-sizing:border-box;white-space:nowrap;font-size:12px}
.tabedit-format-tools .tabedit-chord-controls{width:100%;height:30px;box-sizing:border-box;justify-content:space-between;flex-wrap:nowrap;gap:2px}
.tabedit-format-tools .tabedit-chord-controls button{flex:none;width:26px;height:24px;padding:0;font-size:14px}
.tabedit-format-tools .tabedit-chord-controls [data-chord-back]{width:52px;font-size:11px}
.tabedit-format-tools .tabedit-chord-readout{flex:none;width:32px}

.tabedit-leave-dialog{width:min(340px,calc(100vw - 40px));box-sizing:border-box;padding:24px;border:1px solid #665631;border-radius:16px;background:#202020;color:#eee;box-shadow:0 16px 60px #0008}
.tabedit-leave-dialog::backdrop{background:#0009}
.tabedit-leave-dialog h2{margin:0 0 10px;font-size:20px}
.tabedit-leave-dialog p{font-size:14px}
.tabedit-leave-actions{display:flex;flex-direction:column;gap:10px;margin-top:20px}
.tabedit-leave-actions button{width:100%;min-height:42px;border:1px solid #665631;border-radius:9px;background:#2b2924;color:#f2c875;font:inherit;cursor:pointer}
.tabedit-leave-actions [data-leave-save]{background:var(--songbook-accent,#ffb000);color:#17130a;font-weight:700}
.tabedit-leave-actions button:disabled{opacity:.6;cursor:wait}
.tabedit-leave-actions button:focus-visible{outline:2px solid #ffc000;outline-offset:3px}
.tabedit-leave-status:empty{display:none}

/* Keep search, replacement and chord tools in a single compact row. */
.tabedit-workspace .tabedit-search-card{flex-wrap:nowrap;gap:6px}
.tabedit-workspace .tabedit-search-card .tabedit-search-input{box-sizing:border-box;flex:1 1 140px;width:140px;max-width:160px;min-width:0;height:30px;min-height:30px}
.tabedit-workspace .tabedit-search-card .tabedit-replace-all{display:inline-flex;align-items:center;justify-content:center;flex:0 0 32px;width:32px;min-width:32px;height:30px;min-height:30px;padding:0;color:var(--songbook-accent,#ffb000)}
.tabedit-workspace .tabedit-format-tools{flex:0 0 auto;flex-wrap:nowrap;margin-left:auto;gap:4px}
.tabedit-workspace .tabedit-format-tools>button,.tabedit-workspace .tabedit-format-tools>.tabedit-text-color{flex:0 0 28px;min-width:28px;max-width:28px;width:28px;height:30px;margin:0;padding:0}
.tabedit-replace-all svg{display:block;flex:none}
.tabedit-workspace .tabedit-search-card .tabedit-search-input,.tabedit-workspace .tabedit-search-card .tabedit-replace-all{margin:0}


/* The global reset removes the native dialog's auto margins: restore centering explicitly. */
dialog.tabedit-leave-dialog{position:fixed;inset:0;margin:auto!important;width:min(340px,calc(100vw - 32px));height:fit-content;max-height:calc(100dvh - 32px);overflow:auto;padding:24px;isolation:isolate;opacity:1;background:#202020!important;background-image:none!important;color:#eee;font:14px/1.45 Arial,sans-serif;text-align:left;z-index:2147483647}
dialog.tabedit-leave-dialog::backdrop{background:rgba(0,0,0,.7)}
dialog.tabedit-leave-dialog h2{margin:0 0 10px;padding:0;font:700 20px/1.3 Arial,sans-serif;color:#fff}
dialog.tabedit-leave-dialog p{margin:0;padding:0;color:#d4d4d4;font:14px/1.45 Arial,sans-serif}
dialog.tabedit-leave-dialog .tabedit-leave-actions{margin:20px 0 0;padding:0;gap:10px}
dialog.tabedit-leave-dialog .tabedit-leave-actions button{display:block;position:static;box-sizing:border-box;margin:0;padding:10px 12px;min-width:0;width:100%;height:auto;min-height:42px;font:600 14px/1.4 Arial,sans-serif;white-space:normal;opacity:1}
dialog.tabedit-leave-dialog .tabedit-leave-status:not(:empty){margin-top:12px}



/* Only opt-in overrides affect reading and editing; default .chord rules stay intact. */
body.chord-style-custom .chord{color:var(--user-chord-text)!important;font-weight:var(--user-chord-weight)!important;background:var(--user-chord-background)!important;box-shadow:var(--user-chord-glow)!important}
body.chord-style-custom .chord::before,body.chord-style-custom .chord::after{background:var(--user-chord-background)!important}
#account-chord-style .chord-style-toggle{display:flex;align-items:center;gap:8px;margin:12px 0}
#account-chord-style .chord-style-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:12px 0}
#account-chord-style .chord-style-fields label{display:flex;align-items:center;gap:8px;font-size:14px}
#account-chord-style input[type=color]{width:40px;height:30px;margin:0;padding:2px;border:1px solid #666;border-radius:6px;background:#222}
#account-chord-style input[type=checkbox]{width:16px;height:16px;margin:0}
#account-chord-style input[type=range]{width:110px;margin:0}
#account-chord-style .chord-style-preview{padding:18px;margin:12px 0;background:#151515;border:1px solid #444;border-radius:8px;font-family:Roboto Mono,monospace;word-spacing:12px}

.tabedit-notes-toolbar{display:flex;align-items:center;gap:5px;margin:0 0 5px;padding:0}
.tabedit-notes-toolbar button{width:27px;height:25px;min-width:27px;min-height:25px;padding:0;margin:0;border:1px solid #ffffff25;border-radius:5px;background:#292929;color:var(--songbook-accent,#ffb000);font-size:13px}
.tabedit-notes-toolbar span{min-width:22px;text-align:center;font-size:11px}
.tabedit-notes-toolbar input[type=color]{width:27px;height:25px;padding:2px;margin:0;border:1px solid #ffffff25;background:#292929;border-radius:5px}
.tabedit-workspace .CodeMirror.tabedit-notes-editor{height:100px;min-height:75px;max-height:180px;border:1px solid #ffffff25;border-radius:8px}
.tabedit-workspace .tabedit-format-tools .tabedit-chord-slot{width:126px!important;min-width:126px!important;flex-basis:126px!important}
.tabedit-workspace .tabedit-format-tools .tabedit-chord-controls [data-chord-back]{width:24px!important}
.tabedit-workspace .tabedit-format-tools .tabedit-number-tools{display:inline-flex;margin:0;flex:0 0 auto}
.tabedit-workspace .tabedit-format-tools .tab-number-transpose{height:30px;box-sizing:border-box}
.tabedit-workspace .tabedit-format-tools .tabedit-chord-slot{width:166px!important;min-width:166px!important;flex-basis:166px!important}
.tabedit-workspace .tabedit-format-tools .tabedit-chord-controls [data-chord-back]{width:52px!important}
.tabedit-workspace .tabedit-format-tools .tabedit-chord-readout{display:flex;flex-direction:column;width:32px!important;cursor:pointer;gap:0}

.tabedit-workspace .tabedit-format-tools .tabedit-chord-slot {width:max-content!important;min-width:0!important;flex:0 0 auto!important;height:31px!important;}
.tabedit-workspace .tabedit-format-tools .tabedit-chord-controls {width:max-content!important;justify-content:flex-start!important;}

.tabedit-workspace .tabedit-format-tools .tabedit-chord-controls .tabedit-chord-readout {width:36px!important;min-width:36px!important;flex:0 0 36px!important;}
.tabedit-workspace .tabedit-format-tools .songbook-transpose-box > button:not(.transpose-mode-button):not(.tabedit-chord-readout) {width:28px!important;min-width:28px!important;max-width:28px!important;flex:0 0 28px!important;height:25px!important;min-height:25px!important;font:16px/1 Arial,sans-serif!important;}
