/* עיצוב "במה": כהה ומרוכז, כמו מוניטור על במה. השורה הנוכחית בהירה והשאר מעומעם בזמן נגינה,
   האקורדים בכתום-ענבר שבולט בחושך. גופן Rubik. (השראות: Moises, Chord AI, המילים החיות של Apple Music) */
:root {
  color-scheme: dark;
  --bg: #121214; --panel: #1a1a1d; --raise: #232327; --ink: #f1ede4; --mute: #9a958b; --line: #2e2e33;
  --accent: #ffb547; --accent-ink: #141210; --chord: #ffb547; --now: #ffb547; --nowline: #1d1c1a;
  --glow: rgba(255, 181, 71, .45); --dispute: #ff6b4a; --danger: #ff7a6b; --soft: #2a2419;
  --chord-size: 17px; --lyric-size: 21px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 "Rubik", "Assistant", "Segoe UI", system-ui, Arial, sans-serif; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
input[type=range] { accent-color: var(--accent); }

/* ---------- כותרת ---------- */
header.top { position: sticky; top: 0; z-index: 10; background: rgba(18, 18, 20, .88); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 10px; min-height: 58px; }
header.top h1 { font-size: 19px; font-weight: 700; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header.top h1 small { color: var(--mute); font-weight: 400; font-size: 14px; margin-inline-start: 4px; }
.brand { font-weight: 800 !important; font-size: 21px !important; display: flex; align-items: center; gap: 10px; }
.brand::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--glow); flex: none; }
.icon-btn { border: 0; background: none; padding: 8px; border-radius: 12px; font-size: 20px; line-height: 1; color: var(--ink);
  text-decoration: none; }
.icon-btn:hover { background: var(--raise); }
.star.on { color: var(--accent); }

/* ---------- כפתורים ושדות ---------- */
.btn { border: 0; background: var(--raise); border-radius: 999px; padding: 10px 18px; font-weight: 500; }
.btn:hover { background: #2c2c31; }
.btn.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: #ffc266; }
.btn:disabled { opacity: .5; cursor: default; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 16px 0; }
/* טקסט לדוגמה: מימין, ובשורה אחת שלא חורגת מהשדה (גם בשדה dir=auto, שבלי טקסט יוצא משמאל) */
input::placeholder, textarea::placeholder { direction: rtl; text-align: right; color: #77736c; opacity: 1; }
input:placeholder-shown { direction: rtl; text-overflow: ellipsis; }
.hint { color: var(--mute); font-size: 14px; }
.err { color: var(--danger); font-size: 14px; }
.err:empty { display: none; }
.empty { color: var(--mute); text-align: center; padding: 32px 0; }
.progress { height: 4px; background: var(--raise); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .5s; }

/* ---------- דף הבית ---------- */
.new-song { padding: 26px 0 6px; }
.hero-q { display: block; font-size: 28px; font-weight: 700; line-height: 1.15; margin-bottom: 14px; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--raise); border-radius: 18px; padding: 6px 6px 6px 6px;
  padding-inline-start: 16px; border: 1px solid transparent; transition: border-color .15s; }
.search-box:focus-within { border-color: #4a3f2c; }
.search-box .mag { color: var(--accent); font-size: 20px; flex: none; }
.search-box input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; padding: 9px 0; }
.search-box input::-webkit-search-cancel-button { filter: invert(.7); }
.search-box .btn { flex: none; padding: 10px 18px; border-radius: 14px; }
details.more summary { color: var(--mute); cursor: pointer; margin-top: 12px; font-size: 14px; }
details.more textarea, details.more input { width: 100%; margin-top: 8px; padding: 12px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--panel); font-size: 16px; min-width: 0; }
details.more textarea { min-height: 140px; }
.home h2 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
.cont { margin-top: 22px; }
.cards { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px;
  scroll-snap-type: x mandatory; }
.cards::-webkit-scrollbar { display: none; }
.card-s { flex: none; width: 152px; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); scroll-snap-align: start; }
.card-s .big { width: 152px; height: 96px; object-fit: cover; border-radius: 14px; margin-bottom: 7px; background: var(--raise);
  display: grid; place-items: center; color: var(--accent); font-size: 28px; transition: transform .15s; }
.card-s:hover .big { transform: scale(1.03); }
.card-s b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-s span { font-size: 12.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.library { margin-top: 26px; padding-bottom: 40px; }
.lib-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.lib-head h2 { margin: 0 !important; }
.tabs { display: flex; gap: 6px; }
.tabs button { border: 0; background: var(--raise); color: #c9c4ba; border-radius: 999px; padding: 5px 14px; font-size: 14px; }
.tabs button.on { background: var(--ink); color: var(--bg); font-weight: 600; }
.lib-q { width: 100%; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: transparent;
  font-size: 16px; margin-bottom: 4px; }
ul.songs { list-style: none; margin: 0; padding: 0; }
ul.songs li { display: flex; align-items: center; gap: 4px; padding: 8px 0; }
ul.songs li a.title { flex: 1; min-width: 0; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 12px; }
ul.songs .th { width: 60px; height: 44px; object-fit: cover; border-radius: 9px; flex: none; background: var(--raise);
  display: grid; place-items: center; color: var(--accent); }
ul.songs .tt { min-width: 0; flex: 1; display: flex; flex-direction: column; }
ul.songs li a.title b { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
ul.songs li a.title span { color: var(--mute); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
ul.songs .dur { color: #6f6b64; font-size: 12.5px; font-variant-numeric: tabular-nums; }
ul.songs .icon-btn { font-size: 17px; color: #6f6b64; padding: 8px 6px; }
ul.songs .icon-btn.star.on { color: var(--accent); }
ul.songs .del { font-size: 13px; opacity: .6; }
ul.songs li.busy .th { box-shadow: 0 0 0 2px var(--accent); }
ul.songs li.busy a.title span { white-space: normal; }
/* חיפוש לפי שם: 1. איזה שיר, 2. איזה ביצוע */
.step { font-size: 15px; font-weight: 600; margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.step i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.song-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sc { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 7px 14px; text-align: start;
  display: flex; flex-direction: column; line-height: 1.25; max-width: 100%; }
.sc b { font-weight: 600; font-size: 15px; } .sc span { font-size: 12.5px; color: var(--mute); }
.sc.on { border-color: var(--accent); background: var(--soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.sc.on span { color: #d9b77a; }

/* ---------- דף השיר ---------- */
main.sheet { padding: 12px 16px 170px; max-width: 860px; margin: 0 auto; overflow-x: clip; }
html, body { overflow-x: clip; }  /* שום דבר לא דוחף את הדף לרוחב */
.meta { color: var(--mute); font-size: 13.5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 14px; }
.meta a { color: #d8d3ca; text-decoration: none; border-bottom: 1px solid #4a463f; }
.meta a:hover { color: var(--accent); border-color: var(--accent); }
.line { padding: 4px 10px; border-radius: 12px; margin: 2px 0; transition: opacity .35s, background .35s; }
.line.break { margin-top: 20px; }
/* בזמן נגינה: השורה הנוכחית בהירה, הבאה חצי, והשאר מעומעם — כמו מוניטור על במה */
body.is-playing:not(.loop-pick) #lines .line { opacity: .42; }
body.is-playing #lines .line.now + .line { opacity: .7; }
body.is-playing #lines .line.now { opacity: 1; }
.line.now { background: var(--nowline); }
/* האקורד יושב מעל תחילת הקטע שלו ולא תופס רוחב — כך מילה לא נחתכת. התנגשויות מתוקנות ב-JS (spread) */
/* כל מילה שומרת מעליה מקום לאקורד — גם כשהשורה נשברת לשתיים, האקורדים של החלק השני לא עולים על המילים של הראשון */
.lyr { line-height: 1.28; font-weight: 500; }
.lyr .wl { display: inline-block; }
.lyr .wl.hc { padding-top: calc(var(--chord-size) * 1.45); }
.tie { display: inline-block; height: 0.55em; }
.tie.mid { border-bottom: 2px solid #3a3a40; }
.seg { position: relative; white-space: pre; font-size: var(--lyric-size); }
.seg .c { position: absolute; bottom: 100%; right: 0; font-size: var(--chord-size); font-weight: 600; color: var(--chord);
  direction: ltr; white-space: nowrap; cursor: pointer; user-select: none; line-height: 1.3; }
.seg .c span, .chords-row .c span { border-radius: 7px; padding: 0 4px; transition: background .15s, color .15s; }
.seg .c span.now, .chords-row .c span.now { background: var(--now); color: var(--accent-ink); box-shadow: 0 0 16px var(--glow); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--dispute); margin-inline-start: 3px; vertical-align: super; }
.chords-row { display: flex; flex-wrap: wrap; gap: 6px 16px; direction: ltr; justify-content: flex-end; }
.chords-row .c { font-size: var(--chord-size); font-weight: 600; color: var(--chord); cursor: pointer; padding: 0 3px; border-radius: 6px; }

/* מצב קריוקי */
body.karaoke main.sheet .line:not(.near) { display: none; }
body.karaoke main.sheet { --lyric-size: 30px; --chord-size: 24px; padding-top: 16vh; }
.big { display: none; }
body.karaoke .big { display: flex; justify-content: center; align-items: baseline; gap: 28px; direction: ltr; padding: 12px 0; }
.big .cur { font-size: 68px; font-weight: 800; color: var(--chord); text-shadow: 0 0 30px var(--glow); }
.big .nxt { font-size: 30px; color: var(--mute); }

/* נגן */
.player { position: fixed; inset: auto 0 0 0; background: rgba(26, 26, 29, .94); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); border-radius: 20px 20px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.35); z-index: 20; }
.player .wrap { display: flex; align-items: center; gap: 8px; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
.player .play { width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 19px;
  box-shadow: 0 0 18px rgba(255,181,71,.3); flex: none; }
.player input[type=range] { flex: 1; min-width: 120px; direction: ltr; }
.player .time { font-variant-numeric: tabular-nums; color: var(--mute); font-size: 13px; direction: ltr; }
.player select, .player .pill { border: 0; background: var(--raise); color: #d8d3ca; border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.player .pill.on { background: var(--ink); color: var(--bg); font-weight: 500; }
.player .seg2 button { padding: 6px 11px; font-size: 14px; }
.player button, .player select { white-space: nowrap; flex: none; }
/* במחשב: שורה אחת תמיד (הנגן רחב יותר מהדף, ופס ההתקדמות מתכווץ) */
@media (min-width: 900px) {
  .player .wrap { max-width: 1180px; flex-wrap: nowrap; }
  .player input[type=range] { min-width: 80px; }
}
/* בטלפון ובטאבלט: שתי שורות — נגינה, התקדמות, זמן ומהירות; ואז מה שומעים, סולם, קריוקי וגלילה */
.player .row-break { display: none; }
@media (max-width: 899px) {
  .player .wrap { gap: 6px 4px; padding-inline: 8px; }
  .player .row-break { display: block; flex-basis: 100%; height: 0; }
  .player input[type=range] { min-width: 60px; }
  .player .play { width: 42px; height: 42px; }
  .player .seg2 button, .player .pill, .player select { padding: 5px 7px; font-size: 13px; }
  .player .seg2 { padding: 1px; }
}
@media (max-width: 389px) {
  .player .seg2 button, .player .pill { padding: 5px 5px; font-size: 12.5px; }
}
@media (max-width: 349px) {
  .player .wrap { gap: 6px 3px; padding-inline: 4px; }
  .player .seg2 button, .player .pill { padding: 4px 3.5px; font-size: 11.5px; }
}

/* חלונית: בטלפון — מלמטה, נמוכה, בלי להחשיך את הדף (השורה של האקורד נגללת מעליה).
   במחשב — בצד, לכל הגובה, והשיר כולו נשאר גלוי */
.sheet-panel { position: fixed; inset: auto 0 0 0; z-index: 30; background: var(--panel); border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.5);
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); max-height: 56vh; overflow: auto;
  transform: translateY(105%); transition: transform .18s ease-out; }
.sheet-panel.open { transform: none; }
.sheet-panel h3 { margin: 0 0 4px; }
@media (min-width: 900px) {
  .sheet-panel { inset: 57px auto 0 0; width: 380px; max-height: none; border-radius: 0; border-top: 0;
    border-inline-start: 1px solid var(--line); box-shadow: 10px 0 40px rgba(0,0,0,.4); transform: translateX(-105%); }
  .sheet-panel.open { transform: none; }
  .sheet-panel { bottom: var(--player-h, 64px); }
  /* השיר זז הצידה כשהחלונית פתוחה — כלום לא מוסתר */
  /* הקצה הימני (שממנו השורות מתחילות) לא זז; רק הרוחב מצטמצם אם החלונית הייתה מכסה */
  body.panel-open main.sheet { --mr: max(0px, calc((100% - 860px) / 2)); margin-right: var(--mr); margin-left: auto;
    max-width: min(860px, calc(100% - 392px - var(--mr))); }
}

/* כותרת החלונית: שם האקורד, הזמן, גיטרה/פסנתר, סגירה — בשורה אחת */
.cp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cp-name { font-size: 26px; color: var(--chord); line-height: 1; }
.cp-head .hint { margin-inline-end: auto; }
.x { border: 0; background: none; font-size: 18px; color: var(--mute); padding: 4px 6px; border-radius: 8px; }
.x:hover { background: var(--raise); }
/* מתג של שתי אפשרויות */
.seg2 { display: inline-flex; border-radius: 999px; padding: 2px; background: var(--raise); }
.seg2 button { border: 0; background: none; border-radius: 999px; padding: 4px 10px; font-size: 13px; color: #b9b5ad; }
.seg2 button.on { background: var(--ink); color: var(--bg); font-weight: 500; }

/* תרשימים: כל האצבועים בשורה אחת, להשוואה */
.cp-diag { color: var(--ink); text-align: center; }
.shapes { display: flex; justify-content: center; gap: 4px; direction: ltr; }
.shapes .diagram { width: 31%; max-width: 116px; }
.diagram { height: auto; }
.diagram.piano { width: min(280px, 88vw); margin-top: 4px; }
.cp-diag .hint { margin: 2px 0 0; font-size: 13px; }
.dot-fill { fill: var(--ink); }
.dot-text { fill: var(--bg); font-weight: 700; }
.wk { fill: #ece8df; stroke: #555; }
.bk { fill: #121214; stroke: #121214; }
.wk.on, .bk.on { fill: var(--accent); }
.wk.bass, .bk.bass { fill: var(--chord); }

/* החלפת אקורד: מקופל כברירת מחדל, פתוח במחלוקת */
.cp-alts { border-top: 1px solid var(--line); margin-top: 8px; }
.cp-alts summary { cursor: pointer; font-weight: 600; font-size: 15px; padding: 8px 0 4px; list-style-position: inside; }
.cp-alts .hint { margin: 2px 0 6px; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: stretch; border: 1px solid var(--line); background: var(--raise); border-radius: 12px; overflow: hidden; }
.chip.on { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent) inset; }
.chip .pick { border: 0; background: none; padding: 5px 9px 4px; text-align: center; line-height: 1.15; }
.chip .pick b { display: block; font-size: 17px; color: var(--chord); }
.chip .pick small { display: block; font-size: 11px; color: var(--mute); white-space: nowrap; }
.chip .snd { border: 0; border-inline-start: 1px solid var(--line); background: none; padding: 0 8px; font-size: 14px; }
.chip .pick:active, .chip .snd:active { background: #2c2c31; }
.chip.more { padding: 0 12px; color: var(--mute); font-size: 14px; align-items: center; }
[data-i].sel { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 6px; }
.own { display: flex; gap: 6px; align-items: center; margin: 8px 0 0; }
.own[hidden] { display: none; }
.own input { flex: 1; min-width: 90px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); font-size: 17px; font-weight: 700; color: var(--chord); }
.own .btn { padding: 7px 12px; }
.cp-listen { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cp-listen .btn { padding: 6px 12px; font-weight: 600; }
.vol { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--mute); }
.vol input { width: 80px; }
.playing { background: var(--soft) !important; }

.ask-lyrics { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ask-lyrics p { flex: 1; min-width: 200px; margin: 0; }
.field { width: 100%; padding: 10px 12px; margin: 6px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 16px; }
.sheet-panel .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* סולם וקאפו: שורות קומפקטיות */
.krow { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.krow.end { justify-content: flex-start; margin-top: 12px; }
.klabel { width: 44px; font-weight: 600; }
.kval { color: var(--mute); font-size: 14px; }
.kval b { color: var(--chord); }
.stepper { display: inline-flex; align-items: center; border-radius: 12px; overflow: hidden; background: var(--raise); }
.stepper button { border: 0; background: none; width: 38px; height: 34px; font-size: 19px; line-height: 1; }
.stepper button:active { background: #2c2c31; }
.stepper b { min-width: 34px; text-align: center; font-size: 17px; }
.capos { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px 0; padding-inline-start: 54px; }
.capos button { border: 1px solid var(--line); background: var(--raise); border-radius: 12px; padding: 4px 10px; line-height: 1.2; font-size: 14px; }
.capos button small { display: block; color: var(--mute); font-size: 11px; }
.capos button.on { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent) inset; }
/* מתג הפעלה */
.switch { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 15px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: inset-inline-start .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { inset-inline-start: 18px; }
.meta .key-chip { background: var(--soft); color: var(--accent); border: 0; border-radius: 999px; padding: 3px 12px; text-decoration: none; font-weight: 500; }

/* כניסה */
.login { max-width: 340px; margin: 20vh auto; padding: 0 16px; text-align: center; }
.login h1 { justify-content: center; margin: 0 0 22px; }
.login input { width: 100%; padding: 13px 16px; border: 1px solid transparent; border-radius: 14px; margin: 0 0 12px; background: var(--raise);
  font-size: 16px; outline: none; }
.login input:focus { border-color: #4a3f2c; }

/* לופ */
.loop-bar { flex-basis: 100%; display: flex; align-items: center; gap: 8px; background: var(--soft); color: var(--accent); border-radius: 12px;
  padding: 4px 10px; font-size: 14px; }
.loop-bar[hidden] { display: none; }
.loop-bar span { flex: 1; }
.player .pill.icon { padding-inline: 8px; }
body.loop-pick #lines .line { cursor: pointer; outline: 1px dashed var(--line); }
body.loop-pick #lines .line:hover { background: var(--raise); }
.line.in-loop, .line.loop-first { box-shadow: inset -4px 0 0 var(--accent); }
.icon-btn.pdf { font-size: 13.5px; font-weight: 500; background: var(--raise); padding: 7px 14px; border-radius: 999px; }

/* ---------- ייצוא: עמודי A4 בטורים (PDF ו-JPG) ----------
   העמוד מעוצב בלי תלות בשאר הדף (משתנים משלו), כי ב-JPG הוא מצויר לבד, מחוץ לדף */
#print { display: none; }
/* נבנה בתוך מסגרת בגודל אפס: נמדד כרגיל, אבל לא מרחיב את הדף. (מחוץ למסך משמאל — בדף מימין לשמאל
   הדפדפן מאפשר לגלול לשם, והטלפון הקטין את כל התצוגה) */
body.printing #print { display: block; position: fixed; top: 0; left: 0; width: 0; height: 0; overflow: hidden; }
.xp-page { --ink: #000; --bg: #fff; --chord: #000; --mute: #444; --line: #ccc; --now: transparent;
  --lyric-size: calc(15px * var(--k)); --chord-size: calc(12.5px * var(--k));
  width: 794px; height: 1123px; box-sizing: border-box; padding: 34px 38px; overflow: hidden; background: #fff; color: #000;
  direction: rtl; font-family: "Assistant", "Segoe UI", system-ui, Arial, sans-serif; line-height: 1.5; }
.xp-in { height: 100%; display: flex; flex-direction: column; position: relative; }
.xp-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; border-bottom: 1.5px solid #000;
  padding-bottom: 4px; margin-bottom: 10px; }
.xp-head h1 { font-size: 22px; margin: 0; line-height: 1.15; }
.xp-head .by { font-size: 14px; color: #444; }
.xp-head .info { margin-inline-start: auto; font-size: 13px; }
.xp-head.small { font-size: 12px; color: #444; margin-bottom: 8px; }
.xp-figs { display: flex; flex-wrap: wrap; gap: 2px 8px; direction: ltr; justify-content: flex-end; margin: -4px 0 8px;
  padding-bottom: 6px; border-bottom: 1px solid #ccc; }
.xp-figs figure { margin: 0; width: 50px; text-align: center; }
.xp-figs figcaption { font-weight: 700; font-size: 12px; }
.xp-figs .diagram { width: 50px; }
.xp-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--c), minmax(0, 1fr)); column-gap: 14px; }
.xp-col { min-width: 0; overflow: hidden; }
.xp-col + .xp-col { border-inline-start: 1px solid #ccc; padding-inline-start: 12px; }
.xp-measure { position: absolute; top: 0; visibility: hidden; }
.xp-page .line, .xp-measure .line { padding: 0; margin: 0; border-radius: 0; background: none; box-shadow: none; outline: none; }
.xp-page .line.break, .xp-measure .line.break { margin-top: calc(10px * var(--k)); }
.xp-page .dot, .xp-measure .dot { display: none; }
.xp-page [data-i] { background: none !important; outline: none !important; }
.xp-page .tie.mid { border-bottom-color: #ccc; }
/* תצוגה מקדימה בחלונית: העמוד הראשון, מוקטן */
.xp-preview { width: calc(794px * 0.4); height: calc(1123px * 0.4); overflow: hidden; margin: 6px auto;
  border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.xp-preview .xp-page { transform: scale(0.4); transform-origin: top right; }
@media print {
  @page { size: A4; margin: 0; }
  body > *:not(#print) { display: none !important; }
  html, body { background: #fff; }
  body.printing #print { position: static; width: auto; height: auto; overflow: visible; }
  .xp-page { break-after: page; }
  .xp-page:last-child { break-after: auto; }
}

/* חיפוש שיר לפי שם */
#results { margin-top: 14px; }
.searching::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  margin-inline-end: 8px; animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .25; } }
.tab-pick { display: flex; flex-direction: column; gap: 4px; font-size: 14px; margin-bottom: 8px; }
.tab-pick select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
ul.yt { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.yt-row { display: flex; gap: 12px; align-items: center; width: 100%; text-align: start; border: 0;
  background: var(--panel); border-radius: 14px; padding: 6px; transition: background .15s; }
.yt-row:hover, .yt-row:active { background: var(--raise); }
.yt-row .th { position: relative; flex: none; }
.yt-row img { display: block; width: 112px; height: 63px; object-fit: cover; border-radius: 10px; background: var(--raise); }
.yt-row .th i { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.75); color: #fff; font-style: normal;
  font-size: 11px; padding: 0 4px; border-radius: 4px; }
.yt-row span { min-width: 0; display: flex; flex-direction: column; }
.yt-row b { font-size: 15px; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.yt-row small { color: var(--mute); font-size: 13px; }
.yt-row small.have { color: var(--accent); }
.icon-btn.pdf.on { background: var(--ink); color: var(--bg); }
