:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #0d0e10;
  --panel: #15171a;
  --panel-raised: #1b1e22;
  --line: #2a2d32;
  --muted: #8d929b;
  --text: #f2f0eb;
  --accent: #d7a44a;
  --accent-soft: #5c4520;
  --active: #69b59b;
  --paper: #f5f0e6;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; min-height: 0; margin: 0; overflow: hidden; background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, input, select { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }

/* iPadOS/WebKit may expose its blue native focus ring after a programmatic
   focus() even when the screen was opened by touch. Touch interaction stays
   visually clean; real keyboard navigation receives a Band-IT focus marker. */
:where(button, [role="button"], a[href], summary):focus {
  outline: none;
}
html.keyboard-navigation :where(button, [role="button"], a[href], summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/*
  A Capacitor WebView has a smaller usable viewport than the physical display
  when Android's status/navigation bars are visible. 100dvh may still resolve
  to the physical screen height on older Android WebViews, which pushed the
  library footer under the system navigation bar. Percentage height follows
  the WebView's real content area instead.
*/
.app { display: flex; width: 100%; height: 100%; min-height: 0; background: var(--bg); }
.app.panel-right { flex-direction: row-reverse; }

.library {
  width: clamp(350px, 31vw, 450px);
  min-width: 350px;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto;
  background: linear-gradient(180deg, #181a1e 0%, #121417 100%);
  border-right: 1px solid var(--line);
  position: relative;
  z-index: 10;
  height: 100%;
  min-height: 0;
}
.panel-right .library { border-right: 0; border-left: 1px solid var(--line); }

.brand-row { height: 78px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 45px; height: 45px; position: relative; display: grid; place-items: center; border: 1px solid #765d30; border-radius: 12px; background: linear-gradient(145deg, #392c18, #1b1c1f); box-shadow: inset 0 0 18px #d7a44a18; }
.brand-mark span { font-size: 25px; font-weight: 800; color: var(--accent); transform: translateX(-4px); }
.brand-mark i { position: absolute; font-size: 8px; letter-spacing: .5px; right: 5px; bottom: 6px; color: #f7e0b5; font-style: normal; font-weight: 800; }
.brand-row h1 { margin: 0; font-size: 22px; letter-spacing: .4px; }
.brand-row p { margin: 2px 0 0; color: var(--muted); font-size: 11px; letter-spacing: .65px; text-transform: uppercase; }
.brand-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.library-scrim { display: none; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #202329; font-size: 20px; cursor: pointer; }
.icon-button[aria-pressed="true"] { border-color: #765d30; background: #392d1b; color: #f0ca7b; }
.icon-button:disabled { opacity: .4; cursor: not-allowed; }
.icon-button:active { transform: scale(.96); }

.view-tabs { display: grid; grid-template-columns: repeat(3, 1fr) 45px 45px; gap: 4px; padding: 10px 12px 8px; }
.tab { height: 35px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.tab.active { color: #1b160d; background: var(--accent); box-shadow: 0 4px 16px #d7a44a20; }
.icon-tab { display: grid; place-items: center; padding: 0; font-size: 16px; line-height: 0; }
.tab-icon-svg { width: 18px; height: 18px; display: block; margin: auto; }
.favorite-icon { fill: currentColor; stroke: none; }
.recent-icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.search-box { margin: 0 12px 9px; height: 42px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: #101215; padding: 0 11px; color: var(--muted); }
.search-box:focus-within { border-color: #8d6b32; box-shadow: 0 0 0 2px #d7a44a12; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box kbd { min-width: 25px; padding: 3px 6px; border: 1px solid #34373d; border-radius: 6px; background: #23262b; color: var(--muted); text-align: center; font-size: 10px; }
.search-clear { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #d8d4cc; font-size: 17px; cursor: pointer; }
.search-clear:disabled { opacity: .24; cursor: default; }
.search-clear:not(:disabled):active { background: #302719; color: #f0c979; }

.list-caption { height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .7px; }
.caption-title { min-width: 0; display: flex; align-items: center; gap: 7px; }
.caption-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caption-back { width: 25px; height: 25px; display: grid; place-items: center; padding: 0 0 2px; border: 1px solid #454950; border-radius: 7px; background: #22252a; color: #e1ddd5; font-size: 21px; cursor: pointer; }
.caption-back[hidden] { display: none; }
.text-button { border: 0; background: transparent; color: var(--accent); font-size: 11px; cursor: pointer; }
.caption-actions { display: flex; align-items: center; gap: 5px; }
.caption-tool-button, .quick-tool-button {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #3a3e44;
  border-radius: 7px;
  background: #202329;
  color: #b7b3ab;
  cursor: pointer;
}
.caption-tool-button svg, .quick-tool-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.caption-tool-button.active, .quick-tool-button.active { border-color: #8b692f; background: #3b2f1b; color: #efc979; box-shadow: 0 0 0 1px #d7a44a18; }
.caption-tool-button[hidden], .quick-tool-button[hidden] { display: none; }
.song-list { min-height: 0; overflow-y: auto; padding: 0 8px 8px; scrollbar-color: #45484d transparent; }
.song-list.momentum-cancelled,
.quick-song-list.momentum-cancelled {
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: auto !important;
  touch-action: none !important;
}
.landscape-quick-keyboard { display: none; }
.app.search-keyboard-open .landscape-quick-keyboard {
  min-height: 168px;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 8px;
  border-top: 1px solid #2d3035;
  background: #141619;
}
.app.search-keyboard-open .landscape-quick-search { display: none; }
.landscape-quick-search { min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; }
.landscape-quick-search strong { min-width: 0; flex: 1; overflow: hidden; color: #e5e1d9; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.landscape-quick-search strong.empty { color: #70747b; }
.landscape-quick-keyboard .quick-keyboard { min-height: 0; display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 4px; }
.landscape-quick-keyboard .quick-keyboard.has-diacritics { grid-template-rows: repeat(5, minmax(0, 1fr)); }
.landscape-quick-keyboard .quick-keyboard.search-number-layout { grid-template-rows: repeat(3, minmax(0, 1fr)); }
.landscape-quick-keyboard .quick-key-row { min-height: 0; display: grid; gap: 3px; }
.landscape-quick-keyboard .quick-key-row-10 { grid-template-columns: repeat(10, 1fr); }
.landscape-quick-keyboard .quick-key-row-9 { grid-template-columns: repeat(9, 1fr); padding: 0 3%; }
.landscape-quick-keyboard .quick-key-row-7 { grid-template-columns: repeat(7, 1fr); padding: 0 10%; }
.landscape-quick-keyboard .quick-key-actions { grid-template-columns: repeat(3, 1fr); }
.landscape-quick-keyboard .search-letter-actions { grid-template-columns: .68fr .68fr 1.4fr 1fr 1fr .82fr; }
.landscape-quick-keyboard .search-symbol-actions { grid-template-columns: .72fr 1.4fr 1fr 1fr .82fr; }
.landscape-quick-keyboard .quick-key-row button { min-width: 0; min-height: 0; padding: 0; border: 1px solid #41464d; border-radius: 5px; background: linear-gradient(180deg, #2a2e34, #202328); color: #f0ece4; font-size: 8px; font-weight: 750; box-shadow: 0 1px 0 #090a0c; touch-action: manipulation; }
.landscape-quick-keyboard .quick-key-actions button { font-size: 7px; }
.landscape-quick-keyboard .quick-key-row button:active { transform: translateY(1px); background: #3b311f; color: #f2cb79; }
.quick-keyboard .quick-key-row button.active { border-color: #b88a3c; background: #4b391d; color: #ffd686; box-shadow: inset 0 0 0 1px #d7a44a55; }
.quick-keyboard .quick-key-row button.caps-lock { box-shadow: inset 0 0 0 2px #e3b25299, 0 0 8px #d7a44a33; }
.quick-keyboard .editor-diacritic-row { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 18%; }
.quick-keyboard .editor-diacritic-row button { border-color: #80632f; background: linear-gradient(180deg, #4b3a20, #332817); color: #f6ce7c; }

.playlist-root { display: grid; gap: 7px; }
.playlist-card { min-height: 76px; display: grid; grid-template-columns: 43px minmax(0, 1fr) 38px 43px; align-items: center; gap: 7px; padding: 9px; border: 1px solid #30343a; border-radius: 11px; background: linear-gradient(135deg, #202329, #181b1f); }
@media (hover: hover) and (pointer: fine) {
  .playlist-card:hover { border-color: #5b4a2c; background: linear-gradient(135deg, #25241f, #1a1c20); }
}
.playlist-symbol { width: 43px; height: 43px; display: grid; place-items: center; padding: 0; border: 1px solid #72582c; border-radius: 10px; background: #392e1d; color: #efc776; font-size: 18px; font-weight: 800; }
.playlist-drag-handle { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.playlist-drag-handle:active { cursor: grabbing; background: #4a3a22; border-color: #a77d39; color: #ffe0a0; }
.playlist-root.reordering { -webkit-user-select: none; user-select: none; }
.playlist-card.dragging { position: relative; z-index: 2; opacity: .72; border-color: #b4873f; background: linear-gradient(135deg, #3a2e1c, #1c1d20); box-shadow: 0 8px 24px #0008; transform: scale(.985); }
.playlist-card-info { min-width: 0; }
.playlist-card-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.playlist-card-info small { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.playlist-card .row-button { width: 100%; padding: 0; }
.playlist-edit-button { font-size: 14px; color: #c6c2ba; }
.empty-collection { margin: 12px 2px; padding: 22px 16px; border: 1px dashed #3a3d43; border-radius: 12px; text-align: center; color: var(--muted); }
.empty-collection strong { display: block; margin-bottom: 5px; color: #d8d4cb; font-size: 13px; }
.empty-collection small { font-size: 10px; line-height: 1.45; }

.song-row { min-height: 62px; display: grid; grid-template-columns: minmax(0, 1fr) 39px 44px; align-items: center; gap: 6px; margin: 3px 0; padding: 7px 8px 7px 12px; border: 1px solid transparent; border-radius: 10px; background: #1a1d21; transition: .15s ease; }
.song-row:hover { background: #202328; border-color: #30343a; }
.song-row.active { border-color: #356657; background: linear-gradient(90deg, #193128, #1a1d21 70%); }
.song-row.previewing { border-color: #8d6b32; background: linear-gradient(90deg, #3a2d18, #1a1d21 70%); }
.song-info { min-width: 0; }
.song-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 720; }
.song-subtitle { display: flex; gap: 6px; align-items: center; margin-top: 4px; color: var(--muted); font-size: 10px; overflow: hidden; white-space: nowrap; }
.song-subtitle span:first-child { overflow: hidden; text-overflow: ellipsis; }
.song-list.compact-list .song-row { min-height: 48px; padding-top: 4px; padding-bottom: 4px; }
.song-list.compact-list .song-subtitle { display: none; }
.song-list.compact-list .song-title { font-size: 13px; }
.tiny-pill { padding: 2px 5px; border: 1px solid #383b41; border-radius: 5px; color: #c4c0b8; }
.row-button { height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid #373a40; border-radius: 9px; background: #25282d; cursor: pointer; font-size: 17px; line-height: 1; touch-action: none; }
.row-button-icon { width: 19px; height: 19px; display: block; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.row-button-icon .icon-fill { fill: currentColor; stroke: none; }
.row-button.preview { color: #e9c782; }
.row-button.load { background: #3d311d; border-color: #735829; color: #f6d99f; }
.row-button:active { transform: scale(.94); filter: brightness(1.15); }

.library-footer { min-height: 58px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: #111316; }
.footer-button { border: 0; border-right: 1px solid #23262a; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.footer-button span { display: block; color: #cbc7be; font-size: 17px; margin-bottom: 3px; }
#settingsButton > span, #quickSettingsButton > span { font-size: 14px; }
.footer-button.active { color: #f0cb82; background: #332918; }
.footer-button.active span { color: #f0cb82; }

.stage { min-width: 0; min-height: 0; height: 100%; flex: 1; display: grid; grid-template-rows: 67px minmax(0, 1fr); position: relative; background: radial-gradient(circle at 50% 35%, #282b30 0%, #121417 72%); }
.stage-header { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 0 18px; border-bottom: 1px solid var(--line); background: #121417e8; backdrop-filter: blur(12px); z-index: 4; }
.current-meta { display: flex; align-items: center; min-width: 0; }
.current-meta div { min-width: 0; }
.current-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--active); font-size: 17px; }
.musical-meta { display: flex; justify-content: center; align-items: center; gap: 8px; color: #c0bdb6; font-size: 12px; white-space: nowrap; overflow: hidden; }
.musical-meta > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.meta-pill { padding: 4px 7px; border: 1px solid #373a40; border-radius: 7px; background: #1c1f23; color: #ded8cd; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.portrait-left-actions, .portrait-right-actions { display: contents; }
.header-button { width: 82px; height: 36px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: #202328; color: #bbb8b1; font-size: 11px; cursor: pointer; }
.header-button[aria-pressed="true"] { border-color: #6a532b; color: #f1d294; background: #312719; }
.lock-icon { width: 18px; height: 18px; display: grid; place-items: center; }
.lock-icon svg { width: 15px; height: 15px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.view-mode-switch { height: 36px; display: flex; gap: 7px; }
.view-mode-button { width: 82px; height: 36px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: #202328; color: var(--muted); cursor: pointer; }
.view-mode-button span { font-size: 15px; line-height: 1; }
.view-mode-button .page-icon-portrait { display: none; }
.direction-icon { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.direction-icon-vertical { transform: rotate(90deg); }
.view-mode-button b { font-size: 9px; font-weight: 750; }
.view-mode-button.active { background: #3b2f1c; color: #f1cf8c; box-shadow: inset 0 0 0 1px #745a2c; }
button.drawer-close, button.library-drawer-button { display: none; }
.portrait-quick-list { display: none; }
.quick-header-views, .quick-header-action { display: none; }
.portrait-view-toggle { display: none; }
.quick-header-favorite svg { width: 15px; height: 15px; display: block; fill: currentColor; }
.library-drawer-button svg { width: 17px; height: 17px; display: block; fill: currentColor; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.score-editor { min-height: 0; grid-row: 2; overflow: hidden; padding: 16px; background: radial-gradient(circle at 50% 15%, #2c2923 0%, #121417 66%); }
.score-editor[hidden] { display: none; }
.score-editor-shell { width: min(1080px, 100%); height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); margin: 0 auto; overflow: hidden; border: 1px solid #393d43; border-radius: 16px; background: linear-gradient(180deg, #1b1e22, #15171a); box-shadow: 0 20px 55px #0009; }
.stage.editing .score-editor { width: 100%; min-width: 0; }
.stage.editing .score-editor-shell { width: 100%; max-width: none; }
.stage.editing .viewer-shell,
.stage.editing .page-status { display: none !important; }
.score-editor-header { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; border-bottom: 1px solid #30343a; background: #202329; }
.score-editor-header small, .metadata-section-heading small, .metadata-playlists small, .metadata-file-info small { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.score-editor-header h2 { margin: 3px 0 0; font-size: 20px; }
.score-editor-header p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.score-editor-close { flex: 0 0 auto; }
.score-editor-header-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.metadata-header-save { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 1px solid #80612e; border-radius: 10px; background: #3b301d; color: #f1cb7f; cursor: pointer; }
.metadata-header-save svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.metadata-header-save:active { transform: scale(.96); background: #d7a44a; color: #19140c; }
.score-editor-content { min-height: 0; display: grid; grid-template-columns: minmax(230px, 1.02fr) minmax(420px, 1.6fr); gap: 14px; padding: 14px; overflow: hidden; }
.metadata-preview-card { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; border: 1px solid #34383e; border-radius: 12px; background: #111316; }
.metadata-preview { min-height: 0; display: grid; place-items: center; overflow: hidden; padding: 12px; background: radial-gradient(circle, #282b30, #121417 72%); }
.metadata-preview img { max-width: 100%; max-height: 100%; display: block; margin: auto; align-self: center; justify-self: center; object-fit: contain; border-radius: 2px; box-shadow: 0 12px 28px #000a; }
.metadata-preview iframe { width: 100%; height: 100%; border: 0; border-radius: 3px; background: #fff; }
.metadata-pdf-preview { max-width: 100%; max-height: 100%; display: block; margin: auto; align-self: center; justify-self: center; }
.metadata-pdf-placeholder { width: min(180px, 75%); aspect-ratio: 210 / 297; display: grid; place-items: center; border-radius: 4px; background: #f4efe5; color: #2b2925; box-shadow: 0 14px 30px #000a; font-size: 24px; font-weight: 850; }
.metadata-file-info { padding: 12px; border-top: 1px solid #30343a; }
.metadata-file-name-control { height: 34px; display: flex; align-items: center; min-width: 0; margin-top: 7px; overflow: hidden; border: 1px solid #393d43; border-radius: 8px; background: #22252a; }
.metadata-file-name-control:focus-within { border-color: #89682f; box-shadow: 0 0 0 2px #d7a44a10; }
.metadata-file-name-control input { min-width: 0; flex: 1; height: 100%; padding: 0 4px 0 9px; border: 0; outline: 0; background: transparent; color: #efebe3; font-size: 9px; }
.metadata-file-name-control span { flex: 0 0 auto; margin: 0; padding: 0 9px 0 5px; color: #d6b46f; font-size: 9px; font-weight: 750; }
.metadata-file-info > span { display: block; margin-top: 6px; color: var(--muted); font-size: 8px; }
.metadata-form { min-height: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 2px 4px 2px 0; scrollbar-color: #4a4e54 transparent; }
.metadata-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 2px 2px 11px; }
.metadata-section-heading h3, .metadata-playlists h3 { margin: 3px 0 0; font-size: 15px; }
.edit-status { padding: 5px 8px; border: 1px solid #3e4248; border-radius: 99px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.edit-status.dirty { border-color: #7f612e; background: #302617; color: #e9bf70; }
.edit-status.saved { border-color: #386b5b; background: #172b24; color: #7dc3aa; }
.metadata-fields { display: grid; grid-template-columns: minmax(0, 1fr) 92px 108px 116px; gap: 9px; }
.metadata-field { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .45px; text-transform: uppercase; }
.metadata-field.title-field { grid-column: 1 / -1; }
.metadata-field input, .metadata-field select { width: 100%; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid #393d43; border-radius: 8px; outline: 0; background: #22252a; color: #efebe3; font-size: 10px; }
.metadata-field input:focus, .metadata-field select:focus { border-color: #89682f; box-shadow: 0 0 0 2px #d7a44a10; }
.metadata-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.metadata-check { min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #34383e; border-radius: 10px; background: #1c1f23; cursor: pointer; }
.metadata-check input, .metadata-playlist-option input { width: 17px; height: 17px; flex: 0 0 auto; accent-color: #d7a44a; }
.metadata-check strong { display: block; font-size: 10px; }
.metadata-check small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.35; }
.metadata-playlists { margin-top: 12px; padding: 12px; border: 1px solid #34383e; border-radius: 11px; background: #191c20; }
.metadata-playlist-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.metadata-playlist-option { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid #33373d; border-radius: 8px; background: #202329; color: #d2cec6; font-size: 9px; cursor: pointer; }
.metadata-playlist-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metadata-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; padding-top: 14px; }
.viewer-shell { min-height: 0; grid-row: 2; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 14px 54px; }
.viewer-shell[hidden], .page-status[hidden] { display: none; }
.stage.editing .header-actions { opacity: .38; pointer-events: none; }
.viewer-shell.width-mode { display: block; overflow-x: hidden; overflow-y: auto; padding: 16px 54px 72px; overscroll-behavior: contain; scroll-snap-type:y proximity; scrollbar-color: #575a60 transparent; }
.paper-wrap { height: 100%; max-width: 100%; aspect-ratio: 210 / 297; display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 18px 30px #0008); touch-action: pan-y; }
.paper { width: 100%; height: 100%; display: flex; overflow: hidden; background: #fff; color: #171717; border-radius: 3px; }
.paper img { width: 100%; height: 100%; display: block; object-fit: contain; background: #fff; user-select: none; pointer-events: none; }
.paper .imported-pdf-page { max-width: 100%; max-height: 100%; display: block; margin: auto; background: #fff; }
.pdf-loading { width: 100%; height: 100%; display: grid; place-items: center; background: #fff; color: #6e685f; font-size: 12px; font-weight: 700; }
.paper .missing-import { width: 100%; height: 100%; display: grid; place-items: center; padding: 30px; background: #f5f0e6; color: #2d2a25; text-align: center; }
.missing-import strong { display: block; margin-bottom: 8px; font-size: 18px; }
.missing-import small { color: #6e685f; line-height: 1.45; }
.width-mode .paper-wrap { width: 100%; height: auto; max-width: none; aspect-ratio: auto; display: block; filter: none; touch-action: pan-y; }
.width-mode .paper { height: auto; display: block; overflow: visible; background: transparent; border-radius: 0; }
.width-mode .paper .imported-pdf-canvas { height: auto; }
.continuous-pages { width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 18px; }
.continuous-page { width: 100%; height: auto; display: block; scroll-snap-align:start; scroll-snap-stop:normal; border-radius: 3px; background: #fff; box-shadow: 0 18px 34px #0009; }
.page-zone { position: absolute; top: 0; bottom: 0; width: 50px; border: 0; background: transparent; color: #a8a59f; font-size: 48px; cursor: pointer; opacity: .55; z-index: 2; }
.page-zone:hover { opacity: 1; background: linear-gradient(90deg, #0000, #ffffff08); }
.page-zone.left { left: 0; }
.page-zone.right { right: 0; }
.page-zone:disabled { opacity: .08; cursor: default; }
.width-mode .page-zone { display: none; }
.locked-indicator { display: none; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); padding: 7px 11px; border: 1px solid #547b6e; border-radius: 99px; background: #16241fe8; color: #8ac9b3; font-size: 9px; font-weight: 800; letter-spacing: .8px; }
.locked-indicator span { font-size: 7px; }
.locked .locked-indicator { display: block; }
.locked .library { opacity: .35; pointer-events: none; filter: saturate(.35); }

.page-status { min-width: 90px; text-align: center; color: var(--muted); font-size: 10px; }
.floating-page-status { position: absolute; left: 50%; bottom: 12px; z-index: 6; transform: translateX(-50%); min-width: 74px; padding: 7px 10px; border: 1px solid #383b40; border-radius: 10px; background: #15171ae8; box-shadow: 0 7px 20px #0008; backdrop-filter: blur(9px); pointer-events: none; }
.page-status-center { min-width: 54px; }
.preview-return { display: none; height: 36px; align-items: center; justify-content: center; gap: 6px; padding: 0 11px; border: 1px solid #3b3f45; border-radius: 8px; background: #24272c; color: #d7d3cb; cursor: pointer; }
.preview-return b { font-size: 10px; }
.preview-return-active { border-color: #396858; color: #82cbb2; background: #182b25; }
.preview-return-active span { font-size: 8px; }
.preview-return-list { border-color: #725729; color: #efc979; background: #352a1a; }
.preview-return-list svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.page-dots { display: flex; justify-content: center; gap: 5px; margin-bottom: 5px; }
.page-dot { width: 5px; height: 5px; border-radius: 99px; background: #4a4d52; }
.page-dot.active { width: 14px; background: var(--accent); }

.workspace-backdrop { position: fixed; inset: 0; z-index: 36; display: grid; place-items: center; padding: 18px; background: #050607dc; backdrop-filter: blur(10px); }
.workspace-backdrop[hidden] { display: none; }
.workspace-card { width: min(1180px, 100%); height: min(820px, calc(100dvh - 36px)); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid #3b3f45; border-radius: 18px; background: linear-gradient(180deg, #191c20, #121417); box-shadow: 0 30px 90px #000e; }
.workspace-header { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 20px; border-bottom: 1px solid var(--line); background: #1c1f23; }
.workspace-header small, .section-heading small, .column-heading small, .import-success > small { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.workspace-header h2 { margin: 2px 0 0; font-size: 23px; }
.workspace-header p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.workspace-body { min-height: 0; overflow-y: auto; padding: 18px 20px 20px; scrollbar-color: #4a4e54 transparent; }
.workspace-steps { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; color: #666b73; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .6px; }
.workspace-steps li { display: flex; align-items: center; gap: 7px; }
.workspace-steps li:not(:last-child)::after { content: ""; width: 40px; height: 1px; margin-left: 3px; background: #383c42; }
.workspace-steps span { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #3c4046; border-radius: 50%; background: #22252a; font-size: 9px; }
.workspace-steps li.active { color: #e7d1a4; }
.workspace-steps li.active span { border-color: #87672f; background: #3f311b; color: #f1cc7b; }
.workspace-steps li.complete span { border-color: #39705e; background: #193127; color: #80c9af; }
.section-heading { min-height: 46px; display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.section-heading.compact { min-height: 34px; margin-bottom: 8px; }
.section-heading h3, .column-heading h3 { margin: 3px 0 0; font-size: 16px; }
.storage-badge { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid #315d50; border-radius: 99px; background: #172720; color: #82c4ae; font-size: 9px; }
.storage-badge i { width: 6px; height: 6px; border-radius: 50%; background: #70bba2; }
.import-source-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.source-card { min-height: 145px; position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; padding: 16px; border: 1px solid #35393f; border-radius: 13px; background: linear-gradient(145deg, #22252a, #191c20); text-align: left; cursor: pointer; }
.source-card:hover { border-color: #80622f; transform: translateY(-1px); }
.source-card.primary { border-color: #80622f; background: linear-gradient(145deg, #3a2d19, #211d17); }
.source-icon { width: 38px; height: 38px; position: absolute; top: 15px; left: 15px; display: grid; place-items: center; border: 1px solid #5d626a; border-radius: 10px; background: #292d33; color: #ddd9d1; font-size: 22px; }
.source-card.primary .source-icon { border-color: #906d31; background: #4c381a; color: #f1c872; }
.source-card strong { font-size: 12px; }
.source-card small { margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.source-count { min-width: 23px; height: 23px; position: absolute; top: 14px; right: 14px; display: grid; place-items: center; border-radius: 99px; background: #2b2e33; color: #878b92; font-size: 9px; }
.import-history { margin-top: 24px; }
.history-list { display: grid; gap: 7px; }
.empty-inline, .history-row { min-height: 62px; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid #30343a; border-radius: 11px; background: #191c20; }
.empty-inline > span, .history-row > span { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #1b3028; color: #77c0a6; }
.empty-inline strong, .history-row strong { display: block; font-size: 11px; }
.empty-inline small, .history-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.bulk-playlist-field { display: grid; gap: 5px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .5px; }
.bulk-assignments { display: flex; align-items: end; gap: 10px; }
.bulk-playlist-field select,
.bulk-playlist-field input { min-width: 200px; height: 34px; padding: 0 9px; border: 1px solid #3a3e44; border-radius: 8px; outline: 0; background: #202329; color: #e1ddd5; font-size: 10px; }
.bulk-new-playlist-field[hidden] { display: none; }
.bulk-set-field { height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #3a3e44; border-radius: 8px; background: #202329; color: #c9c5bd; font-size: 9px; white-space: nowrap; }
.bulk-set-field input { accent-color: #d7a44a; }
.review-toolbar { height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 4px; color: var(--muted); font-size: 10px; }
.import-review-list { display: grid; gap: 8px; overflow-x: auto; }
.import-review-row { min-width: 1380px; display: grid; grid-template-columns: 28px 64px minmax(150px, 1.35fr) minmax(140px, 1fr) 92px 105px 105px 72px minmax(120px, .8fr) minmax(150px, 1fr); align-items: center; gap: 9px; padding: 10px; border: 1px solid #33373d; border-radius: 11px; background: #1a1d21; }
.import-review-row.duplicate { border-color: #76582a; background: #241f18; }
.import-check { width: 19px; height: 19px; accent-color: #d7a44a; }
.file-preview-tile { width: 58px; height: 58px; display: grid; place-items: center; overflow: hidden; border: 1px solid #3d4147; border-radius: 8px; background: #262a30; color: #d5b66f; font-size: 10px; font-weight: 800; }
.file-preview-tile img { width: 100%; height: 100%; object-fit: cover; }
.review-field { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .4px; }
.review-field input, .review-field select, .review-key-picker { width: 100%; min-width: 0; height: 32px; padding: 0 8px; border: 1px solid #393d43; border-radius: 7px; outline: 0; background: #22252a; color: #ece8e0; font-size: 10px; }
.review-field input:focus, .review-field select:focus { border-color: #89682f; }
.file-state { display: grid; gap: 4px; min-width: 0; }
.file-state strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.file-state small { color: #78bda6; font-size: 8px; }
.duplicate .file-state small { color: #e3b862; }
.workspace-footer { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #2d3035; }
.primary-action, .secondary-action, .danger-action { height: 40px; padding: 0 16px; border-radius: 9px; font-size: 10px; font-weight: 800; cursor: pointer; }
.primary-action { border: 1px solid #8d6a2f; background: #d7a44a; color: #1c160c; }
.secondary-action { border: 1px solid #40444a; background: #24272c; color: #d8d4cc; }
.danger-action { border: 1px solid #6e3e3a; background: #2b1d1d; color: #d8958e; }
.danger-action[hidden] { display: none; }
.import-success { min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.success-mark { width: 68px; height: 68px; display: grid; place-items: center; margin-bottom: 18px; border: 1px solid #427965; border-radius: 50%; background: #193328; color: #7bc6aa; box-shadow: 0 0 40px #69b59b20; font-size: 31px; }
.import-success h3 { margin: 8px 0 0; font-size: 22px; }
.import-success p { max-width: 520px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.success-actions { display: flex; gap: 8px; margin-top: 22px; }

.playlist-editor-body { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.playlist-workspace.bandit-keyboard-open { grid-template-rows: auto minmax(0, 1fr) 168px; }
.playlist-bandit-keyboard { min-height: 168px; display: grid; grid-template-rows: 28px minmax(0, 1fr); padding: 5px 12px 8px; border-top: 1px solid #2d3035; background: #141619; }
.playlist-bandit-keyboard[hidden] { display: none; }
.playlist-bandit-keyboard-status { min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; }
.playlist-bandit-keyboard-status strong { min-width: 0; flex: 1; overflow: hidden; color: #f1c773; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.playlist-bandit-keyboard .quick-keyboard { min-height: 0; display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 4px; }
.playlist-bandit-keyboard .quick-keyboard.has-diacritics { grid-template-rows: repeat(5, minmax(0, 1fr)); }
.playlist-bandit-keyboard .quick-keyboard.editor-number-layout { grid-template-rows: repeat(3, minmax(0, 1fr)); }
.playlist-bandit-keyboard .quick-key-row { min-height: 0; display: grid; gap: 3px; }
.playlist-bandit-keyboard .quick-key-row-10 { grid-template-columns: repeat(10, 1fr); }
.playlist-bandit-keyboard .quick-key-row-9 { grid-template-columns: repeat(9, 1fr); padding: 0 3%; }
.playlist-bandit-keyboard .quick-key-row-7 { grid-template-columns: repeat(7, 1fr); padding: 0 10%; }
.playlist-bandit-keyboard .editor-letter-actions { grid-template-columns: .75fr .75fr .75fr 1.55fr .75fr .85fr 1fr; }
.playlist-bandit-keyboard .editor-symbol-actions { grid-template-columns: .85fr .75fr 1.7fr .75fr .9fr 1fr; }
.playlist-bandit-keyboard .quick-key-row button { min-width: 0; min-height: 0; padding: 0; border: 1px solid #41464d; border-radius: 5px; background: linear-gradient(180deg, #2a2e34, #202328); color: #f0ece4; font-size: 8px; font-weight: 750; box-shadow: 0 1px 0 #090a0c; touch-action: manipulation; }
.playlist-bandit-keyboard .quick-key-actions button { font-size: 7px; }
.playlist-bandit-keyboard .quick-key-row button:active { transform: translateY(1px); background: #3b311f; color: #f2cb79; }
.playlist-workspace .editor-keyboard-active-field { border-color: #d7a44a !important; box-shadow: 0 0 0 2px #d7a44a22 !important; }
.playlist-basics { display: grid; grid-template-columns: 1fr 1.35fr; gap: 12px; margin-bottom: 14px; }
.playlist-basics label { display: grid; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .5px; }
.playlist-basics input { width: 100%; height: 37px; padding: 0 11px; border: 1px solid #393d43; border-radius: 9px; outline: 0; background: #202329; color: #efebe3; font-size: 11px; }
.playlist-basics input:focus { border-color: #89682f; }
.playlist-columns { min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.playlist-column { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden; border: 1px solid #32363c; border-radius: 13px; background: #16191d; }
.selected-column { grid-template-rows: auto minmax(0, 1fr); }
.column-heading { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; border-bottom: 1px solid #2f3338; background: #1d2024; }
.column-heading h3 { font-size: 13px; }
.column-heading > span { min-width: 25px; padding: 4px 7px; border: 1px solid #3e4248; border-radius: 7px; color: var(--muted); text-align: center; font-size: 9px; }
.editor-search { height: 38px; display: flex; align-items: center; gap: 8px; margin: 9px; padding: 0 10px; border: 1px solid #35393f; border-radius: 8px; background: #101215; color: var(--muted); }
.editor-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #e7e3db; font-size: 10px; }
.editor-song-list { min-height: 0; overflow-y: auto; padding: 4px 8px 8px; scrollbar-color: #45494f transparent; }
.editor-song-row { min-height: 48px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 4px 0; padding: 6px 7px; border: 1px solid #30343a; border-radius: 9px; background: #1d2024; }
.editor-order { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: #292d32; color: #aaa69f; font-size: 9px; }
.editor-song-info { min-width: 0; }
.editor-song-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.editor-song-info small { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.editor-row-actions { display: flex; gap: 4px; }
.mini-action { width: 29px; height: 29px; display: grid; place-items: center; padding: 0; border: 1px solid #3c4046; border-radius: 7px; background: #292c31; color: #c9c5bd; font-size: 13px; cursor: pointer; }
.mini-action.add { border-color: #71562a; background: #3b2f1c; color: #efca7d; }
.mini-action.remove { color: #cc8c85; }
.mini-action:disabled { opacity: .25; cursor: default; }

.modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: #050607b8; backdrop-filter: blur(8px); }
.modal-backdrop[hidden] { display: none; }
.tool-menu-backdrop { position: fixed; inset: 0; z-index: 82; display: grid; place-items: center; padding: 20px; background: #050607c7; backdrop-filter: blur(8px); }
.tool-menu-backdrop[hidden] { display: none; }
.tool-menu-dialog { width: min(420px, 100%); max-height: min(620px, calc(100dvh - 40px)); overflow: hidden; border: 1px solid #45423b; border-radius: 15px; background: #17191d; box-shadow: 0 24px 70px #000d; }
.tool-menu-dialog > header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 15px; border-bottom: 1px solid #34373d; background: #1d2024; }
.tool-menu-dialog header small { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.tool-menu-dialog h2 { margin: 3px 0 0; font-size: 18px; }
.tool-menu-close { width: 36px; height: 36px; display: grid; place-items: center; padding: 0 0 2px; border: 1px solid #41454b; border-radius: 9px; background: #24272c; color: #e1ddd5; font-size: 21px; cursor: pointer; }
.tool-menu-options { max-height: min(520px, calc(100dvh - 130px)); display: grid; gap: 6px; overflow-y: auto; padding: 10px; }
.tool-menu-option { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 13px; border: 1px solid #34383e; border-radius: 9px; background: #202328; color: #ddd9d1; text-align: left; cursor: pointer; }
.tool-menu-option i { color: #efc979; font-style: normal; font-weight: 800; }
.tool-menu-option.active { border-color: #8b692f; background: #382c1a; color: #f1cd82; }
.settings-dialog { width: min(520px, 100%); overflow: hidden; border: 1px solid #373a40; border-radius: 16px; background: #181a1e; box-shadow: 0 28px 80px #000c; }
.settings-dialog > header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #1d2024; }
.settings-dialog header small { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.settings-dialog h2 { margin: 3px 0 0; font-size: 21px; }
.dialog-close { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #25282d; color: #d6d2ca; cursor: pointer; }
.dialog-close svg { width: 17px; height: 17px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.navigation-back {
  min-width: 92px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid #40444a;
  border-radius: 10px;
  background: #24272c;
  color: #d8d4cc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 10px;
  cursor: pointer;
}
.navigation-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.navigation-back b { white-space: nowrap; }
.navigation-back:active { transform: scale(.97); }
.settings-content { display: grid; gap: 10px; padding: 18px; }
#settingsModal .settings-content { max-height: calc(100dvh - 112px); overflow-y: auto; overscroll-behavior: contain; }
.backup-panel { display: grid; gap: 12px; padding: 16px; border: 1px solid #3a3d43; border-radius: 14px; background: linear-gradient(145deg, #1f2227, #191b1f); }
.backup-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.backup-heading > div { display: grid; gap: 3px; }
.backup-heading small { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.backup-heading strong { font-size: 17px; }
.backup-format { padding: 5px 8px; border: 1px solid #50462f; border-radius: 999px; color: #d9ad55; background: #2b2519; font-size: 10px; font-weight: 750; }
.backup-panel p { margin: 0; color: #aeb2bb; font-size: 12px; line-height: 1.45; }
.backup-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.backup-actions button { min-height: 44px; }
.backup-actions button > span { margin-right: 5px; color: var(--accent); font-size: 18px; }
.backup-actions button:disabled { cursor: wait; opacity: .5; }
.backup-status { min-height: 18px; color: #8f949e; font-size: 10px; line-height: 1.35; }
.install-dialog .settings-content { max-height: calc(100dvh - 124px); overflow-y: auto; }
.setting-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 16px; border: 1px solid #30343a; border-radius: 12px; background: #1c1f23; }
.setting-row strong { display: block; font-size: 13px; }
.setting-row span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.setting-card { overflow: hidden; border: 1px solid #30343a; border-radius: 12px; background: #1c1f23; }
.setting-row-embedded { border: 0; border-radius: 0; background: transparent; }
.metadata-display-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 16px 16px; border-top: 1px solid #2d3035; transition: opacity .18s ease; }
.metadata-display-options fieldset { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 14px 0 0; padding: 0; border: 0; }
.metadata-display-options legend { grid-column: 1 / -1; margin-bottom: 8px; color: #e5e0d7; font-size: 11px; font-weight: 800; letter-spacing: .35px; }
.metadata-display-options label { min-width: 0; display: flex; align-items: center; gap: 6px; padding: 8px; border: 1px solid #3a3e44; border-radius: 8px; background: #17191d; color: #c8c4bc; cursor: pointer; }
.metadata-display-options label:has(input:checked) { border-color: #80612e; background: #332918; color: #f0cb82; }
.metadata-display-options input { width: 16px; height: 16px; flex: 0 0 auto; margin: 0; accent-color: var(--accent); }
.metadata-display-options label span { min-width: 0; overflow: hidden; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.metadata-display-options > p { grid-column: 1 / -1; margin: 0; color: #777c84; font-size: 9px; line-height: 1.4; }
.metadata-display-options.compact-disabled { opacity: .4; }
.metadata-display-options label.disabled { cursor: default; }
.metadata-display-options label.disabled:has(input:checked) { border-color: #3a3e44; background: #17191d; color: #c8c4bc; }
#currentTranspose[hidden], #currentKey[hidden], #currentTempo[hidden] { display: none !important; }
@media (max-width: 700px) {
  .metadata-display-options { grid-template-columns: 1fr; }
}
.switch-button { width: 48px; height: 27px; position: relative; flex: 0 0 auto; padding: 3px; border: 1px solid #44484f; border-radius: 99px; background: #2a2d32; cursor: pointer; transition: .18s ease; }
.switch-button i { width: 19px; height: 19px; display: block; border-radius: 50%; background: #a3a6aa; transition: .18s ease; }
.switch-button.enabled { border-color: #83652f; background: #493819; }
.switch-button.enabled i { transform: translateX(19px); background: #efc66f; }
.setting-note { display: flex; gap: 8px; margin: 12px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.setting-note span { color: var(--accent); }

.intermission-dialog {
  width: min(760px, 58vw);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  margin-left: auto;
  border-color: #80612e99;
  background: #15181de8;
  box-shadow: 0 28px 90px #000e, 0 0 0 1px #d7a44a18 inset;
  backdrop-filter: blur(13px) saturate(.85);
}
#intermissionModal {
  place-items: center end;
  background-color: #071019;
  background-image: linear-gradient(90deg, transparent 0 36%, #0710191f 47%, #07101980 72%, #071019bf 100%), url("assets/intermission/band-it-afterparty-display-v029.27.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  backdrop-filter: none;
}
.intermission-content { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; padding: 16px; background: linear-gradient(145deg, #171a1ed9, #101216ed); }
.intermission-now { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 15px; border: 1px solid #4c463b; border-radius: 13px; background: #191c20e8; }
.intermission-now-copy { min-width: 0; }
.intermission-now-copy small { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.intermission-now-copy strong { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.intermission-now-copy span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.intermission-controls { display: flex; gap: 7px; }
.intermission-controls button { width: 42px; height: 42px; border: 1px solid #44484f; border-radius: 10px; background: #292d32; color: #e7e3db; font-size: 12px; font-weight: 800; cursor: pointer; }
.intermission-controls button { display: grid; place-items: center; padding: 0; line-height: 1; }
.intermission-controls button svg { width: 16px; height: 16px; display: block; fill: currentColor; stroke: none; }
.intermission-controls button:active { transform: scale(.96); }
.intermission-controls button:disabled { opacity: .3; cursor: default; }
.intermission-controls .intermission-play { border-color: #80612e; background: #4a381b; color: #efc66f; font-size: 16px; }
.intermission-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.intermission-shuffle, .intermission-add { height: 40px; padding: 0 14px; border-radius: 10px; font-size: 10px; font-weight: 800; cursor: pointer; }
.intermission-shuffle { border: 1px solid #44484f; background: #292d32; color: #c9c5bd; }
.intermission-shuffle.enabled { border-color: #80612e; background: #463619; color: #efc66f; }
.intermission-shuffle span { margin-right: 6px; font-size: 14px; }
.intermission-add { width: auto; margin: 0; }
.intermission-list { min-height: 120px; overflow-y: auto; padding-right: 3px; scrollbar-color: #4a4e54 transparent; }
.intermission-row { min-height: 58px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 7px; padding: 8px 9px 8px 13px; border: 1px solid #30343a; border-radius: 11px; background: #1c1f23; }
.intermission-row.current { border-color: #765a2a; background: #272116; }
.intermission-track-copy { min-width: 0; }
.intermission-track-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.intermission-track-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.intermission-row-actions { display: flex; gap: 5px; }
.intermission-row-actions button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 1px solid #3d4147; border-radius: 8px; background: #292d32; color: #d6d2ca; font-size: 11px; cursor: pointer; }
.intermission-row-actions button svg { width: 14px; height: 14px; display: block; fill: currentColor; stroke: none; }
.intermission-row-actions button[data-intermission-action="play"] { border-color: #735827; background: #3d3019; color: #efc66f; }
.intermission-row-actions button[data-intermission-action="remove"] { color: #d18d86; }
.intermission-row-actions button:disabled { opacity: .25; cursor: default; }
.intermission-empty { min-height: 170px; display: grid; place-items: center; align-content: center; gap: 7px; border: 1px dashed #3a3e44; border-radius: 12px; color: var(--muted); text-align: center; }
.intermission-empty strong { color: #d8d4cc; font-size: 13px; }
.intermission-empty span { max-width: 360px; font-size: 10px; line-height: 1.45; }
.intermission-stage-display { display: none; }
.break-timer-backdrop { z-index: 92; }
.break-timer-dialog { width: min(430px, calc(100vw - 28px)); border-color: #785d30; box-shadow: 0 26px 90px #000e, 0 0 36px #b17a2518; }
.break-timer-body { display: grid; gap: 12px; padding: 14px; }
.break-timer-summary { display: grid; gap: 5px; padding: 14px; border: 1px solid #4f4739; border-radius: 11px; background: linear-gradient(145deg, #222117, #17191d); }
.break-timer-summary small { color: #c7953f; font-size: 8px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.break-timer-summary strong { color: #f2c873; font-size: 20px; }
.break-timer-summary span { color: #98958e; font-size: 10px; }
.break-timer-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.break-timer-presets button { min-width: 0; height: 64px; display: grid; place-content: center; gap: 1px; padding: 0; border: 1px solid #6d532a; border-radius: 10px; background: linear-gradient(180deg, #3f321d, #292319); color: #efc46c; cursor: pointer; }
.break-timer-presets button:active { transform: scale(.97); background: #533d1e; }
.break-timer-presets strong { font-size: 21px; line-height: 1; }
.break-timer-presets span { color: #b6aa92; font-size: 8px; text-transform: uppercase; }
.break-timer-adjust { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.break-timer-adjust button, .break-timer-clear { min-height: 40px; border: 1px solid #41454b; border-radius: 9px; background: #272a2f; color: #d8d4cc; font-size: 10px; font-weight: 750; cursor: pointer; }
.break-timer-clear { width: 100%; color: #cf9189; }
.break-timer-adjust button:disabled, .break-timer-clear:disabled { opacity: .3; cursor: default; }
@media (orientation: landscape) {
  #intermissionModal {
    place-items: stretch end;
    padding: 0;
  }
  .intermission-dialog {
    width: 50vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin-left: auto;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
  }
}
@media (orientation: portrait) {
  #intermissionModal {
    place-items: end center;
    background-position: center top;
    background-size: 100% auto;
    background-image: linear-gradient(180deg, transparent 0 37%, #071019ad 48%, #071019f2 62%, #071019 100%), url("assets/intermission/band-it-afterparty-display-v029.27.png");
  }
  .intermission-dialog {
    width: min(720px, 100%);
    max-height: min(54dvh, 720px);
    margin-left: 0;
  }
}

/* v029.39: local-first music semantics and a list-width landscape editor keyboard. */
.music-settings-card { display: grid; grid-template-columns: 1fr 1fr; }
.music-setting-block { min-width: 0; display: grid; gap: 10px; padding: 14px; }
.music-setting-block + .music-setting-block { border-left: 1px solid #30343a; }
.music-setting-block > div:first-child strong { display: block; font-size: 11px; }
.music-setting-block > div:first-child span { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.music-setting-block.disabled { opacity: .42; }
.segmented-setting, .picker-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border: 1px solid #393d43; border-radius: 9px; background: #141619; }
.segmented-setting button, .picker-mode-switch button { min-height: 32px; border: 0; border-radius: 6px; background: transparent; color: #9fa2a8; font-size: 9px; font-weight: 800; cursor: pointer; }
.segmented-setting button.active, .picker-mode-switch button.active { background: #49371d; color: #f3cb7c; box-shadow: inset 0 0 0 1px #8b692f; }
.segmented-setting button:disabled { cursor: default; }
.picker-mode-switch { width: min(280px, calc(100% - 28px)); margin: 12px auto 0; }
.picker-mode-switch[hidden] { display: none; }
.editor-keyboard-setting-row { grid-template-columns: minmax(0, 1fr) minmax(176px, 210px); }
.editor-keyboard-setting { width: 100%; }
.key-picker-columns.pro-picker { display: grid; grid-template-columns: 1fr; gap: 8px; }
.chord-builder-group { min-width: 0; overflow: hidden; border: 1px solid #353941; border-radius: 10px; background: #1d2025; }
.chord-builder-group h3 { margin: 0; padding: 7px 10px; background: #24272c; color: #c9c4ba; font-size: 9px; letter-spacing: .65px; text-transform: uppercase; }
.chord-builder-options { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px; }
.chord-builder-options button { min-width: 42px; height: 30px; padding: 0 8px; border: 1px solid #40444b; border-radius: 7px; background: #272a30; color: #ece8df; font-size: 9px; font-weight: 750; cursor: pointer; }
.chord-builder-options button.selected { border-color: #d7a44a; background: #49371d; color: #ffd78b; }
.key-picker-footer { flex-wrap: wrap; align-items: center; gap: 8px; }
.key-picker-footer #chordPreview { min-width: 120px; color: #ffd78b; font-size: 22px; text-align: center; }
.category-editor-row #metadataNewCategory:not([hidden]) { display: block; }

@media (orientation: landscape) {
  .app.editor-keyboard-mode .landscape-quick-keyboard {
    height: 168px;
    min-height: 168px;
    display: grid;
    grid-template-rows: 28px minmax(0, 1fr);
    padding: 5px 8px 8px;
  }
  .app.editor-keyboard-mode .landscape-quick-keyboard .quick-keyboard { grid-template-rows: repeat(5, minmax(0, 1fr)); }
  .app.editor-keyboard-mode .landscape-quick-keyboard .quick-keyboard.editor-letter-layout:not(.has-diacritics) { grid-template-rows: repeat(4, minmax(0, 1fr)); }
  .app.editor-keyboard-mode .landscape-quick-keyboard .quick-keyboard.editor-number-layout { grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .app.editor-keyboard-mode .landscape-quick-keyboard .quick-keyboard.editor-tempo-layout { grid-template-rows: repeat(4, minmax(0, 1fr)); }
  .app.editor-keyboard-mode .landscape-quick-keyboard .quick-key-row-accents { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .app.editor-keyboard-mode .landscape-quick-keyboard .editor-letter-actions { grid-template-columns: .75fr .75fr .75fr 1.55fr .75fr .85fr 1fr; }
  .app.editor-keyboard-mode .landscape-quick-keyboard .editor-symbol-actions { grid-template-columns: .85fr .75fr 1.7fr .75fr .9fr 1fr; }
  .app.editor-keyboard-mode .landscape-quick-keyboard .editor-tempo-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app.editor-keyboard-mode .landscape-quick-keyboard .editor-numeric-row { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 15%; }
  .app.editor-keyboard-mode .landscape-quick-keyboard .editor-numeric-row:nth-child(3) { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 23%; }
  .app.editor-keyboard-mode .landscape-quick-keyboard .editor-diacritic-row { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 18%; }
  .app.editor-keyboard-mode .landscape-quick-keyboard .editor-diacritic-row button { border-color: #80632f; background: linear-gradient(180deg, #4b3a20, #332817); color: #f6ce7c; }
  .app.editor-keyboard-mode .landscape-quick-keyboard .quick-key-row button.active { border-color: #b88a3c; background: #4b391d; color: #ffd686; box-shadow: inset 0 0 0 1px #d7a44a55; }
  .app.editor-keyboard-mode .landscape-quick-keyboard .quick-key-row button.caps-lock { box-shadow: inset 0 0 0 2px #e3b25299, 0 0 8px #d7a44a33; }
  .app.editor-keyboard-mode .landscape-quick-search { font-size: 8px; }
  .app.editor-keyboard-mode .landscape-quick-search strong { color: #f1c773; font-size: 10px; }
  .app.editor-keyboard-mode .landscape-quick-search strong::before { content: "Aktív mező: "; color: #8f949e; font-weight: 650; }
  .app.editor-keyboard-mode .landscape-quick-keyboard .quick-key-row button { border-radius: 5px; font-size: 8px; }
  .app.editor-keyboard-mode .landscape-quick-keyboard .quick-key-actions button { font-size: 7px; }
  .app.editor-keyboard-mode .editor-keyboard-active-field { border-color: #d7a44a !important; box-shadow: 0 0 0 2px #d7a44a22 !important; }
}
.app.native-editor-keyboard-mode .landscape-quick-keyboard { display: none; }

@media (orientation: portrait), (max-width: 700px) {
  .music-settings-card { grid-template-columns: 1fr; }
  .music-setting-block + .music-setting-block { border-left: 0; border-top: 1px solid #30343a; }
}
@media (max-width: 520px) {
  .editor-keyboard-setting-row { grid-template-columns: 1fr; }
}
.install-intro { margin: 0 0 14px; color: #c8c4bc; font-size: 12px; line-height: 1.55; }
.install-steps { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.install-steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 11px; align-items: start; padding: 12px; border: 1px solid #30343a; border-radius: 11px; background: #1c1f23; }
.install-steps li > span { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #84662f; border-radius: 50%; background: #3d301b; color: #f1ca77; font-size: 12px; font-weight: 800; }
.install-steps strong { display: block; padding-top: 1px; font-size: 13px; }
.install-steps p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.install-confirm { width: 100%; height: 40px; margin-top: 14px; border: 1px solid #80612e; border-radius: 10px; background: #d7a44a; color: #19140c; font-size: 12px; font-weight: 800; cursor: pointer; }
.install-confirm:active { transform: scale(.99); filter: brightness(1.07); }

.toast { position: fixed; left: 50%; bottom: 86px; transform: translate(-50%, 16px); padding: 10px 16px; border: 1px solid #55504a; border-radius: 10px; background: #22252bea; color: #ece8e0; box-shadow: 0 12px 30px #0008; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 20; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* v029.15: list metadata, aligned editor grid and split key picker. */
#currentArtist[hidden] { display: none !important; }
.metadata-fields { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.metadata-field.title-field { grid-column: 1 / -1; }
.metadata-field.transpose-field { grid-column: 1 / 5; }
.metadata-field.key-field { grid-column: 5 / 9; }
.metadata-field.tempo-field { grid-column: 9 / 13; }
.metadata-field.category-field { grid-column: 1 / 6; }
.metadata-field.artist-field { grid-column: 6 / 13; }
.category-editor-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
.category-manage-button { min-width: 52px; height: 36px; padding: 0 9px; border: 1px solid #4a4e54; border-radius: 8px; background: #292c31; color: #d8d4cc; font-size: 9px; font-weight: 800; text-transform: none; letter-spacing: 0; cursor: pointer; }
.category-manage-button.danger { border-color: #69413d; background: #2b1d1d; color: #d8958e; }
.category-manage-button:disabled { opacity: .35; cursor: default; }
.metadata-field input,
.metadata-field select,
.key-picker-trigger { width: 100%; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid #393d43; border-radius: 8px; outline: 0; background: #22252a; color: #efebe3; font: inherit; font-size: 10px; }
.transpose-field select, .tempo-field input { text-align: center; text-align-last: center; }
.key-picker-trigger { position: relative; display: grid; place-items: center; cursor: pointer; }
.key-picker-trigger i, .review-key-picker i { position: absolute; right: 9px; color: #9a9da3; font-style: normal; }
.key-picker-trigger:focus-visible, .review-key-picker:focus-visible { border-color: #a77d35; box-shadow: 0 0 0 2px #d7a44a24; }
.review-field input, .review-field select, .review-key-picker { width: 100%; min-width: 0; height: 32px; padding: 0 8px; border: 1px solid #393d43; border-radius: 7px; outline: 0; background: #22252a; color: #ece8e0; font-size: 10px; }
.review-key-picker { position: relative; display: grid; place-items: center; cursor: pointer; }
.review-key-field > input[type="hidden"] { display: none; }

.key-picker-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: #050607c7; backdrop-filter: blur(9px); }
.key-picker-backdrop[hidden] { display: none; }
.key-picker-dialog { width: min(610px, calc(100vw - 32px)); max-height: min(720px, calc(100dvh - 32px)); overflow: auto; border: 1px solid #48433a; border-radius: 16px; background: #17191d; color: #efebe3; box-shadow: 0 24px 70px #000c; }
.key-picker-dialog > header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid #34373d; }
.key-picker-dialog header small { color: #d7a44a; font-size: 8px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.key-picker-dialog h2 { margin: 3px 0 0; font-size: 17px; }
.key-picker-close { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid #41454b; border-radius: 9px; background: #24272c; color: #eeeae2; cursor: pointer; }
.key-picker-close svg { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; }
.key-picker-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; }
.key-picker-column { min-width: 0; overflow: hidden; border: 1px solid #353941; border-radius: 12px; background: #1d2025; }
.key-picker-column h3 { margin: 0; padding: 10px 12px; font-size: 12px; letter-spacing: .7px; text-align: center; text-transform: uppercase; }
.key-picker-column.major h3 { background: linear-gradient(135deg, #49371d, #302515); color: #f1c773; }
.key-picker-column.minor h3 { background: linear-gradient(135deg, #173b35, #142b28); color: #82d0b6; }
.key-picker-column > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 10px; }
.key-picker-column button { min-width: 0; height: 36px; border: 1px solid #40444b; border-radius: 8px; background: #272a30; color: #ece8df; font-size: 11px; font-weight: 750; cursor: pointer; }
.key-picker-column button.selected { border-color: #d7a44a; background: #49371d; color: #ffd78b; box-shadow: inset 0 0 0 1px #d7a44a55; }
.key-picker-dialog > footer { display: flex; justify-content: center; padding: 0 14px 14px; }
.key-picker-dialog > footer button { min-width: 180px; }

@media (max-width: 980px) {
  .library { width: 350px; min-width: 350px; }
  .musical-meta { display: none; }
  .stage-header { grid-template-columns: minmax(0, 1fr) auto; }
  .paper-wrap { max-height: 100%; }
  .view-mode-button b, .header-button-label { display: none; }
  .view-mode-button, .header-button { width: 38px; padding: 0 6px; }
  .import-source-grid { grid-template-columns: repeat(2, 1fr); }
  .source-card { min-height: 122px; }
  .import-review-row { grid-template-columns: 24px 52px minmax(130px, 1.2fr) minmax(110px, .8fr) 64px 62px minmax(100px, .7fr); }
  .import-review-row .file-state { display: none; }
  .score-editor { padding: 9px; }
  .score-editor-content { grid-template-columns: minmax(170px, .6fr) minmax(300px, 1.5fr); gap: 9px; padding: 9px; }
  .metadata-fields { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .metadata-playlist-list { grid-template-columns: 1fr; }
}

/* A natív Android/iOS csomag fejlécében minden készülékméreten csak ikonok
   jelennek meg. Az asztali webes változat ettől függetlenül szöveges maradhat. */
html.native-shell .view-mode-button b,
html.native-shell .header-button-label { display: none; }
html.native-shell .view-mode-button,
html.native-shell .header-button { width: 38px; padding: 0 6px; }

@media (orientation: landscape) and (max-width: 760px) {
  .navigation-back { width: 34px; min-width: 34px; height: 34px; padding: 0; }
  .navigation-back b { display: none; }
  .library { width: 280px; min-width: 280px; }
  .brand-row { height: 58px; padding: 7px 10px; gap: 8px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
  .brand-mark span { font-size: 21px; }
  .brand-row h1 { font-size: 18px; }
  .brand-row p { display: none; }
  .icon-button { width: 34px; height: 34px; }
  .view-tabs { padding: 6px 8px 5px; grid-template-columns: repeat(3, 1fr) 34px 34px; }
  .tab { height: 30px; font-size: 10px; }
  .search-box { margin: 0 8px 5px; height: 35px; }
  .list-caption { height: 28px; padding: 0 10px; font-size: 9px; }
  .song-row { min-height: 52px; grid-template-columns: minmax(0, 1fr) 35px 38px; padding: 5px 6px 5px 9px; }
  .song-title { font-size: 12px; }
  .song-subtitle { font-size: 8px; }
  .row-button { height: 34px; }
  .library-footer { min-height: 44px; }
  .footer-button { font-size: 8px; }
  .footer-button span { display: inline; margin-right: 3px; font-size: 12px; }
  .stage { grid-template-rows: 51px minmax(0, 1fr); }
  .stage-header { padding: 0 9px; gap: 8px; }
  .current-meta strong { font-size: 13px; }
  .header-button { height: 31px; padding: 0 7px; font-size: 9px; }
  .viewer-shell { padding: 8px 32px; }
  .viewer-shell.width-mode { padding: 10px 32px 58px; }
  .page-zone { width: 32px; font-size: 34px; }
  .view-mode-switch { height: 31px; }
  .view-mode-button { height: 31px; }
  .floating-page-status { bottom: 7px; min-width: 54px; padding: 5px 8px; }
  .settings-dialog { max-height: calc(100dvh - 24px); }
  .settings-dialog > header { min-height: 58px; padding: 9px 12px; }
  .settings-dialog h2 { font-size: 17px; }
  .settings-content { padding: 12px; }
  .setting-row { padding: 12px; }
  .install-intro { margin-bottom: 9px; font-size: 10px; }
  .install-steps { gap: 6px; }
  .install-steps li { grid-template-columns: 28px minmax(0, 1fr); gap: 9px; padding: 8px 10px; }
  .install-steps li > span { width: 28px; height: 28px; }
  .install-steps strong { font-size: 11px; }
  .install-steps p { margin-top: 2px; font-size: 9px; }
  .install-confirm { height: 34px; margin-top: 9px; }
  .workspace-backdrop { padding: 7px; }
  .workspace-card { height: calc(100dvh - 14px); border-radius: 13px; }
  .workspace-header { min-height: 61px; padding: 8px 12px; }
  .workspace-header h2 { font-size: 17px; }
  .workspace-header p { display: none; }
  .workspace-body { padding: 10px 12px 12px; }
  .workspace-steps { margin-bottom: 9px; }
  .source-card { min-height: 92px; padding: 10px; }
  .source-icon { width: 30px; height: 30px; top: 9px; left: 9px; font-size: 17px; }
  .source-card strong { font-size: 10px; }
  .source-card small { font-size: 8px; }
  .import-history { margin-top: 12px; }
  .import-review-row { grid-template-columns: 23px 43px minmax(120px, 1.4fr) minmax(90px, .8fr) 58px 54px minmax(88px, .7fr); gap: 5px; padding: 6px; }
  .file-preview-tile { width: 40px; height: 40px; }
  .review-field input, .review-field select { height: 28px; padding: 0 6px; font-size: 9px; }
  .playlist-basics { margin-bottom: 8px; }
  .playlist-basics input { height: 32px; }
  .column-heading { min-height: 46px; padding: 6px 9px; }
  .editor-search { height: 32px; margin: 6px; }
  .editor-song-row { min-height: 40px; margin: 3px 0; padding: 4px 5px; }
  .workspace-footer { margin-top: 8px; padding-top: 8px; }
  .primary-action, .secondary-action, .danger-action { height: 34px; }
  .score-editor { padding: 6px; }
  .score-editor-shell { border-radius: 11px; }
  .score-editor-header { min-height: 54px; padding: 7px 10px; }
  .score-editor-header h2 { font-size: 15px; }
  .score-editor-header p { display: none; }
  .score-editor-content { display: block; padding: 8px; overflow-y: auto; }
  .metadata-preview-card { display: none; }
  .metadata-form { overflow: visible; }
  .metadata-section-heading { padding-bottom: 7px; }
  .metadata-fields { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
  .metadata-field.title-field { grid-column: 1 / -1; }
  .metadata-field.transpose-field { grid-column: 1 / 5; }
  .metadata-field.key-field { grid-column: 5 / 9; }
  .metadata-field.tempo-field { grid-column: 9 / 13; }
  .metadata-field.category-field { grid-column: 1 / 6; }
  .metadata-field.artist-field { grid-column: 6 / 13; }
  .metadata-field input, .metadata-field select, .key-picker-trigger, .metadata-select-shell { height: 30px; padding: 0 7px; font-size: 9px; }
  .category-manage-button { min-width: 45px; height: 30px; padding-inline: 6px; font-size: 8px; }
  .metadata-options { margin-top: 7px; gap: 6px; }
  .metadata-check { min-height: 42px; padding: 6px 8px; }
  .metadata-check small { display: none; }
  .metadata-playlists { margin-top: 7px; padding: 8px; }
  .metadata-playlist-list { grid-template-columns: 1fr 1fr; margin-top: 6px; }
  .metadata-playlist-option { padding: 6px; }
  .metadata-actions { padding-top: 8px; }
}

@media (orientation: portrait) {
  .navigation-back { width: 38px; min-width: 38px; padding: 0; }
  .navigation-back b { display: none; }
  .app, .app.panel-right { display: block; position: relative; }
  .stage { width: 100vw; height: 100dvh; grid-template-rows: calc(58px + env(safe-area-inset-top)) minmax(0, 1fr); }
  .stage-header {
    grid-template-columns: auto minmax(68px, 1fr) auto;
    grid-template-rows: 42px;
    align-content: end;
    gap: 6px;
    padding: calc(7px + env(safe-area-inset-top)) 8px 7px;
  }
  .current-meta { min-width: 0; grid-column: 2; grid-row: 1; justify-content: center; text-align: center; }
  .current-meta strong { font-size: 18px; }
  .musical-meta { display: none; }
  .header-actions { display: contents; }
  .portrait-left-actions, .portrait-right-actions { min-width: 0; display: flex; align-items: center; gap: 3px; }
  .portrait-left-actions { grid-column: 1; grid-row: 1; }
  .portrait-right-actions { grid-column: 3; grid-row: 1; }
  .view-mode-switch { display: none; }
  .view-mode-button, .header-button { width: 34px; height: 34px; padding: 0; }
  .view-mode-button b { display: none; }
  .view-mode-button .page-icon-landscape { display: none; }
  .view-mode-button .page-icon-portrait { display: inline; }
  .quick-header-views { display: flex; align-items: center; gap: 3px; }
  .quick-header-view {
    height: 34px;
    min-width: 32px;
    padding: 0 6px;
    border: 1px solid #35393f;
    border-radius: 8px;
    background: #202328;
    color: #aaa69f;
    font-size: 8px;
    font-weight: 750;
    white-space: nowrap;
  }
  .quick-header-view.active { border-color: #8d6a2f; background: #d7a44a; color: #1c160c; }
  .quick-header-view[data-quick-header-view="all"],
  .quick-header-view[data-quick-header-view="playlist"],
  .quick-header-view[data-quick-header-view="set"] { width: 48px; min-width: 48px; padding-inline: 0; }
  .quick-header-favorite { width: 34px; min-width: 34px; padding: 0; display: flex; align-items: center; justify-content: center; gap: 0; }
  .quick-header-favorite span { font-size: 11px; line-height: 1; }
  button.library-drawer-button { width: 43px; display: flex; gap: 3px; }
  button.library-drawer-button b { display: inline; font-size: 8px; }
  .portrait-view-toggle { display: flex; }
  .portrait-view-toggle.target-page .portrait-view-toggle-icon { transform: rotate(90deg); }
  .quick-header-action { display: flex; font-size: 15px; }
  .quick-import-action { display: none; }
  .header-button-label { display: none; }
  .viewer-shell { padding: 10px 22px 56px; }
  .viewer-shell.width-mode { overflow-y: auto; padding: 10px 12px 64px; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
  .viewer-shell:not(.width-mode) { padding: 7px 10px 52px; }
  .viewer-shell:not(.width-mode) .paper-wrap { width: 100%; height: 100%; max-width: 100%; max-height: 100%; aspect-ratio: auto; filter: none; }
  .viewer-shell:not(.width-mode) .paper { width: 100%; height: 100%; background: transparent; }
  .viewer-shell:not(.width-mode) .paper img { object-fit: contain; }
  .width-mode .paper-wrap { width: 100%; height: auto; max-height: none; aspect-ratio: auto; touch-action: pan-y; }
  .page-zone { width: 32px; font-size: 36px; }
  .floating-page-status { bottom: calc(8px + env(safe-area-inset-bottom)); }
  .floating-page-status.preview-actions-visible { width: min(330px, calc(100vw - 24px)); min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px; pointer-events: auto; }
  .preview-actions-visible .preview-return { display: flex; }

  .library {
    width: 100%;
    min-width: 0;
    height: min(78dvh, 720px);
    position: fixed;
    inset: auto 0 0;
    z-index: 32;
    border: 1px solid #3a3d43;
    border-bottom: 0;
    border-radius: 19px 19px 0 0;
    box-shadow: 0 -22px 60px #000c;
    transform: translateY(calc(100% + 24px));
    visibility: hidden;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .panel-right .library { border: 1px solid #3a3d43; border-bottom: 0; }
  .library::before { content: ""; width: 42px; height: 4px; position: absolute; top: 7px; left: 50%; z-index: 3; transform: translateX(-50%); border-radius: 99px; background: #565a61; }
  .library-open .library { transform: translateY(0); visibility: visible; transition-delay: 0s; }
  .brand-row { height: 70px; padding: 16px 12px 8px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 10px; }
  .brand-mark span { font-size: 22px; }
  .brand-row h1 { font-size: 19px; }
  .brand-row p { display: none; }
  button.drawer-close { display: grid; }
  #movePanel { display: none; }
  .view-tabs { grid-template-columns: repeat(3, 1fr) 40px 40px; padding: 8px 10px 6px; }
  .tab { height: 34px; }
  .search-box { height: 40px; margin: 0 10px 7px; }
  .list-caption { height: 31px; padding: 0 12px; }
  .song-list { padding: 0 7px 7px; }
  .song-row { min-height: 58px; grid-template-columns: minmax(0, 1fr) 40px 44px; padding: 6px 7px 6px 11px; }
  .song-row.return-target { border-color: #9d7534; box-shadow: 0 0 0 2px #d7a44a24, 0 0 18px #d7a44a20; }
  .song-title { font-size: 13px; }
  .row-button { height: 38px; }
  .library-footer { min-height: 54px; }
  .library-scrim { width: 100%; height: 100%; position: fixed; inset: 0; z-index: 31; border: 0; background: #050607a8; backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  .library-open .library-scrim { display: block; opacity: 1; pointer-events: auto; }
  .locked .library-drawer-button { opacity: .4; pointer-events: none; }

  .app.quick-list-mode .library {
    height: 348px;
    max-height: calc(46% - 42px);
    display: block;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom);
    background: #15171a;
  }
  .app.quick-list-mode .library > .brand-row,
  .app.quick-list-mode .library > .view-tabs,
  .app.quick-list-mode .library > .search-box,
  .app.quick-list-mode .library > .list-caption,
  .app.quick-list-mode .library > .song-list,
  .app.quick-list-mode .library > .library-footer { display: none; }
  .app.quick-list-mode .portrait-quick-list {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, .96fr) minmax(0, 1.04fr);
    background: #15171a;
  }
  .app.quick-list-mode.library-open .library-scrim {
    display: none;
    opacity: 0;
    pointer-events: none;
  }
  .app.quick-list-mode.library-open .viewer-shell {
    margin-bottom: min(348px, calc(46dvh - 42px));
    overflow-x: hidden;
    overflow-y: auto;
    align-items: flex-start;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .app.quick-list-mode.library-open .viewer-shell:not(.width-mode) .paper-wrap {
    height: calc(100dvh - 117px - env(safe-area-inset-top));
    min-height: calc(100dvh - 117px - env(safe-area-inset-top));
    max-height: none;
    flex: 0 0 auto;
  }
  .quick-results-column,
  .quick-keyboard-column { min-width: 0; min-height: 0; }
  .quick-results-column {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    padding: 10px 8px 10px 10px;
    border-right: 1px solid #35383e;
  }
  .quick-column-header {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 4px;
  }
  .quick-column-header > div { min-width: 0; }
  .quick-column-header small,
  .quick-column-header strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .quick-column-header small { color: var(--accent); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; }
  .quick-column-header strong { margin-top: 2px; font-size: 12px; }
  .quick-column-header > span { flex: 0 0 auto; color: var(--muted); font-size: 8px; }
  .quick-song-list {
    min-height: 0;
    display: grid;
    grid-auto-rows: calc((100% - 20px) / 6);
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-color: #45484d transparent;
  }
  .quick-song-row {
    min-height: 0;
    height: 100%;
    grid-template-columns: minmax(0, 1fr) 34px 38px;
    gap: 4px;
    margin: 0;
    padding: 3px 4px 3px 8px;
    border-color: #292d32;
    border-radius: 7px;
  }
  .quick-song-row .song-title, .quick-song-list .setlist-block .song-title { font-size: 11px; }
  .quick-song-row .row-button { width: 100%; height: 32px; border-radius: 7px; }
  .quick-song-row .row-button-icon { width: 17px; height: 17px; }
  .quick-empty {
    grid-row: 1 / -1;
    display: grid;
    place-content: center;
    gap: 5px;
    padding: 18px;
    color: var(--muted);
    text-align: center;
  }
  .quick-empty strong { color: #ddd9d1; font-size: 12px; }
  .quick-empty small { font-size: 9px; line-height: 1.4; }
  .quick-keyboard-column {
    display: grid;
    grid-template-rows: 48px minmax(0, 1fr);
    padding: 10px;
  }
  .quick-search-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 30px 24px minmax(0, 1fr) repeat(4, 34px);
    align-items: center;
    gap: 6px;
    padding: 0 6px 8px 9px;
    border-bottom: 1px solid #34383e;
    color: var(--muted);
  }
  .quick-search-row kbd { min-width: 30px; height: 25px; display: grid; place-items: center; padding: 0 5px; border: 1px solid #3b3f45; border-radius: 7px; background: #26292e; color: #d7a44a; font-family: inherit; font-size: 10px; font-weight: 800; }
  .quick-search-icon { width: 22px; height: 22px; fill: none; stroke: #bfc2c7; stroke-width: 1.8; stroke-linecap: round; }
  .quick-search-value {
    min-width: 0;
    overflow: hidden;
    color: #f2f0eb;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .quick-search-value.empty { color: #777c84; }
  .quick-close, .quick-clear {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #41454b;
    border-radius: 8px;
    background: #24272c;
    color: #e1ddd5;
    font-size: 21px;
  }
  .quick-clear { color: #d7a44a; font-size: 18px; }
  .quick-clear:disabled { opacity: .35; }
  .quick-tool-button { width: 34px; height: 34px; }
  .quick-keyboard {
    min-height: 0;
    display: grid;
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding-top: 8px;
  }
  .quick-keyboard.has-diacritics { grid-template-rows: repeat(5, minmax(0, 1fr)); }
  .quick-keyboard.search-number-layout { grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .quick-key-row { min-height: 0; display: grid; gap: 4px; }
  .quick-key-row-10 { grid-template-columns: repeat(10, 1fr); }
  .quick-key-row-9 { grid-template-columns: repeat(9, 1fr); padding: 0 3%; }
  .quick-key-row-7 { grid-template-columns: repeat(7, 1fr); padding: 0 10%; }
  .quick-key-row button {
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 1px solid #444950;
    border-radius: 7px;
    background: linear-gradient(180deg, #2b2f35, #22252a);
    color: #f0ece4;
    font-size: 10px;
    font-weight: 750;
    box-shadow: 0 2px 0 #0b0c0e;
    touch-action: manipulation;
  }
  .quick-key-row button:active { transform: translateY(1px); background: #3b311f; color: #f2cb79; }
  .quick-key-actions { grid-template-columns: repeat(3, 1fr); }
  .search-letter-actions { grid-template-columns: .68fr .68fr 1.4fr 1fr 1fr .82fr; }
  .search-symbol-actions { grid-template-columns: .72fr 1.4fr 1fr 1fr .82fr; }
  .quick-key-actions button { font-size: 9px; }
  .quick-key-actions .quick-space { color: #d8d4cc; }

  .modal-backdrop { padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); }
  .settings-dialog { max-height: calc(100dvh - 28px); }
  .settings-dialog > header { min-height: 66px; padding: 11px 14px; }
  .settings-dialog h2 { font-size: 18px; }
  .settings-content { padding: 14px; }
  .intermission-dialog { max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); }
  .intermission-content { gap: 9px; padding: 11px; }
  .intermission-now { gap: 10px; padding: 11px; }
  .intermission-now-copy strong { font-size: 13px; }
  .intermission-controls { gap: 4px; }
  .intermission-controls button { width: 36px; height: 36px; }
  .intermission-row { min-height: 52px; }

  .workspace-backdrop { padding: 0; place-items: stretch; }
  .workspace-card { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .workspace-header { min-height: calc(78px + env(safe-area-inset-top)); padding: calc(11px + env(safe-area-inset-top)) 14px 11px; }
  .workspace-header h2 { font-size: 19px; }
  .workspace-header p { display: none; }
  .workspace-body { padding: 13px 12px calc(15px + env(safe-area-inset-bottom)); }
  .workspace-steps { margin-bottom: 13px; }
  .workspace-steps li:not(:last-child)::after { width: 18px; }
  .import-source-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .source-card { min-height: 126px; padding: 12px; }
  .source-icon { width: 34px; height: 34px; top: 11px; left: 11px; font-size: 19px; }
  .source-card strong { font-size: 11px; }
  .section-heading { align-items: start; }
  .storage-badge { display: none; }
  .bulk-playlist-field select,
  .bulk-playlist-field input { min-width: 150px; max-width: 42vw; }
  .bulk-assignments { align-items: stretch; flex-direction: column; }
  .bulk-set-field { justify-content: flex-start; }
  .import-review-row { grid-template-columns: 24px 48px minmax(0, 1fr) 64px; gap: 7px; }
  .file-preview-tile { width: 45px; height: 45px; }
  .import-review-row .review-field:nth-of-type(n+3), .import-review-row .file-state { display: none; }
  .workspace-footer { position: sticky; bottom: 0; z-index: 3; margin: 12px -12px -15px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #15171af2; backdrop-filter: blur(8px); }
  .playlist-editor-body { overflow-y: auto; }
  .playlist-basics { grid-template-columns: 1fr; }
  .playlist-columns { min-height: 760px; grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .playlist-column { min-height: 360px; }
  .playlist-workspace .workspace-footer { grid-template-columns: 1fr 1fr; }
  .playlist-workspace .workspace-footer > span { display: none; }
  .playlist-workspace .danger-action { grid-column: 1 / -1; }
  .success-actions { flex-direction: column-reverse; width: min(300px, 100%); }
  .success-actions button { width: 100%; }

  .score-editor { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .score-editor-shell { border-radius: 13px; }
  .score-editor-header { min-height: 69px; padding: 9px 11px; }
  .score-editor-header h2 { font-size: 16px; }
  .score-editor-header p { display: none; }
  .score-editor-close { overflow: hidden; }
  .score-editor-content { display: block; padding: 10px; overflow-y: auto; }
  .metadata-preview-card { display: none; }
  .metadata-form { overflow: visible; }
  .metadata-section-heading { align-items: start; flex-direction: column; }
  .metadata-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metadata-field.title-field { grid-column: 1 / -1; }
  .metadata-field.transpose-field, .metadata-field.key-field, .metadata-field.tempo-field { grid-column: auto; }
  .metadata-field.category-field, .metadata-field.artist-field { grid-column: 1 / -1; }
  .category-editor-row { grid-template-columns: minmax(0, 1fr) 52px 58px; }
  .metadata-options { grid-template-columns: 1fr; }
  .metadata-playlist-list { grid-template-columns: 1fr; }
  .metadata-actions { position: sticky; bottom: 0; z-index: 2; margin: 10px -10px -10px; padding: 10px; background: #15171af2; backdrop-filter: blur(8px); }
  .metadata-actions { flex-wrap: wrap; }
  .metadata-actions button { flex: 1 1 30%; }
  .metadata-actions .metadata-delete { flex-basis: 100%; }
}
/* v028.6: the import review owns the available height. Only its file list
   scrolls, so the confirmation controls remain reachable on API 29 tablets. */
.import-workspace .workspace-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.import-workspace #importSourcesPanel,
.import-workspace #importSuccessPanel {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.import-workspace #importReviewPanel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.import-workspace #importReviewPanel[hidden] {
  display: none;
}

.import-workspace .import-review-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: none;
  padding-right: 4px;
  scrollbar-width: auto;
}

.import-workspace #importReviewPanel .workspace-footer {
  position: relative;
  bottom: auto;
  z-index: 3;
  margin: 8px 0 0;
  padding: 10px 0 0;
  background: #15171a;
  backdrop-filter: none;
}

/* v028.8: avoid API 29's circular percentage/grid min-content sizing.
   The modal and its review panel are now a strictly bounded flex stack. */
#importWorkspace {
  align-items: stretch;
}

.workspace-card.import-workspace {
  height: 100%;
  max-height: 100%;
  min-height: 0;
}

.import-workspace .workspace-header {
  flex: 0 0 auto;
}

.import-workspace .workspace-body {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.import-workspace .workspace-steps {
  flex: 0 0 auto;
}

.import-workspace #importSourcesPanel,
.import-workspace #importSuccessPanel {
  flex: 1 1 auto;
  min-height: 0;
}

.import-workspace #importReviewPanel {
  height: auto;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.import-workspace #importReviewPanel > .section-heading,
.import-workspace #importReviewPanel > .review-toolbar,
.import-workspace #importReviewPanel > .workspace-footer {
  flex: 0 0 auto;
}

.import-workspace .import-review-list {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: scroll;
}

.review-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.review-scroll-button {
  min-width: 58px;
  border: 1px solid #444950;
  border-radius: 7px;
  background: #24272c;
}

/* v028.9: author-level flex rules must never override an import step's
   semantic hidden state. Exactly one step panel may be visible at a time. */
.import-workspace #importSourcesPanel[hidden],
.import-workspace #importReviewPanel[hidden],
.import-workspace #importSuccessPanel[hidden] {
  display: none !important;
}

/* v0.29.27: the portrait intermission screen becomes a true 50/50 stage scene.
   The live display is aligned to the smoked-glass area painted into the image. */
@media (orientation: portrait) {
  #intermissionModal {
    place-items: end stretch;
    padding: 0;
    isolation: isolate;
    background-position: center top;
    background-size: 100% auto;
    background-image: linear-gradient(180deg, transparent 0 43%, #07101938 47%, #071019c7 50%, #071019 51%, #071019 100%), url("assets/intermission/band-it-afterparty-display-v029.27.png");
  }
  #intermissionModal::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 0;
    left: 0;
    width: 53%;
    height: 50vh;
    height: 50dvh;
    pointer-events: none;
    background-image:
      linear-gradient(180deg, transparent 0 86%, #07101938 94%, #071019c7 100%),
      url("assets/intermission/band-it-afterparty-display-v029.27.png");
    background-position: left top, 0 -52px;
    background-repeat: no-repeat;
    background-size: 100% 100%, 100vw auto;
    -webkit-mask-image: linear-gradient(90deg, #000 0 90%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0 90%, transparent 100%);
  }
  #intermissionModal .intermission-dialog {
    z-index: 2;
    width: 100vw;
    height: 50vh;
    height: 50dvh;
    max-height: 50dvh;
    margin: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
  }
  .intermission-stage-display {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 1000px;
    height: 620px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 252px minmax(0, 1fr);
    column-gap: 48px;
    row-gap: 26px;
    overflow: hidden;
    padding: 48px 54px 40px;
    border: 0;
    background: transparent;
    color: #d4a04d;
    font-family: "SFMono-Regular", "SF Mono", Menlo, Monaco, monospace;
    text-align: left;
    text-shadow: 0 0 7px #e995272d, 0 2px 0 #000;
    transform-origin: 0 0;
    opacity: 0;
    transition: opacity .12s ease;
    will-change: transform;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .intermission-stage-display.perspective-ready { opacity: 1; }
  .intermission-stage-display::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(180deg, transparent 0 6px, #f0b64c09 8px, transparent 10px);
    mix-blend-mode: screen;
    opacity: .65;
  }
  .intermission-stage-display:active { filter: brightness(1.18); }
  .stage-display-metric {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-rows: 29px minmax(0, 1fr);
    align-content: start;
    gap: 18px;
  }
  .stage-display-time > *,
  .stage-display-timer > * {
    transform: translateX(20px);
  }
  .stage-display-time::after {
    content: "";
    position: absolute;
    top: 2px;
    right: -25px;
    bottom: 4px;
    width: 2px;
    background: linear-gradient(180deg, transparent, #9d773a5e 13%, #d09d4b73 50%, #71562e4f 88%, transparent);
    box-shadow: 1px 0 0 #030609b8;
  }
  .stage-display-label {
    align-self: end;
    overflow: visible;
    font-size: 39px;
    font-weight: 850;
    letter-spacing: 5px;
    line-height: .74;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .stage-display-clock {
    align-self: start;
    font-size: 112px;
    font-weight: 680;
    line-height: .9;
    letter-spacing: -7px;
  }
  .stage-display-countdown {
    align-self: start;
    font-size: 100px;
    font-weight: 680;
    line-height: .9;
    letter-spacing: -6px;
  }
  .stage-display-time {
    --paint-light: #ffe9b5;
    --paint-base: #f2c579;
    --paint-dim: #c08d4d;
    --paint-dark: #895f34;
  }
  .stage-display-timer {
    --paint-light: #ffeab2;
    --paint-base: #f3c476;
    --paint-dim: #c18c49;
    --paint-dark: #8b6033;
  }
  .stage-display-timer .stage-display-label { font-size: 35px; }
  .stage-display-next-panel {
    grid-column: 1 / -1;
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: start;
    gap: 14px;
    padding: 24px 4px 0 20px;
    border-top: 2px solid #a47a3f63;
    box-shadow: inset 0 1px 0 #05080ccf;
    --paint-light: #ffebbd;
    --paint-base: #edc184;
    --paint-dim: #b98a55;
    --paint-dark: #825d38;
  }
  .stage-display-next-label {
    align-self: start;
    font-size: 48px;
    font-weight: 850;
    letter-spacing: 5px;
    line-height: 1;
  }
  .stage-display-next {
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    align-self: start;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 64px;
    font-weight: 770;
    line-height: 1.04;
    letter-spacing: .2px;
    text-overflow: ellipsis;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .stage-display-next.empty-program {
    display: block;
    font-size: 76px;
    white-space: nowrap;
    -webkit-line-clamp: unset;
  }
  .stage-display-texture {
    color: #eabc6e;
    background-image:
      radial-gradient(circle at 14% 32%, var(--paint-light) 0 4%, transparent 5%),
      radial-gradient(circle at 68% 70%, var(--paint-dim) 0 5%, transparent 6%),
      repeating-linear-gradient(101deg, var(--paint-dim) 0 1px, var(--paint-base) 2px 20px, var(--paint-light) 22px 31px, var(--paint-base) 33px 49px, var(--paint-dark) 50px 50px);
    background-size: 97px 61px, 137px 79px, 211px 100%;
    background-position: 7px 3px, 31px 13px, 0 0;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 0 #050709) drop-shadow(0 0 6px #efb65a78);
  }
  .intermission-stage-display.timer-warning .stage-display-countdown {
    --paint-light: #ffe19a;
    --paint-base: #ffc45e;
    --paint-dim: #b77a30;
    --paint-dark: #75461f;
  }
  .intermission-stage-display.timer-urgent .stage-display-countdown,
  .intermission-stage-display.timer-expired .stage-display-countdown {
    --paint-light: #ffc29e;
    --paint-base: #ff8b62;
    --paint-dim: #b94f3a;
    --paint-dark: #6e2924;
    animation: stage-timer-pulse .85s ease-in-out infinite alternate;
  }
}

@keyframes stage-timer-pulse {
  from { opacity: .62; text-shadow: 0 0 5px #ff8b6233; }
  to { opacity: 1; text-shadow: 0 0 18px #ff744a9c; }
}

/* v029.38: compact break controls, list-only metadata preferences and a
   fixed editor canvas whose Playlist assignment list owns its scrolling. */
.metadata-display-options.list-only { grid-template-columns: minmax(0, 1fr); }
.metadata-display-options.list-only fieldset { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.break-timer-presets button { height: 36px; border-radius: 8px; }
.break-timer-presets strong { font-size: 15px; }
.break-timer-presets span { font-size: 7px; }
.break-timer-adjust { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.metadata-form { overflow: hidden; }
.metadata-fields { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.metadata-field.title-field,
.metadata-field.artist-field,
.metadata-field.category-field { grid-column: 1 / -1; }
.metadata-field.transpose-field { grid-column: 1 / 5; }
.metadata-field.key-field { grid-column: 5 / 9; }
.metadata-field.tempo-field { grid-column: 9 / 13; }
.category-editor-row { grid-template-columns: minmax(0, 1fr) 64px 70px; }
.category-manage-button { min-width: 0; padding-inline: 10px; }
.music-metadata-label { display: block; width: 100%; text-align: center; }
.metadata-select-shell {
  width: 100%; min-width: 0; height: 36px; position: relative; display: grid; place-items: center;
  overflow: hidden; border: 1px solid #393d43; border-radius: 8px; background: #22252a;
  color: #efebe3; font-size: 10px; text-align: center; text-transform: none; letter-spacing: 0;
}
.metadata-select-shell:focus-within { border-color: #a77d35; box-shadow: 0 0 0 2px #d7a44a24; }
.metadata-select-value { pointer-events: none; }
.metadata-select-shell > i { position: absolute; right: 9px; color: #9a9da3; font-style: normal; pointer-events: none; }
.metadata-select-shell > select {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0;
  opacity: 0; cursor: pointer;
}
.artist-field { position: relative; z-index: 8; }
.artist-combobox { position: relative; min-width: 0; text-align: left; text-transform: none; letter-spacing: 0; }
.artist-combobox-control {
  width: 100%; height: 36px; display: flex; align-items: center; min-width: 0;
  border: 1px solid #393d43; border-radius: 8px; background: #22252a;
}
.artist-combobox:focus-within .artist-combobox-control { border-color: #89682f; box-shadow: 0 0 0 2px #d7a44a10; }
.artist-chips { max-width: 58%; display: flex; flex: 0 1 auto; align-items: center; gap: 4px; overflow-x: auto; padding-left: 5px; scrollbar-width: none; }
.artist-chips::-webkit-scrollbar { display: none; }
.artist-chip { height: 24px; display: inline-flex; align-items: center; flex: 0 0 auto; overflow: hidden; border: 1px solid #66502c; border-radius: 999px; background: #382d1c; color: #edc676; }
.artist-chip b { max-width: 132px; overflow: hidden; padding: 0 3px 0 8px; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 750; }
.artist-chip button { width: 22px; height: 22px; padding: 0; border: 0; background: transparent; color: #d9b86f; font-size: 15px; line-height: 1; cursor: pointer; }
.metadata-field .artist-combobox input {
  width: auto; height: 34px; min-width: 72px; flex: 1 1 90px; padding: 0 5px 0 7px;
  border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #efebe3;
  font-size: 10px; text-align: left; text-transform: none; letter-spacing: 0;
}
.metadata-field .artist-combobox input:focus { border: 0; box-shadow: none; }
.artist-combobox-toggle { width: 30px; height: 34px; flex: 0 0 30px; padding: 0; border: 0; background: transparent; color: #9a9da3; font-size: 15px; cursor: pointer; }
.artist-suggestions {
  position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 90;
  max-height: 236px; overflow-y: auto; padding: 5px; border: 1px solid #4a4e54;
  border-radius: 9px; background: #191c20f8; box-shadow: 0 14px 32px #000b;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.artist-suggestions[hidden] { display: none; }
.artist-suggestion { width: 100%; min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: #e7e2d9; text-align: left; cursor: pointer; }
.artist-suggestion:hover, .artist-suggestion:focus-visible { outline: 0; background: #2a2e34; }
.artist-suggestion small { color: #8f949e; font-size: 8px; white-space: nowrap; }
.artist-suggestion.create { display: grid; justify-content: stretch; border-bottom: 1px solid #393d43; color: #e4b85f; }
.artist-suggestion.create span { font-size: 8px; font-weight: 800; letter-spacing: .45px; text-transform: uppercase; }
.artist-suggestion.create strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.metadata-playlists {
  min-height: 74px;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.metadata-assignment-grid {
  min-height: 74px;
  flex: 1 1 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  overflow: hidden;
}
.metadata-assignment-grid .metadata-playlists {
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin-top: 0;
}
.metadata-assignment-grid .metadata-playlist-list {
  grid-template-columns: minmax(0, 1fr);
}
.metadata-playlist-list {
  min-height: 0;
  flex: 1 1 0;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right: 3px;
}
.metadata-actions { flex: 0 0 auto; margin-top: 0; }

@media (orientation: landscape) {
  .score-editor-content { overflow: hidden; }
  .metadata-form { height: 100%; overflow: hidden; }
  .metadata-field.title-field,
  .metadata-field.artist-field,
  .metadata-field.category-field { grid-column: 1 / -1; }
  .metadata-field.transpose-field { grid-column: 1 / 5; }
  .metadata-field.key-field { grid-column: 5 / 9; }
  .metadata-field.tempo-field { grid-column: 9 / 13; }
  .category-editor-row { grid-template-columns: minmax(0, 1fr) 68px 76px; }
}

@media (orientation: portrait) {
  .score-editor-content { height: 100%; overflow: hidden; }
  .metadata-form { height: 100%; overflow: hidden; }
  .metadata-fields { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 7px; }
  .metadata-field.title-field { grid-column: 1 / 7; grid-row: 1; }
  .metadata-field.category-field { grid-column: 7 / 13; grid-row: 1; }
  .metadata-field.artist-field { grid-column: 1 / 7; grid-row: 2; }
  .metadata-field.transpose-field { grid-column: 7 / 9; grid-row: 2; }
  .metadata-field.key-field { grid-column: 9 / 11; grid-row: 2; }
  .metadata-field.tempo-field { grid-column: 11 / 13; grid-row: 2; }
  .category-editor-row { grid-template-columns: minmax(0, 1fr) 58px 64px; }
  .metadata-playlist-list { grid-template-columns: 1fr; }
  .metadata-actions { position: static; margin: 0; }
}

/* Web v0.29.49: the browser/system keyboard is the only text-input path. */
.web-shell .landscape-quick-keyboard,
.web-shell .playlist-bandit-keyboard,
.web-shell .quick-keyboard {
  display: none !important;
}

.web-quick-search-input {
  min-width: 0;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #41454b;
  border-radius: 9px;
  outline: 0;
  background: #202328;
  color: #f2f0eb;
  font: inherit;
  font-size: 12px;
}
.web-quick-search-input::placeholder { color: #777c84; }
.web-quick-search-input:focus-visible {
  border-color: #b88a3c;
  box-shadow: 0 0 0 2px #d7a44a2e;
}

@media (orientation: portrait) {
  .web-shell .app.quick-list-mode .portrait-quick-list {
    grid-template-columns: 1fr;
    grid-template-rows: 58px minmax(0, 1fr);
  }
  .web-shell .quick-keyboard-column {
    grid-row: 1;
    grid-template-rows: 1fr;
    padding: 7px 10px 3px;
  }
  .web-shell .quick-results-column {
    grid-row: 2;
    padding: 6px 10px 10px;
    border-right: 0;
  }
  .web-shell .quick-search-row {
    grid-template-columns: 34px 24px minmax(0, 1fr) repeat(4, 34px);
    padding-bottom: 4px;
  }
}
