/* --- Betűtípusok (fonts/, a programmal csomagolva; SIL Open Font License) ---
   Változó vastagságú WOFF2-ek, két részben: latin és latin-ext (ő, ű); a böngésző csak a szükséges részt tölti le.
   A választott betűtípust az app.js állítja be (--font-ui), a beállítások szerint. */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap;
    src: url('fonts/figtree/figtree-latin.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap;
    src: url('fonts/figtree/figtree-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 200 1000; font-display: swap;
    src: url('fonts/nunito-sans/nunito-sans-latin.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 200 1000; font-display: swap;
    src: url('fonts/nunito-sans/nunito-sans-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('fonts/onest/onest-latin.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('fonts/onest/onest-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 100 1000; font-display: swap;
    src: url('fonts/dm-sans/dm-sans-latin.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 100 1000; font-display: swap;
    src: url('fonts/dm-sans/dm-sans-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 200 800; font-display: swap;
    src: url('fonts/atkinson-hyperlegible-next/atkinson-hyperlegible-next-latin.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 200 800; font-display: swap;
    src: url('fonts/atkinson-hyperlegible-next/atkinson-hyperlegible-next-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
/* Az énekszámok és az oldalcímek talpas betűi (a régi korálkönyvek mintájára); a választottat az app.js állítja be
   (--font-serif). Mindegyikből csak egy, félkövér hatású változat van meg; a 400–700-as tartomány azt jelzi, hogy a
   böngésző ne vastagítsa tovább mesterségesen. */
@font-face { font-family: 'Old Standard TT'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url('fonts/old-standard-tt/old-standard-tt-latin.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Old Standard TT'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url('fonts/old-standard-tt/old-standard-tt-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'DM Serif Text'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url('fonts/dm-serif-text/dm-serif-text-latin.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'DM Serif Text'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url('fonts/dm-serif-text/dm-serif-text-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Libre Bodoni'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url('fonts/libre-bodoni/libre-bodoni-latin.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Libre Bodoni'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url('fonts/libre-bodoni/libre-bodoni-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* --- Változók (Téma) --- */
:root {
    --col-galaxy-blue: #002B36;
    --col-galaxy-light: #073642;
    --col-papyrus: #FDF6E3;
    --col-papyrus-dark: #EEE8D5;
    --col-accent: #B58900;
    --col-accent-text: #8a6800; /* akcentus szín szövegre világos háttéren (4.5:1 kontraszt) */
    --col-ink: #2a2a2a;
    --col-white: #ffffff;
    --col-red: #dc2626;
    
    --font-fallback: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-ui: 'Figtree', var(--font-fallback); /* a feliratok és az énekszövegek betűtípusa (beállítás) */
    --font-serif-fallback: Georgia, 'Times New Roman', serif;
    --font-serif: 'Old Standard TT', var(--font-serif-fallback); /* az énekszámok és az oldalcímek betűtípusa (beállítás) */

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* --- Pergamen téma (alapértelmezett) --- */
:root {
    --pergamen-bg: #F7F4EB;
    --pergamen-surface: #F3EEDB;
    --pergamen-card: #FAF7F0;
    --pergamen-border: #D8CEB7;
    --pergamen-border-dark: #B5A88B;
    --pergamen-ink: #221C18;
    --pergamen-ink-muted: #574B40;
    --pergamen-teal-dark: #123540;
    --pergamen-teal: #194C5C;
    --pergamen-teal-light: #267188;
    --pergamen-teal-wash: #E5EFF2;
    --pergamen-gold: #9E7B3B;
    --pergamen-gold-text: #826531; /* az arany sötétebb árnyalata kis betűs szövegre (4,5:1 kontraszt) */
}

/* A háttér, a szöveg, az oldalsáv és az akcentus színét az app.js állítja be témánként;
   itt a pergamen téma további szerepei. A többi témában ezek a változók nincsenek megadva,
   ott a szabályok második (eredeti) értéke érvényes. */
.theme-pergamen {
    --col-galaxy-light: var(--pergamen-teal);
    --col-papyrus-dark: var(--pergamen-surface);
    --col-card: var(--pergamen-card);
    --col-card-raised: var(--pergamen-card);
    --col-card-header: var(--pergamen-surface);
    --col-border: var(--pergamen-border);
    --col-border-dark: var(--pergamen-border-dark);
    --col-ink-muted: var(--pergamen-ink-muted);
    --col-wash: var(--pergamen-teal-wash);
    --col-focus: var(--pergamen-teal-light);
    --col-input-focus-bg: var(--pergamen-card);
    --col-nav-icon: rgba(229, 239, 242, 0.7); /* halvány türkiz a sötét oldalsávon */
    --col-modal-tint: var(--pergamen-surface);
    --col-modal-tint-soft: var(--pergamen-surface);
    --col-search-bar: var(--pergamen-surface);
    --col-float-bg: var(--pergamen-card);
    --col-success: var(--pergamen-teal-light); /* a sötét türkiz fejlécen is jól elváljon */
    --col-success-hover: var(--pergamen-teal);
}

/* --- Alapok --- */
body {
    margin: 0;
    padding: 0;
    background-color: var(--col-galaxy-blue);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
    overflow: hidden; /* App-szerű viselkedés */
}

* { box-sizing: border-box; }

button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
button:disabled { cursor: not-allowed; opacity: 0.5; }

/* Görgetősávok: régies megjelenés, a téma színeivel (a Pergamené az alapértelmezett) */
:root {
    --scrollbar-track: #EFE8D8;
    --scrollbar-thumb: #C2B597;
    --scrollbar-thumb-border: #A89874;
    --scrollbar-thumb-hover: var(--pergamen-teal);
}
.theme-papyrus { --scrollbar-track: #EEE8D5; --scrollbar-thumb: #CFC4A3; --scrollbar-thumb-border: #B0A37F; --scrollbar-thumb-hover: #073642; }
.theme-dark-papyrus { --scrollbar-track: #C9C2AF; --scrollbar-thumb: #A69A7C; --scrollbar-thumb-border: #877B5F; --scrollbar-thumb-hover: #001e26; }
.theme-white { --scrollbar-track: #EEF0F3; --scrollbar-thumb: #C6CCD5; --scrollbar-thumb-border: #A9B1BD; --scrollbar-thumb-hover: #1f2937; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border: 1px solid var(--scrollbar-thumb-border); }
::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background: var(--scrollbar-thumb-hover); }
/* Firefox nem ismeri a ::-webkit-scrollbar-t: ott vékony, a téma színeire festett sáv */
@supports not selector(::-webkit-scrollbar) {
    * { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }
}

/* --- Háttér (Beállítások → Háttér; az .app-root bg-* osztálya) ---
   Átmenet: nagyon enyhe, sugaras sötétedés a háttérszínben (belül, vagy a szélek felé). Textúra: a világos
   felületeken papírszemcse (az oldal hátterén halvány foltokkal), a türkiz oldalsávon, fejléceken és gombokon
   bőrkötés-szemcse. A textúrák SVG-zajból készülnek (feTurbulence); a keverés a színt a témából veszi, így minden
   színsémával működnek. */
:root {
    --bg-shade: 74, 56, 24; /* az átmenetek árnyalata (meleg barna) */
    --tex-paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.45  0 0 0 0 0.45  0 0 -0.36 0 0.18'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    --tex-paper-cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='c' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.008' numOctaves='3' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.6  0 0 0 0 0.6  0 0 0 0 0.6  0 0 -0.20 0 0.10'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E");
    --tex-leather: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='l' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeDiffuseLighting surfaceScale='1.6' lighting-color='%23fff'%3E%3CfeDistantLight azimuth='225' elevation='55'/%3E%3C/feDiffuseLighting%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='0.3' intercept='0.254'/%3E%3CfeFuncG type='linear' slope='0.3' intercept='0.254'/%3E%3CfeFuncB type='linear' slope='0.3' intercept='0.254'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23l)'/%3E%3C/svg%3E");
}
.theme-white { --bg-shade: 30, 41, 59; }
/* a nézetek belső, görgethető sávja átlátszó: az egész oldalon egy háttér van */
.app-root > .main-content .main-content { background-color: transparent; }
.bg-center > .main-content, .bg-center .player-view {
    background-image: radial-gradient(ellipse 75% 70% at 50% 50%, rgba(var(--bg-shade), 0.08), rgba(var(--bg-shade), 0));
}
.bg-edges > .main-content, .bg-edges .player-view {
    background-image: radial-gradient(ellipse 80% 80% at 50% 50%, rgba(var(--bg-shade), 0) 50%, rgba(var(--bg-shade), 0.12));
}
.bg-texture > .main-content, .bg-texture .player-view {
    background-image: var(--tex-paper-grain), var(--tex-paper-cloud);
    background-blend-mode: multiply;
}
.bg-texture .modal-box, .bg-texture .library-toolbar {
    background-image: var(--tex-paper-grain);
    background-blend-mode: multiply;
}
.bg-texture .sidebar, .bg-texture .header, .bg-texture .playlist-card-start-btn, .bg-texture .playlist-row-start, .bg-texture .btn-success {
    background-image: var(--tex-leather);
    background-blend-mode: soft-light;
}
/* a lejátszó világos fejléce a lejátszó hátterén ül */
.bg-center .player-view .header, .bg-edges .player-view .header, .bg-texture .player-view .header {
    background-color: transparent; background-image: none;
}

/* --- Layout --- */
.app-root { display: flex; height: 100vh; height: 100dvh; width: 100vw; overflow: hidden; }
.loading-screen { height: 100vh; height: 100dvh; display: flex; align-items: center; justify-content: center; color: var(--col-white); }

/* Oldalsáv */
.sidebar {
    width: 64px;
    background-color: var(--col-galaxy-blue);
    border-right: 1px solid var(--col-galaxy-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    z-index: 50;
    box-shadow: var(--shadow-xl);
}
.sidebar.right { order: 2; border-right: none; border-left: 1px solid var(--col-galaxy-light); }
.sidebar-group { display: flex; flex-direction: column; gap: 1rem; }

/* Menügomb (hamburger) és kihúzható menü: csak telefonon, álló helyzetben (az app.js MENU_DRAWER_QUERY-je) */
.menu-toggle, .menu-backdrop, .nav-label { display: none; }
.menu-toggle {
    flex: none; width: 40px; height: 40px; border-radius: 0.375rem;
    align-items: center; justify-content: center;
    color: var(--col-papyrus);
}
.menu-toggle:hover { background-color: rgba(255, 255, 255, 0.1); }
@media (max-width: 640px) and (orientation: portrait) {
    .sidebar {
        position: fixed; top: 0; bottom: 0; left: 0; z-index: 250;
        width: 232px; max-width: 85vw; align-items: stretch;
        padding: max(1rem, env(safe-area-inset-top)) 0.75rem max(1rem, env(safe-area-inset-bottom));
        overflow-y: auto;
        transform: translateX(-100%); visibility: hidden;
        transition: transform 0.2s ease, visibility 0s linear 0.2s;
    }
    .sidebar.right { left: auto; right: 0; transform: translateX(100%); }
    .sidebar.open { transform: none; visibility: visible; transition: transform 0.2s ease; }
    .sidebar-group { gap: 0.25rem; }
    .sidebar .nav-btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 12px; text-align: left; }
    .sidebar .nav-label { display: inline; font-size: 1rem; font-weight: 600; }
    .menu-backdrop { display: block; position: fixed; inset: 0; z-index: 240; background-color: rgba(0, 0, 0, 0.4); }
    .menu-toggle { display: inline-flex; }
    .header { column-gap: 0.5rem; }
    /* a középre igazított fejlécben a sarokban, a cím nem fut rá */
    .header.centered { position: relative; padding: 0 56px; }
    .menu-toggle.corner { position: absolute; top: 12px; }
    .menu-toggle.corner.right { right: 12px; }
    .menu-toggle.corner.left { left: 12px; }
    /* fejléc nélküli oldalon (Névjegy) a lap tetején, világos gombként */
    .menu-toggle.floating {
        position: absolute; top: 12px; z-index: 5;
        color: var(--col-galaxy-blue); background-color: var(--col-card-raised, var(--col-white));
        border: 1px solid var(--col-border, #ddd); box-shadow: var(--shadow-md);
    }
    .menu-toggle.floating.right { right: 12px; }
    .menu-toggle.floating.left { left: 12px; }
    .menu-toggle.floating:hover { background-color: var(--col-card-raised, var(--col-white)); border-color: var(--col-accent); }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar { transition: none !important; }
}

/* Fő tartalom */
.main-content {
    flex: 1;
    background-color: var(--col-papyrus);
    color: var(--col-ink);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* --- Komponensek --- */

/* Gombok */
.nav-btn {
    padding: 10px;
    border-radius: 8px;
    color: var(--col-nav-icon, #9ca3af);
    transition: color 0.2s, background-color 0.2s, box-shadow 0.2s; /* (a láthatóság ne: a kihúzható menüben rögtön fókuszálható legyen) */
}
.nav-btn:hover { color: var(--col-white); background-color: var(--col-galaxy-light); }
.nav-btn.active { background-color: var(--col-accent); color: var(--col-white); box-shadow: var(--shadow-md); }

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}
.btn-primary { background-color: var(--col-accent); color: var(--col-white); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { color: var(--col-ink-muted, #666); }
.btn-ghost:hover { background-color: rgba(0,0,0,0.05); color: var(--col-ink); }
.btn-danger { color: var(--col-ink-muted, #999); }
.btn-danger:hover { color: var(--col-red); }

/* Header */
.header {
    height: 64px;
    background-color: var(--col-galaxy-blue);
    color: var(--col-papyrus);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-bottom: 1px solid var(--col-galaxy-light);
    box-shadow: var(--shadow-md);
    z-index: 30;
    flex-shrink: 0;
}
.header h1, .header h2, .header h3 { margin: 0; }

/* Kártyák (Listákhoz) */
.card {
    background-color: var(--col-card, var(--col-papyrus));
    border: 1px solid var(--col-border, #d1d5db);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 20rem;
    position: relative;
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-xl); }
.card-decoration { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background-color: var(--col-galaxy-blue); transition: background 0.2s; }
.card:hover .card-decoration { background-color: var(--col-accent); }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 300; /* a lejátszó (200) fölött is látszódjon */
}
/* Felső elhelyezés: a szabad hely 1 : 2 arányban oszlik meg a doboz fölött és alatt */
.modal-overlay.upper { flex-direction: column; }
.modal-overlay.upper::before { content: ''; flex: 1 1 0; }
.modal-overlay.upper::after { content: ''; flex: 2 1 0; }
.modal-box {
    background-color: var(--col-papyrus);
    width: 100%; max-width: 28rem;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--col-galaxy-light);
    animation: modalFadeIn 0.2s ease-out;
    display: flex; flex-direction: column;
    max-height: 90vh;
    /* a fejléc és a lábléc háttere a lekerekített sarkoknál ne lógjon ki (a lenyíló menük és a dátumválasztó nem a
       dobozban nyílnak, azokat ez nem vágja le) */
    overflow: hidden;
}
.modal-header {
    padding: 1rem;
    background-color: var(--col-modal-tint, rgba(238, 232, 213, 0.5));
    border-bottom: 1px solid var(--col-border, #d1d5db);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-body { padding: 1.5rem; overflow-y: auto; }
.modal-footer {
    padding: 1rem;
    background-color: var(--col-modal-tint-soft, rgba(238, 232, 213, 0.3));
    border-top: 1px solid var(--col-border, #d1d5db);
    display: flex; justify-content: flex-end; gap: 0.75rem;
}

/* Kotta Nézet: nem görgethető, az előjáték és a kotta mindig egészben látszik; csak lapozni lehet */
.score-pane {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex; flex-direction: column;
    min-height: 0; min-width: 0;
    touch-action: manipulation; /* gyors koppintásnál ne várjon dupla koppintásos nagyításra */
}
.score-page {
    flex: 1; min-height: 0;
    position: relative;
    overflow: hidden;
    padding: 8px 20px;
}
/* A kottaoldal tartalma; a méretét a program úgy választja meg, hogy kiférjen (app.js: fitPage) */
.score-page-content { display: flex; flex-direction: column; align-items: center; }
.score-block { width: 100%; flex: none; }
.prelude-block {
    display: flex; flex-direction: column; align-items: center;
    margin-bottom: 0.5rem; padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--col-border-dark, #ccc);
}
.prelude-label {
    font-size: 12px; font-weight: bold; text-transform: uppercase;
    color: var(--col-accent-text, var(--col-accent));
    margin-bottom: 4px;
}
.score-missing { padding: 20px; border: 1px solid var(--col-border-dark, #ccc); border-radius: 4px; background-color: rgba(0,0,0,0.05); }
.score-placeholder { opacity: 0.2; display: flex; flex-direction: column; align-items: center; }
.verovio-viewer { width: 100%; }
/* A kotta mindig fekete (a Verovio a szöveg színével rajzol) */
.verovio-container { width: 100%; color: #000; }
/* blokk szintű SVG: különben a sor alapvonala miatt rés marad alatta (a méretét és a helyét az app.js állítja) */
.verovio-container svg { display: block; }
/* Képként tárolt kotta: a fehér háttér beleolvad a papír színébe */
.score-image-wrap { width: 100%; }
.score-image { display: block; margin: 0 auto; width: 100%; height: auto; mix-blend-mode: multiply; }
.score-loading {
    position: absolute; top: 60px; left: 50%; transform: translateX(-50%);
    background-color: rgba(255,255,255,0.95);
    padding: 10px 20px; border-radius: 8px; border: 1px solid #ccc;
    color: #333; font-weight: bold; white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 10;
}
/* Lebegő gomb (FAB) a kotta jobb alsó sarkában: fölötte nyílik a panelje (nagyítás, transzponálás, az ének oldalán az
   értékelés). Nyugalomban kissé áttetsző, hogy alatta a kotta is sejthető legyen. */
.score-fab { position: absolute; right: 12px; bottom: 12px; z-index: 15; }
.score-fab-btn {
    position: relative; width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background-color: var(--col-galaxy-blue); color: var(--col-papyrus);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25); opacity: 0.82; transition: opacity 0.15s;
}
/* A lejátszóban a kotta a terület aljáig ér, a gomb az utolsó ütemet takarhatja: nyugalomban csak egy halvány,
   körvonalas kör, hogy az alatta lévő hangjegyek az istentisztelet alatt is olvashatók maradjanak (a jelzés teljes
   színű marad). Rámutatva, fókuszban és nyitott panelnél a megszokott. */
.player-view .score-fab:not(.open) .score-fab-btn:not(:hover):not(:focus-visible) {
    opacity: 1; background-color: rgba(0, 43, 54, 0.1); color: rgba(0, 43, 54, 0.75);
    box-shadow: inset 0 0 0 1.5px rgba(0, 43, 54, 0.4);
    /* a téma színével, ahol a böngésző ismeri */
    background-color: color-mix(in srgb, var(--col-galaxy-blue) 10%, transparent);
    color: color-mix(in srgb, var(--col-galaxy-blue) 75%, transparent);
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--col-galaxy-blue) 40%, transparent);
}
.score-fab-btn:hover, .score-fab-btn:focus-visible, .score-fab.open .score-fab-btn { opacity: 1; }
.score-fab-btn:focus-visible { outline: 3px solid var(--col-focus, var(--col-accent)); outline-offset: 2px; }
/* a transzponálás jelzése a gombon (pl. „−2”), hogy zárt panelnél is látsszon */
.score-fab-badge {
    position: absolute; top: -5px; left: -7px; min-width: 24px; height: 20px; padding: 0 6px; border-radius: 10px;
    background-color: var(--col-accent); color: var(--col-white); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums;
}
.score-fab-panel {
    position: absolute; right: 0; bottom: calc(100% + 10px);
    width: max-content; min-width: 250px; max-width: calc(100vw - 32px);
    display: flex; flex-direction: column; gap: 10px; padding: 12px 14px;
    background-color: var(--col-float-bg, #fff); color: var(--col-ink);
    border: 1px solid var(--col-border, #ddd); border-radius: 12px;
    box-shadow: var(--shadow-xl), 0 2px 6px rgba(0, 0, 0, 0.12);
}
.score-fab-panel[hidden] { display: none; }
.score-fab-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.score-fab-label {
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--col-accent-text, var(--col-accent));
}
.score-fab-note { margin-top: -4px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 4px 10px; font-size: 12px; color: var(--col-ink-muted, #666); }
.score-fab-reset { font-size: 12px; font-weight: 600; color: var(--col-accent-text, var(--col-accent)); text-decoration: underline; text-underline-offset: 2px; }
.btn.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.875rem; border-radius: 0.35rem; }
.btn-outline.btn-sm { padding: calc(0.3rem - 1px) calc(0.75rem - 1px); }
.fing-fab-actions { display: flex; gap: 6px; }

/* Ujjrend szerkesztése: fölül a sáv (Kész), a kiválasztott hang kiemelve, mellette a számbillentyűzet. A számokat a
   Verovio rajzolja a kottába (MEI <fing>), így a nagyítással együtt méreteződnek. */
.score-pane.fing-editing .verovio-container g.note { cursor: pointer; }
.verovio-container g.note.fing-selected { color: var(--col-accent); fill: var(--col-accent); }
/* a sáv a kotta fölött, nem takarja (a kotta helye ennyivel kisebb, és újra kifér) */
.fing-bar {
    order: -1; flex: none; align-self: center; margin: 6px 8px 0; position: relative; z-index: 16;
    max-width: calc(100% - 16px); display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 14px;
    background-color: var(--col-float-bg, #fff); color: var(--col-ink);
    border: 1px solid var(--col-border, #ddd); border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    font-size: 0.875rem; font-weight: 600; white-space: nowrap;
}
.fing-bar-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fing-pad {
    position: absolute; z-index: 17; width: 304px; transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 6px; padding: 10px;
    background-color: var(--col-float-bg, #fff); color: var(--col-ink);
    border: 1px solid var(--col-border, #ddd); border-radius: 12px;
    box-shadow: var(--shadow-xl), 0 2px 6px rgba(0, 0, 0, 0.12);
}
.fing-pad.above { transform: translate(-50%, -100%); }
/* a kijelző: az ujjrend, a pedáljelek (a láb betűjével) és a játékmód jelei */
.fing-pad-value {
    min-height: 36px; padding: 0 8px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 10px;
    font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.06em;
    background-color: var(--col-card-raised, #fff); border: 1px solid var(--col-border, #ddd);
}
.fing-pad-value .mk-pedal sub { font-size: 0.6em; font-weight: 600; letter-spacing: 0; color: var(--col-ink-muted, #666); }
.fing-pad-value .mk-play { display: inline-flex; color: var(--col-galaxy-blue); }
/* a meglévő ujjrend, pedáljel kijelölve: az első gombnyomás felülírja */
.fing-pad-value .fresh { padding: 0 4px; border-radius: 3px; background-color: color-mix(in srgb, var(--col-accent) 28%, transparent); }
.fing-pad-label {
    margin-top: 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--col-accent-text, var(--col-accent));
}
.fing-pad-label span { margin-left: 4px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--col-ink-muted, #666); }
.fing-pad-keys { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.fing-pad-keys.pedal { grid-template-columns: repeat(4, 1fr); }
.fing-pad-keys button {
    height: 38px; border-radius: 8px; font-size: 1.1rem; font-weight: 700; color: var(--col-galaxy-blue);
    display: flex; align-items: center; justify-content: center;
    background-color: var(--col-card-raised, #fff); border: 1px solid var(--col-border, #ddd);
}
.fing-pad-keys button:hover { border-color: var(--col-accent); }
.fing-pad-keys button:active { background-color: rgba(0, 0, 0, 0.06); }
.fing-pad-keys .pedal-mark { font-size: 1.25rem; line-height: 1; }
.fing-pad-keys .pedal-side { margin-left: 3px; align-self: flex-end; margin-bottom: 7px; font-size: 0.7rem; font-weight: 600; color: var(--col-ink-muted, #666); }
/* a bekapcsolt játékmódjel */
.fing-pad-keys button[aria-pressed="true"] {
    color: var(--col-white, #fff); background-color: var(--col-accent); border-color: var(--col-accent);
}
.fing-pad-actions { display: flex; justify-content: space-between; gap: 8px; }

/* Csillagos értékelés: a kitöltött csillagok az akcentus színével (egérrel fölé állva előnézet) */
.star-rating { display: flex; align-items: center; }
.star-btn {
    width: 26px; height: 32px; display: flex; align-items: center; justify-content: center;
    color: var(--col-border-dark, #b5a88b); border-radius: 4px;
}
.star-btn svg { fill: none; transition: fill 0.1s; }
.star-btn.on { color: var(--col-accent); }
.star-btn.on svg { fill: currentColor; }
.star-rating.previewing .star-btn.on { opacity: 0.7; }
.star-btn:focus-visible { outline: 2px solid var(--col-focus, var(--col-accent)); outline-offset: -2px; }
.rating-stars { display: inline-flex; flex: none; gap: 1px; color: var(--col-border-dark, #b5a88b); }
.rating-stars svg.on { color: var(--col-accent); fill: currentColor; }
/* a letétválasztó sora: balra a név és az adatok, jobbra az értékelés */
.variation-option { display: flex; align-items: center; gap: 10px; }
.variation-option-text { flex: 1; min-width: 0; }
/* Nagyítás és transzponálás a panelen: − érték + */
.zoom-bar, .transpose-bar {
    display: flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.35rem;
    background-color: var(--col-card-raised, #fff); border: 1px solid var(--col-border, #ddd); border-radius: 30px;
}
.zoom-bar button, .transpose-bar button {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: bold; line-height: 1; color: var(--col-galaxy-blue);
}
.zoom-bar button:hover:not(:disabled), .transpose-bar button:hover:not(:disabled) { background-color: rgba(0, 0, 0, 0.06); }
.zoom-bar button:disabled, .transpose-bar button:disabled { opacity: 0.3; cursor: default; }
.zoom-bar span, .transpose-value {
    width: 52px; text-align: center; font-size: 0.95rem; font-weight: bold; color: var(--col-galaxy-blue);
    font-variant-numeric: tabular-nums;
}

/* Form elemek */
.input {
    width: 100%; padding: 0.75rem 1rem;
    background-color: var(--col-papyrus-dark);
    border: 1px solid var(--col-border, #d1d5db);
    border-radius: 0.5rem;
    font-size: 1rem;
    outline: none;
    color: var(--col-ink);
}
.input:focus { background-color: var(--col-input-focus-bg, var(--col-white)); border-color: var(--col-focus, var(--col-accent)); }
.input.search {
    padding-left: 2.5rem;
}

/* Typography */
.text-accent { color: var(--col-accent-text); }
.header .text-accent { color: var(--col-accent); }
.player-view .header .text-accent { color: var(--col-accent-text); }
.text-galaxy { color: var(--col-galaxy-blue); }

/* Inaktív kártya halványítása */
.card.inactive {
    opacity: 0.6;
    filter: grayscale(0.5); /* Kicsit szürkébbé teszi az inaktív kártyát */
}

/* Animált Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--col-border-dark, #ccc);
    transition: .3s;
    border-radius: 24px;
}
.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
.toggle-switch input:checked + .slider {
    background-color: var(--col-accent);
}
.toggle-switch input:checked + .slider:before {
    transform: translateX(20px);
}


/* Animáció */
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Refactor styles --- */

.modal-header h3 {
    margin: 0;
}
.modal-body {
    flex: 1;
}

/* Other components */
.btn-danger-solid {
    background-color: var(--col-red);
    color: white;
}
/* Clickable cursor */
.clickable {
    cursor: pointer;
}

.card.clickable {
    cursor: pointer;
}
.card.clickable:hover {
    box-shadow: var(--shadow-xl);
    border-color: var(--col-accent);
}

.btn-success {
    background-color: var(--col-success, #16a34a);
    color: white;
}
.btn-success:hover {
    background-color: var(--col-success-hover, #15803d);
}

/* Header variations */
.header.centered {
    justify-content: center;
}

.player-view .header {
    background-color: var(--col-papyrus);
    color: var(--col-ink);
    border-bottom-color: var(--col-border-dark, #aaa);
}

/* Lejátszó fejléce: bal oldalon a lista sorszáma (1/4), jobb oldalon az óra */
.player-heading { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; min-width: 0; }
.player-heading-main { display: flex; align-items: baseline; gap: 8px; flex: 0 1 auto; min-width: 0; max-width: 100%; }
.player-heading-main > * { flex-shrink: 0; }
.player-heading-main > h3 { flex-shrink: 1; min-width: 0; }
/* a jobb oldali belső margó helyet ad a dőlt utolsó betű kilógó részének (az overflow különben levágná) */
.player-heading-info { flex: 0 1 auto; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 0.3em; }
.player-position { font-weight: 600; color: var(--col-ink-muted, #666); white-space: nowrap; }
.player-position-sep { color: var(--col-ink-muted, #666); opacity: 0.6; }
.player-header-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; margin-left: 0.75rem; }
/* gyors megnyitás (számbillentyűzet ikon): ugyanolyan halvány háttér, mint az óráé */
.player-quick-open {
    position: relative; width: 44px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 0.5rem; color: var(--col-ink); touch-action: manipulation;
}
.player-quick-open::before, .player-clock::before {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    border-radius: inherit; background-color: currentColor; opacity: 0.08; pointer-events: none;
}
.player-quick-open:active::before { opacity: 0.16; }
.player-clock {
    position: relative; flex-shrink: 0; height: 40px; display: flex; align-items: center;
    padding: 0 0.65rem; border-radius: 0.5rem;
    font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
    color: var(--col-ink);
}
.player-view {
    position: fixed;
    inset: 0;
    z-index: 200;
    background-color: var(--col-papyrus);
    color: var(--col-ink);
    display: flex;
    flex-direction: column;
}

/* Card variations */
.card.card-row {
    height: auto;
    min-height: auto;
    flex-direction: row;
    padding: 1rem;
    align-items: center;
    gap: 2rem;
    justify-content: flex-start;
}

.card.list-item {
    height: auto;
    min-height: auto;
    flex-direction: row;
    padding: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

/* --- Könyvtár: kereső, kulcsszavas szűrő, énekkártyák --- */
.library-toolbar {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
    padding: 0.5rem 1rem; border-bottom: 1px solid var(--col-border, #ddd);
    background-color: var(--col-search-bar, rgba(0,0,0,0.02));
}
.library-search { position: relative; flex: 0 1 600px; min-width: 0; }
.library-search-icon { position: absolute; top: 10px; left: 12px; z-index: 1; color: var(--col-ink-muted, #999); pointer-events: none; }
.library-search .input { padding-left: 40px; height: 40px; }
.library-keyword { flex: 0 0 auto; max-width: 100%; }
.library-keyword .custom-select-btn { height: 40px; width: 100%; padding-left: 0.75rem; }
.library-keyword.active .custom-select-btn { border-color: var(--col-accent); font-weight: 600; }
/* a kulcsszó-szűrő menüjében a kulcsszó mellett jobbra az énekek száma */
.keyword-option { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.keyword-option-name { font-weight: 600; color: var(--col-galaxy-blue); }
.keyword-option-count { font-size: 0.8rem; color: var(--col-ink-muted, #666); font-variant-numeric: tabular-nums; }
.custom-select-option:has(.keyword-option) { padding: 8px 10px; }
@media (max-width: 640px) {
    .library-search, .library-keyword { flex: 1 1 100%; }
}
.library-result-count {
    display: flex; align-items: center; gap: 12px; margin: 0 0 0.5rem 0.25rem;
    font-size: 0.85rem; font-weight: 600; color: var(--col-ink-muted, #666);
}
.library-clear { font-size: 0.85rem; text-decoration: underline; padding: 0; }
.library-empty { text-align: center; color: var(--col-ink-muted, #666); margin-top: 2rem; }
/* Énekkártya: balra a szám és a kezdősor (egy alapvonalon), jobbra zárva a kották száma, alatta a kulcsszavak */
.card.list-item.hymn-card { gap: 1rem; padding: 0.7rem 1rem; }
.hymn-card-head { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 1rem; }
.hymn-card-number { flex: none; min-width: 3.25rem; text-align: right; font-size: 1.6rem; line-height: 1; }
.hymn-card-title { min-width: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.hymn-card-meta {
    flex: 0 1 auto; max-width: 45%; display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
    text-align: right; font-size: 0.8rem; color: var(--col-ink-muted, #666);
}
.hymn-card-counts { white-space: nowrap; }
.hymn-card-counts.none { opacity: 0.7; font-style: italic; }
/* kulcsszavak: finoman, dőlten; koppintásra csak az ilyen kulcsszavú énekek látszanak */
.hymn-card-keywords { font-style: italic; line-height: 1.4; }
.keyword-link { font: inherit; color: inherit; padding: 2px 0; white-space: nowrap; text-underline-offset: 2px; }
.keyword-link:hover { color: var(--col-ink); text-decoration: underline; }
.keyword-link.active { color: var(--col-accent-text); font-weight: 600; text-decoration: underline; }
.hymn-card-chevron { flex: none; align-self: center; color: var(--col-border-dark, #ccc); }
@media (max-width: 640px) {
    .card.list-item.hymn-card, .hymn-card-head { gap: 0.6rem; }
    .card.list-item.hymn-card { padding: 0.6rem 0.75rem; }
    .hymn-card-number { min-width: 2.4rem; font-size: 1.35rem; }
    .hymn-card-title { font-size: 1.02rem; }
    .hymn-card-meta { max-width: 42%; font-size: 0.75rem; }
}
/* Keskeny kijelzőn a cím mellett nincs hely: a kották száma és a kulcsszavak a cím alá kerülnek, jobbra zárva */
@media (max-width: 600px) {
    .card.list-item.hymn-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 0.5rem; }
    .hymn-card-meta { grid-row: 2; max-width: none; flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; column-gap: 10px; }
    .hymn-card-chevron { grid-column: 2; grid-row: 1 / span 2; }
}

.playlist-editor-list { max-width: 1000px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.playlist-editor-item {
    position: relative;
    background-color: var(--col-card-raised, white);
    padding: 0.5rem 1rem 0.5rem 0.25rem;
    min-height: 68px;
    border-radius: 8px;
    border: 1px solid var(--col-border, #ddd);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: grab;
    user-select: none; -webkit-user-select: none;
}
/* fogantyú: érintéssel ezzel lehet megfogni (itt a böngésző nem görget) */
.playlist-editor-grip {
    flex: none; width: 40px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    color: var(--col-border-dark, #ccc); touch-action: none;
}
.playlist-editor-item:hover .playlist-editor-grip { color: var(--col-ink-muted, #666); }
/* az ének gombjai: szerkesztés (versszakok, letét, előjáték) és törlés; a sorra kattintva is a szerkesztés nyílik meg */
.playlist-editor-item:hover { border-color: var(--col-border-dark, #bbb); }
.playlist-editor-item-actions { flex: none; display: flex; align-items: center; gap: 2px; }
.playlist-editor-item-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 0.375rem; }
.playlist-editor-item-btn.btn-danger:hover { background-color: rgba(0, 0, 0, 0.05); }
.edit-missing-score { margin-top: -0.5rem; }
.playlist-editor-scroll { padding: 2rem; overflow-y: auto; }
.playlist-editor-item-main { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
/* telefonon keskenyebb szegély, fogantyú és gombok, hogy az ének címének több hely jusson */
@media (max-width: 640px) {
    .playlist-editor-scroll { padding: 1rem 0.75rem; }
    .playlist-editor-item-main { gap: 0.4rem; }
    .playlist-editor-grip { width: 30px; }
    .playlist-editor-item-btn { width: 34px; }
}
/* húzás közben: a megfogott elem kiemelve, a többi simán húzódik a helyére */
.playlist-editor-list.reordering .playlist-editor-item { transition: transform 0.15s ease; }
.playlist-editor-list.reordering .playlist-editor-item.dragging {
    transition: none; z-index: 5; cursor: grabbing;
    box-shadow: var(--shadow-xl), 0 4px 10px rgba(0, 0, 0, 0.15); border-color: var(--col-accent);
}

/* About view */
.about-view {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4rem;
    text-align: center;
}
.about-logo { display: block; width: 180px; max-width: 60%; height: auto; margin: 0 auto 1.75rem; color: var(--col-galaxy-blue); }
.about-view .content-box {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--col-card-raised, white);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    text-align: left;
}
.about-view .content-box p {
    line-height: 1.6;
    margin: 0;
}
/* Útmutató és hibabejelentés: két gomb egymás mellett (keskeny kijelzőn egymás alatt) */
.about-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; max-width: 600px; margin: 1.5rem auto 0; }
.about-actions .btn { justify-content: center; min-width: 13.5rem; }
.about-feedback-note { max-width: 600px; margin: 0.75rem auto 0; font-size: 14px; color: var(--col-ink-muted, #666); }
.about-feedback-note a { color: var(--col-accent-text, var(--col-accent)); font-weight: 600; }
.about-credits { max-width: 600px; margin: 1.25rem auto 0; font-size: 13px; color: var(--col-ink-muted, #666); }
.about-credits a { color: inherit; }

/* Verse item in AddToPlaylistModal */
.verse-item {
    padding: 8px;
    border-bottom: 1px solid var(--col-border, #eee);
    cursor: pointer;
    display: flex;
    gap: 10px;
    align-items: center;
    background-color: var(--col-card-raised, white);
}
.verse-item:last-child {
    border-bottom: none;
}
.verse-item.selected {
    background-color: var(--col-wash, #e6f4f1);
}
.verse-item-text { min-width: 0; }
.verse-item-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Listanév mező, előtte a dátumválasztó gomb; a natív dátumválasztó a gomb helyén nyílik meg */
.list-name-field { position: relative; display: flex; gap: 6px; }
.list-name-field .clearable { flex: 1; min-width: 0; }
/* Szövegmező törlőgombbal (app.js: ClearableInput): az X a mező jobb szélén, ha van benne szöveg */
.clearable { position: relative; display: block; }
.clearable > .input { width: 100%; padding-right: 40px; }
.input-clear {
    position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--col-ink-muted, #666);
}
.input-clear:hover { background-color: rgba(0, 0, 0, 0.06); color: var(--col-ink); }
.list-name-date {
    flex: none; width: 44px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--col-border-dark, #bbb); border-radius: 0.375rem;
    background-color: var(--col-card-raised, #fff); color: var(--col-accent-text);
}
.list-name-date:hover { border-color: var(--col-accent); }
.list-name-date-input { position: absolute; left: 0; top: 0; width: 44px; height: 100%; opacity: 0; pointer-events: none; }

/* Kotta nélküli ének: az üzenet a kotta helyén, a szövegpanel mellette ugyanúgy látszik */
.score-empty {
    flex: 1; min-width: 0; min-height: 0; padding: 1rem; text-align: center;
    display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0.5;
}
/* Szövegpanel (lent vagy oldalt): eszköztár és a görgethető szöveg. A méretét és a betűméretét énekenként lehet
   állítani (app.js: ScoreViewer); húzás közben a méretet a --drag-size adja. */
.lyrics-panel { flex: none; display: flex; flex-direction: column; background-color: var(--col-papyrus); z-index: 20; }
.lyrics-panel.bottom { width: 100%; border-top: 1px solid var(--col-border, #ddd); box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1); }
.lyrics-panel.side { height: 100%; border-left: 1px solid var(--col-border, #ddd); box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1); }
.lyrics-panel.bottom.resizing { height: var(--drag-size) !important; min-height: 0 !important; max-height: none !important; }
.lyrics-panel.side.resizing { width: var(--drag-size) !important; min-width: 0 !important; }
.lyrics-panel.resizing { user-select: none; -webkit-user-select: none; }
.lyrics-toolbar { flex: none; display: flex; align-items: center; gap: 4px; padding: 2px 4px; border-bottom: 1px dashed var(--col-border, #eee); }
/* lent: az átméretező fogantyú középen, a gombok jobbra; oldalt a fogantyú a bal szélen */
.lyrics-panel.bottom .lyrics-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; }
.lyrics-toolbar-buttons { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.lyrics-tool {
    min-width: 32px; height: 30px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; color: var(--col-ink-muted, #666);
}
.lyrics-tool:hover:not(:disabled) { background-color: rgba(0, 0, 0, 0.06); color: var(--col-ink); }
.lyrics-font-btn { font-family: var(--font-serif); font-weight: 700; font-size: 15px; line-height: 1; gap: 1px; }
.lyrics-font-t { font-size: 18px; }
.lyrics-font-t.small { font-size: 13px; }
.lyrics-tool-sep { width: 1px; height: 18px; margin: 0 4px; background-color: var(--col-border, #ddd); }
.lyrics-resize {
    display: flex; align-items: center; justify-content: center;
    width: 88px; height: 30px; border-radius: 6px;
    cursor: row-resize; touch-action: none;
}
.lyrics-resize::before {
    content: ''; width: 44px; height: 5px; border-radius: 3px;
    background-color: var(--col-border-dark, #b5a88b); transition: background-color 0.15s;
}
.lyrics-panel.side .lyrics-resize { width: 30px; cursor: col-resize; }
.lyrics-panel.side .lyrics-resize::before { width: 5px; height: 22px; }
.lyrics-resize:hover::before, .lyrics-panel.resizing .lyrics-resize::before { background-color: var(--col-accent); }
.lyrics-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem; font-size: calc(var(--lyrics-scale, 1) * 1rem); }
/* A fülek (Szöveg / Megjegyzések): lent a gombok sorában balra, oldalt (ahol a sor bal szélén a fogantyú van) a gombok
   fölött, saját sorban */
.lyrics-tabs { display: flex; align-items: stretch; gap: 2px; min-width: 0; justify-self: start; }
.lyrics-tab {
    height: 30px; padding: 0 10px; border-radius: 6px 6px 0 0; white-space: nowrap;
    font-size: 13px; font-weight: 600; color: var(--col-ink-muted, #666);
    border-bottom: 2px solid transparent;
}
.lyrics-tab:hover { color: var(--col-ink); background-color: rgba(0, 0, 0, 0.04); }
.lyrics-tab.active { color: var(--col-ink); border-bottom-color: var(--col-accent); }
.lyrics-tab-dot { display: inline-block; width: 6px; height: 6px; margin-left: 5px; vertical-align: 2px; border-radius: 50%; background-color: var(--col-accent); }
.lyrics-panel.side .lyrics-toolbar { flex-wrap: wrap; row-gap: 2px; }
.lyrics-panel.side .lyrics-tabs { flex: 1 0 100%; }
/* A panel méretét (alapméretben) a Szöveg lap adja, mint eddig; a Megjegyzések lap ugyanezt a területet tölti ki, és
   görgethető. A nem látható lap a helyén marad (rejtve), így fülváltáskor a panel mérete nem változik. */
.lyrics-tabpanes { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.lyrics-tabpanes > .lyrics-scroll.notes { position: absolute; inset: 0; }
.lyrics-tabpanes > .lyrics-scroll.inactive { visibility: hidden; }

/* Megjegyzések lap: leírás, megjegyzés, regisztráció; lent egymás mellett (ha elfér), oldalt egymás alatt. A méretek
   em-ben, hogy a T−/T+ betűmérettel együtt nőjenek. */
.hymn-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(14em, 1fr)); gap: 0.9em 1.75em; align-items: start; }
.lyrics-panel.side .hymn-notes { grid-template-columns: minmax(0, 1fr); }
.hymn-notes-section { min-width: 0; }
.hymn-notes-title {
    margin: 0 0 0.4em; font-size: 0.72em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--col-accent-text, var(--col-accent));
}
/* az ének adatai (igehely, szöveg, fordítás, dallam, forrás): címke és érték soronként, alattuk a szabad leírás */
.hymn-info { margin: 0 0 0.55em; }
.hymn-info:last-child { margin-bottom: 0; }
.hymn-info-row { display: flex; align-items: baseline; gap: 0.6em; padding: 0.12em 0; }
.hymn-info-label { flex: none; width: 7.2em; font-size: 0.85em; color: var(--col-ink-muted, #666); }
.hymn-info-value { margin: 0; min-width: 0; overflow-wrap: break-word; line-height: 1.35; }
.lyrics-panel.side .hymn-info-row { flex-direction: column; gap: 0; }
.lyrics-panel.side .hymn-info-label { width: auto; font-size: 0.75em; }
.hymn-notes-desc { margin: 0 0 0.55em; line-height: 1.4; }
.hymn-notes-desc:last-child { margin-bottom: 0; }
.hymn-notes-empty { margin: 0; font-size: 0.9em; font-style: italic; color: var(--col-ink-muted, #666); }
/* a megjegyzés és a regisztráció koppintásra szerkeszthető */
.hymn-notes-edit {
    display: block; width: 100%; padding: 0.45em 0.65em; text-align: left; font: inherit; color: inherit; cursor: text;
    background-color: var(--col-card-raised, rgba(255, 255, 255, 0.5)); border: 1px dashed var(--col-border-dark, #bbb); border-radius: 0.4em;
}
.hymn-notes-edit:hover { border-color: var(--col-accent); }
.hymn-notes-registration:has(.hymn-notes-reg-row:hover) { border-color: var(--col-accent); } /* (külön: ahol nincs :has, csak ez marad el) */
.hymn-notes-note { display: block; white-space: pre-wrap; overflow-wrap: break-word; line-height: 1.4; }
.hymn-notes-registration { padding: 0.15em 0.65em; }
.hymn-notes-reg-row {
    display: flex; align-items: baseline; gap: 0.6em; width: 100%; padding: 0.3em 0; text-align: left;
    font: inherit; color: inherit; cursor: text; border-bottom: 1px dotted var(--col-border, #ddd);
}
.hymn-notes-reg-row:last-child { border-bottom: none; }
.hymn-notes-reg-label { flex: none; width: 5.6em; font-size: 0.85em; color: var(--col-ink-muted, #666); }
.hymn-notes-reg-value { min-width: 0; overflow-wrap: break-word; line-height: 1.35; }
.hymn-notes-reg-value.empty { color: var(--col-ink-muted, #999); }
/* az oldalsó (keskeny) panelen a manuál neve a regisztráció fölött */
.lyrics-panel.side .hymn-notes-reg-row { flex-direction: column; gap: 0; }
.lyrics-panel.side .hymn-notes-reg-label { width: auto; font-size: 0.75em; }

/* A megjegyzés és a regisztráció szerkesztője: a látható terület tetején (az app.js a visualViewport szerint helyezi
   el), így a képernyő-billentyűzet nem takarja; kevés helyen a szövegmező összemegy, a tartalom görgethető */
.note-sheet-overlay { position: fixed; inset: 0; z-index: 310; background-color: rgba(0, 0, 0, 0.45); }
.note-sheet {
    position: absolute; left: 50%; transform: translateX(-50%); width: min(720px, calc(100% - 16px));
    display: flex; flex-direction: column; overflow: hidden;
    background-color: var(--col-papyrus); color: var(--col-ink);
    border: 1px solid var(--col-galaxy-light); border-radius: 0.75rem; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}
.bg-texture .note-sheet { background-image: var(--tex-paper-grain); background-blend-mode: multiply; }
.note-sheet-header {
    flex: none; display: flex; align-items: baseline; gap: 0.5rem; padding: 0.55rem 1rem;
    background-color: var(--col-modal-tint, rgba(238, 232, 213, 0.5)); border-bottom: 1px solid var(--col-border, #d1d5db);
}
.note-sheet-header .hymn-number { font-size: 1.35rem; line-height: 1; }
.note-sheet-hymn { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-sheet-kind { flex: none; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--col-accent-text); }
.note-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.note-sheet-text { flex: 1 1 auto; height: 11em; min-height: 4.5em; resize: none; line-height: 1.4; padding: 0.6rem 0.75rem; }
.note-sheet-reg { display: flex; align-items: center; gap: 0.75rem; }
.note-sheet-reg-label { flex: none; width: 6.2em; font-size: 0.9rem; font-weight: 600; color: var(--col-ink-muted, #666); }
.note-sheet-reg .input { padding: 0.5rem 0.75rem; }
.note-sheet-footer {
    flex: none; display: flex; justify-content: flex-end; gap: 0.75rem; padding: 0.55rem 1rem;
    background-color: var(--col-modal-tint-soft, rgba(238, 232, 213, 0.3)); border-top: 1px solid var(--col-border, #d1d5db);
}

/* Szöveg: versszakonként a száma, mellette a szöveg (a nézeteket lásd a LyricsVerse-nél, app.js). A távolságok
   em-ben vannak, hogy a betűmérettel együtt nőjenek. */
.lyrics-verse {
    display: flex; gap: 0.45em; margin-bottom: 1em; padding-left: 10px;
    border-left: 3px solid var(--col-border, #eee); line-height: 1.4;
}
.lyrics-verse-label { flex: none; min-width: 1.2em; font-weight: 700; color: var(--col-ink-muted, #666); font-variant-numeric: tabular-nums; }
.lyrics-verse-lines { min-width: 0; }
.lyrics-refrain-label { font-size: 0.85em; font-weight: 600; color: var(--col-ink-muted, #666); }
.lyrics-refrain { font-style: italic; }
/* oldalt: a hosszú sor behúzással törik a következő sorba */
.lyrics-verse.side .lyrics-line { padding-left: 1em; text-indent: -1em; }
.lyrics-verse.side .lyrics-refrain-label, .lyrics-verse.columns .lyrics-refrain-label { margin-top: 0.3em; }
/* lent, egymás mellett: a versszak oszlopa olyan széles, mint a leghosszabb sora, a sorok nem törnek */
.lyrics-columns { display: flex; gap: 2em; align-items: flex-start; width: max-content; }
.lyrics-verse.columns { flex: none; margin-bottom: 0; }
.lyrics-verse.columns .lyrics-line { white-space: nowrap; }
.lyrics-verse.refrain .lyrics-verse-label { font-size: 0.85em; line-height: 1.65; }
/* lent, egymás alatt: a versszak sorai folyó szövegként */
.lyrics-verse.block { display: block; margin-bottom: 0.6em; }
.lyrics-paragraph { margin: 0; }
.lyrics-paragraph + .lyrics-paragraph { margin-top: 0.2em; }
.lyrics-paragraph .lyrics-verse-label, .lyrics-paragraph .lyrics-refrain-label { display: inline; }
/* Ha a panelen még van szöveg lejjebb (folyó szöveg) vagy jobbra (oszlopok), árnyék jelzi. A görgetéssel együtt
   mozgó („local”) takaró színátmenetek a szöveg elején és végén eltakarják az árnyékot. */
.lyrics-scroll.block {
    background:
        linear-gradient(var(--col-papyrus) 30%, transparent) top / 100% 2.5rem no-repeat local,
        linear-gradient(transparent, var(--col-papyrus) 70%) bottom / 100% 2.5rem no-repeat local,
        radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.18), transparent) top / 100% 0.75rem no-repeat scroll,
        radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.18), transparent) bottom / 100% 0.75rem no-repeat scroll;
}
.lyrics-scroll.columns {
    background:
        linear-gradient(to right, var(--col-papyrus) 30%, transparent) left / 2.5rem 100% no-repeat local,
        linear-gradient(to left, var(--col-papyrus) 30%, transparent) right / 2.5rem 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.18), transparent) left / 0.75rem 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.18), transparent) right / 0.75rem 100% no-repeat scroll;
}

/* HymnSelectorModal */
.hymn-selector-search {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--col-border, #ddd);
    margin-bottom: 0.5rem;
    position: relative;
}
.hymn-selector-search .search-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1; /* a törlőgombos mező (.clearable) fölött */
    color: var(--col-ink-muted, #999);
    pointer-events: none;
}
.hymn-selector-list {
    display: flex;
    flex-direction: column;
}
.hymn-selector-list .icon-plus {
    color: var(--col-border-dark, #ccc);
}

.hymn-selector-item {
    width: 100%;
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid var(--col-border, #eee);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0.25rem;
}
.hymn-selector-item:hover {
    background-color: var(--col-wash, #f3f4f6); /* gray-100 */
}
.hymn-selector-item:last-child {
    border-bottom: none;
}
.hymn-selector-item-hymn-number {
    display: inline-block; min-width: 2em; text-align: right; /* a címek egy vonalban kezdődjenek */
    font-size: 1.1em;
    color: var(--col-accent-text);
    margin-right: 0.6rem;
}
.hymn-selector-item-hymn-title {
    color: var(--col-ink);
    font-weight: 500; /* font-medium */
}
.hymn-selector-empty { padding: 1rem; text-align: center; font-style: italic; color: var(--col-ink-muted, #999); }

/* Énekválasztó számbillentyűzettel: bal oldalon a kereső és a lista, jobb oldalon a billentyűzet.
   Az ablak magasságát a billentyűzet adja, a lista ebben görget. */
.hymn-picker { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 1rem; }
.hymn-picker-search { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.hymn-picker-results { position: relative; flex: 1; min-height: 200px; }
.hymn-picker-results .hymn-selector-list { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow-y: auto; }
.hymn-keypad {
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px; border-radius: 0.5rem;
    background-color: rgba(0, 0, 0, 0.035);
}
.hymn-keypad-label {
    text-align: center; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--col-ink-muted, #666);
}
.hymn-keypad-display {
    height: 60px; display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem; font-weight: 700; color: var(--col-ink);
    background-color: var(--col-card-raised, #fff);
    border: 1px solid var(--col-border-dark, #bbb); border-radius: 0.375rem;
}
.hymn-keypad-hint {
    min-height: 1.25rem; text-align: center; font-size: 0.85rem; font-style: italic;
    color: var(--col-ink-muted, #666);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hymn-keypad-hint.not-found { color: var(--col-red); font-weight: 700; }
.hymn-keypad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hymn-keypad-grid button {
    height: 56px; display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 700; color: var(--col-ink);
    background-color: var(--col-card-raised, #fff);
    border: 1px solid var(--col-border, #ddd); border-radius: 0.375rem;
    touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.hymn-keypad-grid button:active { background-color: var(--col-border, #ddd); }
.hymn-keypad-grid .hymn-keypad-clear {
    font-family: inherit; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--col-red);
}
.hymn-keypad-open { height: 52px; justify-content: center; touch-action: manipulation; }
.hymn-keypad-open:disabled { opacity: 0.5; cursor: default; }
/* keskeny kijelzőn a billentyűzet kerül felülre (a megnyitás gomb görgetés nélkül is látszik), alatta a kereső */
@media (max-width: 640px) {
    .hymn-picker { grid-template-columns: 1fr; }
    .hymn-keypad { order: -1; }
    .hymn-picker-results { flex: none; height: 28vh; min-height: 140px; }
}
@media (max-height: 640px) {
    .hymn-keypad-grid button { height: 46px; }
    .hymn-keypad-display { height: 50px; }
}


/* PlaylistEditor */
.playlist-editor-empty {
    text-align: center;
    margin-top: 3rem;
    color: var(--col-ink-muted, #999);
}
.playlist-editor-empty .icon {
    opacity: 0.2;
    margin: 0 auto;
}
.playlist-editor-empty p {
    font-style: italic;
    margin-top: 1rem;
}
.playlist-editor-add-btn {
    border: 2px dashed var(--col-border-dark, #ccc);
    color: var(--col-ink-muted, #666);
    width: 100%;
    max-width: 400px;
    justify-content: center;
}

/* Playlist card */
.playlist-card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--col-border, #ddd);
    background-color: var(--col-card-header, rgba(0,0,0,0.03));
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* Lista kártyáján az énekek: a talpas énekszám (jobbra zárt oszlopban) és a cím egy alapvonalon */
.playlist-card-item {
    padding: 4px 1rem;
    font-size: 13px;
    border-bottom: 1px dashed var(--col-border, #eee);
    display: flex;
    align-items: baseline;
    gap: 0.6em;
}
.playlist-card-item:last-child {
    border-bottom: none;
}
.playlist-card-item .hymn-number { flex-shrink: 0; min-width: 1.9em; text-align: right; font-size: 1.3em; line-height: 1.2; }
.playlist-card-item-title {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--col-ink-muted, #666);
    font-style: italic;
}
.playlist-card-start-btn {
    background-color: var(--col-galaxy-light);
    color: white;
    width: 100%;
    justify-content: center;
}


/* --- Typography --- */
.header-title {
    font-weight: bold;
    color: var(--col-accent);
}
.header-title.main {
    font-size: 1.25rem; /* text-xl */
    white-space: nowrap;
}
/* Énekszámok és oldalcímek: talpas betű (--font-serif), a régi korálkönyvek mintájára. A választható betűk
   nagybetű-magassága eltér; a font-size-adjust egyforma nagyra hozza őket (ahol a böngésző ismeri). */
.hymn-number, .page-title { font-family: var(--font-serif); font-weight: 700; font-size-adjust: cap-height 0.7; }
.hymn-number { font-variant-numeric: lining-nums tabular-nums; }
.header-title.page-title { font-size: 1.5rem; letter-spacing: 0.01em; }

/* --- Scorebook View --- */
/* Nagyobb kijelzőn több oszlop: egy kártya legalább 440 px széles (1280 px-es tableten fekve 2, 1600 px-en 3 oszlop) */
.scorebook-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr));
    gap: 1rem;
    max-width: 1520px;
    margin: 0 auto;
    width: 100%;
}

/* Kártya: balra fent a cím és az adatok, alatta a leírás és a letöltés (a sor aljára igazítva, így egy sorban a
   gombok egy vonalba kerülnek), jobbra a borító. Egy sorban a kártyák egyforma magasak. */
.card.list-item.scorebook-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(140px, 50%, 320px);
    grid-template-rows: auto 1fr;
    grid-template-areas: "main cover" "body cover";
    align-items: stretch;
    min-height: 12rem;
    margin: 0;
    padding: 0;
    cursor: default;
}

.card.inactive .card-decoration {
    background-color: #999 !important;
}

.scorebook-main { grid-area: main; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 0.9rem 0.75rem 0 1.15rem; }
.scorebook-body { grid-area: body; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 4px 0.75rem 0.9rem 1.15rem; }
.scorebook-body > .scorebook-status { margin-top: auto; }

.scorebook-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scorebook-title {
    margin: 0;
    font-size: 1rem;
}

.scorebook-toggle {
    flex: none;
    transform: scale(0.8);
    margin: 0;
}

.scorebook-details {
    font-size: 0.8rem;
    color: var(--col-ink-muted, #666);
}

.scorebook-description {
    font-size: 0.75rem;
    color: var(--col-ink-muted, #888);
    line-height: 1.2;
}

.scorebook-empty {
    justify-content: center;
    cursor: default;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* A kártya kattintható: a könyv adatlapja nyílik meg (billentyűzettel a cím gombja) */
.card.list-item.scorebook-item.clickable { cursor: pointer; }
.scorebook-open {
    padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.scorebook-open:focus-visible { outline: 2px solid var(--col-accent); outline-offset: 2px; border-radius: 2px; }
.scorebook-import { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin: 0 auto 1rem; }
.scorebook-import a.btn { text-decoration: none; }

/* A könyv adatlapja: balra a borító, jobbra az adatai, alatta énekszám szerint a letétek és az előjátékok */
.book-details { display: flex; flex-direction: column; gap: 1rem; }
.book-details-head { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.book-details-head .scorebook-cover { grid-area: auto; height: 300px; border-radius: 0.5rem; }
.book-details-info { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.book-details-title { margin: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.25; }
.book-details-author { font-weight: 600; }
.book-details-total { font-size: 0.9rem; color: var(--col-ink-muted, #666); }
.book-details-description { margin: 0.25rem 0 0; line-height: 1.4; white-space: pre-line; }
.book-details-copyright { font-size: 0.8rem; color: var(--col-ink-muted, #666); }
.book-details-section { padding-top: 0.75rem; border-top: 1px solid var(--col-border, #d1d5db); }
.book-details-section h4 { margin: 0 0 0.4rem; font-size: 1rem; font-weight: 700; }
.book-details-count { font-weight: 400; font-size: 0.85rem; color: var(--col-ink-muted, #666); }
.book-details-numbers { margin: 0; line-height: 1.6; }
.book-details-number { white-space: nowrap; }
.book-details-number .hymn-number { color: var(--col-accent-text, var(--col-accent)); }
.book-details-multi { font-size: 0.85rem; color: var(--col-ink-muted, #666); }
.book-details-none { margin: 0; color: var(--col-ink-muted, #666); }
@media (max-width: 640px) {
    .book-details-head { grid-template-columns: 110px minmax(0, 1fr); gap: 0.9rem; }
    .book-details-head .scorebook-cover { height: 165px; }
    .book-details-title { font-size: 1.1rem; }
}

/* Kottakönyv importálása: előnézet */
.book-import-file { align-self: center; font-size: 0.85rem; color: var(--col-ink-muted, #666); overflow-wrap: anywhere; }
.book-import-title { font-weight: 700; }
.book-import-maker {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.6rem 0.75rem;
    border-radius: 0.5rem; background-color: var(--col-wash, rgba(0,0,0,0.04)); font-size: 0.85rem;
}
.book-import-maker span { flex: 1 1 14rem; }
.book-import-maker a.btn { text-decoration: none; font-size: 0.875rem; }
.book-import-detail { font-size: 0.85rem; color: var(--col-ink-muted, #666); }

/* Letöltés, offline mentés */
.scorebook-intro { max-width: 800px; margin: 0 auto 0.75rem; }
.scorebook-notice {
    max-width: 800px; margin: 0 auto 0.75rem; padding: 0.5rem 1rem;
    border-radius: 0.375rem; background-color: var(--col-wash, rgba(0,0,0,0.05)); font-weight: 600;
}
.scorebook-badge {
    display: inline-block; margin-left: 0.5rem; padding: 1px 8px; border-radius: 10px;
    vertical-align: middle; font-size: 0.7rem; font-weight: bold;
    background-color: var(--col-accent); color: var(--col-white);
}
.scorebook-status {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem;
    margin-top: 4px; font-size: 0.8rem; color: var(--col-ink-muted, #666);
}
.scorebook-status .btn { padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.scorebook-update { font-weight: bold; color: var(--col-accent-text, var(--col-accent)); }
.scorebook-warning { font-size: 0.8rem; color: var(--col-red); }
.scorebook-progress { height: 4px; margin-top: 4px; border-radius: 2px; overflow: hidden; background-color: var(--col-border, #ddd); }
.scorebook-progress > div { height: 100%; background-color: var(--col-accent); transition: width 0.2s; }

/* Borító. A kép a kártya jobb felében középen, teljes egészében látszik; mögötte ugyanaz a kép elmosva, halványan,
   balra elfogyva tölti ki a helyet. Kép nélkül rajzolt, bőrkötéses borító (a cím, az alcím és az évszám aranyozva),
   mögötte a kötés színének halvány árnyalata. */
.scorebook-cover { grid-area: cover; position: relative; overflow: hidden; }
.scorebook-cover-bg {
    position: absolute; inset: 0; overflow: hidden;
    background-color: var(--book-color, transparent); opacity: 0.13;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 45%);
    mask-image: linear-gradient(to right, transparent, #000 45%);
}
.scorebook-cover.has-image .scorebook-cover-bg { background-color: transparent; opacity: 0.5; }
.scorebook-cover-bg img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; filter: blur(14px) saturate(1.2); transform: scale(1.25);
}
.scorebook-cover-img {
    position: absolute; top: 16px; left: 16px; width: calc(100% - 32px); height: calc(100% - 32px);
    object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}
.scorebook-cover-book {
    position: absolute; top: 16px; bottom: 16px; left: 50%; transform: translateX(-50%);
    width: 62%; /* ha a böngésző nem ismeri az aspect-ratio-t */
    border-radius: 2px 5px 5px 2px;
    background-color: var(--book-color, #0e3d46);
    /* gerinc: sötétebb sáv, fénycsík, majd a borító enyhe domborulata */
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.38), rgba(255, 255, 255, 0.10) 4%, rgba(0, 0, 0, 0.10) 8%,
        rgba(0, 0, 0, 0) 13%, rgba(255, 255, 255, 0.05) 60%, rgba(0, 0, 0, 0.14));
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28), 0 1px 3px rgba(0, 0, 0, 0.25);
    color: #d8b862;
    font-family: var(--font-serif);
    text-align: center;
    container-type: inline-size;
}
.bg-texture .scorebook-cover-book {
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.38), rgba(255, 255, 255, 0.10) 4%, rgba(0, 0, 0, 0.10) 8%,
        rgba(0, 0, 0, 0) 13%, rgba(255, 255, 255, 0.05) 60%, rgba(0, 0, 0, 0.14)), var(--tex-leather);
    background-blend-mode: normal, soft-light;
}
/* a felirat helye a kereten belül (a százalékok a könyv méretéhez képest értendők) */
.scorebook-cover-face {
    position: absolute; inset: 15% 13% 24% 19%; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
/* aranyozott dupla keret */
.scorebook-cover-book::before {
    content: ""; position: absolute; inset: 5% 6% 5% 11%; pointer-events: none;
    border: 1px solid currentColor; box-shadow: inset 0 0 0 2px var(--book-color, #0e3d46), inset 0 0 0 3px currentColor;
    opacity: 0.7;
}
/* A betűméret a könyv szélességéhez igazodik: --size a szélesség századrészében (cqi), az app.js számolja a felirat
   hosszából. Ahol a böngésző nem ismeri a cqi-t, egy kb. 110 px széles könyvhöz illő méret. */
.scorebook-cover-title { font-weight: 700; font-size: calc(var(--size, 12.5) * 1.1px); line-height: 1.12; overflow-wrap: break-word; max-width: 100%; }
.scorebook-cover-subtitle { margin-top: 0.45em; font-size: calc(var(--size, 8) * 1.1px); line-height: 1.15; overflow-wrap: break-word; max-width: 100%; opacity: 0.9; }
.scorebook-cover-rule { flex: none; width: 24%; height: 1px; margin-top: 0.8em; background-color: currentColor; opacity: 0.75; }
.scorebook-cover-year { position: absolute; left: 11%; right: 6%; bottom: 10%; font-size: 9px; letter-spacing: 0.08em; }
@supports (font-size: 1cqi) {
    .scorebook-cover-title { font-size: calc(var(--size, 12.5) * 1cqi); }
    .scorebook-cover-subtitle { font-size: calc(var(--size, 8) * 1cqi); }
    .scorebook-cover-year { font-size: 8cqi; }
    .scorebook-cover-rule { margin-top: 7cqi; }
}
@supports (aspect-ratio: 1) {
    .scorebook-cover-book { width: auto; max-width: calc(100% - 32px); aspect-ratio: 2 / 3; }
}
/* ahol lehet: a könyv akkora, amekkora a helyre torzítás nélkül befér (magas, keskeny helyen is 2:3 marad) */
@supports (width: 1cqh) {
    .scorebook-cover { container-type: size; }
    .scorebook-cover-book { top: 50%; bottom: auto; width: min(100cqw - 32px, (100cqh - 32px) * 2 / 3); max-width: none; transform: translate(-50%, -50%); }
}

/* Telefonon a borító kis kép jobbra fent, a szöveg körbefolyja (alatta már a teljes szélességet kapja) */
@media (max-width: 640px) {
    .card.list-item.scorebook-item { display: block; display: flow-root; min-height: 0; padding: 0.75rem 0.75rem 0.75rem 1rem; }
    .scorebook-main, .scorebook-body { display: block; padding: 0; }
    .scorebook-main > * + *, .scorebook-body > *, .scorebook-body > .scorebook-status { margin-top: 4px; }
    .scorebook-item .scorebook-cover { float: right; width: 60px; margin: 0 0 6px 10px; container-type: normal; overflow: visible; }
    .scorebook-item .scorebook-cover-bg { display: none; }
    .scorebook-item .scorebook-cover-img { position: static; display: block; width: 100%; height: auto; max-height: 100px; }
    .scorebook-item .scorebook-cover-book { position: relative; top: auto; bottom: auto; left: auto; transform: none; width: 60px; height: 90px; max-width: none; aspect-ratio: auto; }
    .scorebook-item .scorebook-cover-book > * { display: none; }
}
/* --- Ének fejléce (könyvtár) --- */
.hymn-header { gap: 0.75rem; }
.hymn-header-title { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.hymn-header-text { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.hymn-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-back { color: rgba(255,255,255,0.8); display: flex; }

/* --- Legördülő választó (CustomSelect) --- */
.custom-select { position: relative; }
.custom-select-btn {
    height: 36px; width: auto;
    min-width: var(--select-min-width, 180px); max-width: 100%;
    display: flex; justify-content: space-between; align-items: center; gap: 4px;
    padding-right: 10px;
    font-size: 0.9rem; text-align: left;
    background-color: var(--col-card-raised, var(--col-white));
}
.custom-select-btn.empty { cursor: default; opacity: 0.6; background-color: rgba(0,0,0,0.05); }
/* Üres választó a sötét fejlécen: világos, halvány felirat (különben sötét szöveg sötét háttéren) */
.header .custom-select-btn.empty { opacity: 1; color: rgba(255,255,255,0.6); background-color: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }
.custom-select-btn[aria-expanded="true"] { border-color: var(--col-focus, var(--col-accent)); }
/* A menü a .app-root-ban van, fix pozícióval (helyét és méretét az app.js adja); a modalok (300) fölött */
.custom-select-menu {
    position: fixed;
    overflow-y: auto; overscroll-behavior: contain;
    background-color: var(--col-card, var(--col-papyrus));
    color: var(--col-ink);
    border: 1px solid var(--col-border, #ccc); border-radius: 6px;
    box-shadow: var(--shadow-xl), 0 2px 6px rgba(0, 0, 0, 0.12);
    z-index: 400;
}
.custom-select-option { padding: 10px; border-bottom: 1px solid var(--col-border, #eee); cursor: pointer; }
.custom-select-option:last-child { border-bottom: none; }
.custom-select-option.placeholder { font-style: italic; color: var(--col-ink-muted, #666); }
.custom-select-option.active { background-color: rgba(0, 0, 0, 0.04); }
.custom-select-option.selected { background-color: var(--col-wash, rgba(0,0,0,0.05)); box-shadow: inset 3px 0 0 var(--col-accent); }
.custom-select-option-label { font-weight: bold; font-size: 0.9rem; color: var(--col-galaxy-blue); }
.custom-select-option-sub { font-size: 0.75rem; color: var(--col-ink-muted, #666); margin-top: 2px; font-style: italic; }
.custom-select-value { min-width: 0; }
/* Színséma: színminta (oldalsáv, háttér, akcentus) a név előtt */
.swatch-label { display: inline-flex; align-items: center; gap: 0.6rem; max-width: 100%; }
.custom-select-menu .swatch-label { font-weight: bold; font-size: 0.9rem; color: var(--col-galaxy-blue); }
.theme-swatch {
    position: relative; flex: none; width: 30px; height: 20px; border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    background: linear-gradient(90deg, var(--swatch-side) 0 32%, var(--swatch-bg) 32% 100%);
}
.theme-swatch::after {
    content: ''; position: absolute; right: 5px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
    border-radius: 50%; background-color: var(--swatch-accent);
}
/* Betűtípus-választók: a menüben minden betűtípus a saját mintájával */
.font-option { display: flex; flex-direction: column; gap: 6px; }
.font-option-name { line-height: 1.35; }
.font-select-menu .custom-select-option { padding: 10px 12px; }
.serif-font-value { font-weight: 700; font-size-adjust: cap-height 0.7; }

/* --- Listák rácsa --- */
.playlist-grid {
    flex: 1; overflow-y: auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 1.5rem;
}
/* Nézetváltó a Listák fejlécében: csempék / lista (a választott kiemelve) */
.playlist-view-toggle {
    flex: none; display: inline-flex; margin-right: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 0.375rem; overflow: hidden;
}
.playlist-view-toggle button {
    width: 40px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    color: var(--col-papyrus); opacity: 0.75;
}
.playlist-view-toggle button + button { border-left: 1px solid rgba(255, 255, 255, 0.3); }
.playlist-view-toggle button:hover { opacity: 1; background-color: rgba(255, 255, 255, 0.1); }
.playlist-view-toggle button.active { opacity: 1; background-color: var(--col-accent); color: var(--col-white); }
/* Listás nézet: soronként, az énekkártyák mintájára; balra a név (elején a dátum talpas betűvel), jobbra egy
   sorban a kezelőgombok és az indítás */
.playlist-list { flex: 1; overflow-y: auto; padding: 1rem; }
.card.list-item.playlist-row { gap: 1rem; padding: 0.6rem 0.75rem 0.6rem 1rem; }
.playlist-row-name { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 1rem; }
.playlist-row-date { flex: none; font-size: 1.35rem; line-height: 1; }
.playlist-row-title { min-width: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.playlist-row-actions { flex: none; display: flex; align-items: center; gap: 0.25rem; }
.playlist-row-actions .btn-ghost, .playlist-row-actions .btn-danger {
    width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 0.375rem;
}
.playlist-row-start { margin-left: 0.5rem; padding: 0.45rem 1rem; background-color: var(--col-galaxy-light); color: var(--col-white); }
.playlist-row-start:hover { filter: brightness(1.12); }
@media (max-width: 640px) {
    .playlist-list { padding: 0.75rem; }
    .card.list-item.playlist-row { gap: 0.5rem; padding: 0.5rem 0.5rem 0.5rem 0.75rem; }
    /* keskeny kijelzőn a dátum a név fölött */
    .playlist-row-name { flex-direction: column; align-items: flex-start; gap: 2px; }
    .playlist-row-date { font-size: 1.1rem; }
    .playlist-row-title { font-size: 1rem; }
    .playlist-row-actions { gap: 0; }
    .playlist-row-actions .btn-ghost, .playlist-row-actions .btn-danger { width: 34px; }
    .playlist-row-start { margin-left: 0.25rem; padding: 0.45rem 0.6rem; }
    .playlist-row-start .btn-label { display: none; }
    .playlist-view-toggle button { width: 34px; }
}

/* --- Beállítások: szakaszok és sorok --- */
/* Két oszlop, ha mindkettő legalább 420 px széles lehet (pl. fekvő 10"-es tableten); keskenyebb kijelzőn egymás alatt */
.settings-page { width: 100%; max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.75rem 2rem; }
.settings-column { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 1.75rem; }
.settings-section { display: flex; flex-direction: column; gap: 10px; }
.settings-section-title {
    margin: 0 0 2px 2px;
    font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--col-accent-text, var(--col-accent));
}
.card.card-row { flex-wrap: wrap; row-gap: 0.75rem; }
.setting-label { flex: 1 1 200px; min-width: 0; }
/* kártya, amelyben a beállítás a felirat alatt van (pl. kottafont mintakottával) */
.card.card-stack { height: auto; padding: 1rem; gap: 0.75rem; }
.card.card-stack .setting-label { flex: none; }

/* Kottafont választása: mindegyik fonttal ugyanaz a mintakotta */
.font-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.font-choice {
    display: flex; flex-direction: column; align-items: stretch; gap: 8px;
    padding: 10px 12px; border: 2px solid var(--col-border, #d1d5db); border-radius: 8px;
    background-color: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
    transition: border-color 0.15s;
}
.font-choice:hover { border-color: var(--col-border-dark, #9ca3af); }
.font-choice.selected { border-color: var(--col-accent); }
.font-choice:focus-visible { outline: 2px solid var(--col-focus, var(--col-accent)); outline-offset: 2px; }
.font-sample { height: 128px; color: #000; }
.font-sample svg { display: block; width: 100%; height: 100%; }
.font-sample-missing { display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--col-ink-muted, #666); }
.font-choice-label { display: flex; align-items: flex-start; gap: 8px; }
.font-choice-text { min-width: 0; line-height: 1.35; }
/* kör alakú jelölő, mint egy választógomb */
.font-choice-label::before {
    content: ''; flex: none; width: 16px; height: 16px; margin-top: 2px; box-sizing: border-box;
    border: 2px solid var(--col-border-dark, #9ca3af); border-radius: 50%;
}
.font-choice.selected .font-choice-label::before { border: 5px solid var(--col-accent); }
.font-choice-name { font-weight: bold; margin-right: 2px; }
/* a felület betűtípusának mintája: énekcím és szövegrészlet */
.ui-font-sample { display: flex; flex-direction: column; gap: 4px; color: var(--col-ink); }
.ui-font-sample-title { font-size: 1.05rem; font-weight: 700; }
.ui-font-sample-text { font-size: 0.95rem; line-height: 1.4; }
.serif-font-sample { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-weight: 700; font-size-adjust: cap-height 0.7; }
.serif-font-sample-number { font-size: 2rem; line-height: 1.1; color: var(--col-accent-text); }
.serif-font-sample-title { font-size: 1.2rem; line-height: 1.3; color: var(--col-ink); }
.font-choice-hint { font-size: 13px; color: var(--col-ink-muted, #666); }

/* --- Listák: versszakok a kártyán, átnevezés, megosztás, importálás --- */
/* a versszakok (pl. 1-3,5) az énekszám után, a címnél hangsúlyosabban */
.playlist-card-item-verses { flex-shrink: 0; font-size: 0.95em; font-weight: 600; color: var(--col-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* a szerkesztő fejlécében a lista neve, mellette az átnevezés gombja */
.playlist-editor-title { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 0.25rem; }
.playlist-editor-title .header-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.header-icon-btn {
    flex: none; width: 40px; height: 40px; border-radius: 0.375rem;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--col-papyrus); opacity: 0.8;
}
.header-icon-btn:hover { opacity: 1; background-color: rgba(255, 255, 255, 0.1); }
.header-actions { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; }
/* keretes gomb a sötét fejlécen és a világos ablakokban */
.btn-on-dark { color: var(--col-papyrus); border: 1px solid rgba(255, 255, 255, 0.3); padding: calc(0.5rem - 1px) calc(1rem - 1px); }
.btn-on-dark:hover { background-color: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.55); }
.btn-outline {
    color: var(--col-ink); background-color: var(--col-card-raised, var(--col-white));
    border: 1px solid var(--col-border-dark, #9ca3af); padding: calc(0.5rem - 1px) calc(1rem - 1px);
    text-decoration: none;
}
.btn-outline:hover { border-color: var(--col-accent); }
.playlist-editor-empty .playlist-empty-import { font-style: normal; margin-top: 0.5rem; font-size: 0.9rem; }

/* Megosztás: balra a QR-kód, jobbra a kód és a gombok (keskeny kijelzőn egymás alatt) */
.share-list { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.share-qr { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.share-qr-btn { display: block; width: 100%; padding: 0; border-radius: 0.5rem; cursor: zoom-in; }
.share-qr-btn:focus-visible { outline: 2px solid var(--col-focus, var(--col-accent)); outline-offset: 2px; }
/* a QR-kód mindig fekete-fehér (a témától függetlenül), így olvasható a legbiztosabban */
.qr-code { display: block; width: 100%; aspect-ratio: 1; background-color: #fff; border-radius: 0.5rem; box-shadow: 0 0 0 1px var(--col-border, #d1d5db); }
.qr-missing { display: flex; align-items: center; justify-content: center; padding: 1rem; text-align: center; font-size: 0.85rem; color: #555; }
.share-main { min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.share-name { font-weight: 700; font-size: 1.1rem; color: var(--col-ink); overflow-wrap: anywhere; }
.share-count { margin-top: -0.4rem; font-size: 0.85rem; color: var(--col-ink-muted, #666); }
.share-code, .import-code {
    padding: 0.5rem 0.75rem; resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; line-height: 1.35;
    word-break: break-all;
}
.share-actions, .import-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share-actions .btn, .import-actions .btn { font-size: 0.875rem; } /* a gombok és a link (E-mail) egyforma betűvel */
.share-hint { margin: 0; font-size: 0.8rem; line-height: 1.35; color: var(--col-ink-muted, #666); }
.share-qr .share-hint { text-align: center; }
/* a QR-kód nagyítva, az egész képernyőn (koppintásra vagy Escape-re bezárul) */
.qr-zoom {
    position: fixed; inset: 0; z-index: 10; padding: 1rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem;
    background-color: #fff; cursor: zoom-out;
}
.qr-zoom .qr-code { width: min(92vw, calc(92vh - 3rem)); width: min(92vw, calc(92dvh - 3rem)); border-radius: 0; box-shadow: none; }
.qr-zoom p { margin: 0; font-size: 0.9rem; color: #333; text-align: center; }

/* Importálás */
.import-list { display: flex; flex-direction: column; gap: 0.6rem; }
.import-file-input { display: none; }
.import-camera { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.qr-video { display: block; width: 100%; max-height: 50vh; object-fit: cover; background-color: #000; border-radius: 0.5rem; }
.import-message { margin: 0; font-size: 0.85rem; line-height: 1.35; }
.import-message.error { color: var(--col-red); }
.import-message.info { color: var(--col-ink-muted, #666); }
.import-preview { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--col-border, #d1d5db); }
.import-items {
    max-height: 30vh; overflow-y: auto; padding: 0.25rem 0;
    background-color: var(--col-card, var(--col-papyrus)); border: 1px solid var(--col-border, #d1d5db); border-radius: 0.5rem;
}
/* az importált ujjrendek: énekszám, alatta a cím, a letét és a hangnem */
.finger-import-text { min-width: 0; display: flex; flex-direction: column; }
.finger-import-detail { font-size: 12px; color: var(--col-ink-muted, #666); }
/* a fájlból betöltendő listák: név és az énekek száma (a már meglévők halványan) */
.lists-import-item { justify-content: space-between; }
.lists-import-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lists-import-detail { flex-shrink: 0; font-size: 12px; color: var(--col-ink-muted, #666); }
.lists-import-item.duplicate .lists-import-name { opacity: 0.55; font-weight: 400; }

/* Beállítások → Adatok mentése és megosztása */
.data-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.data-actions .btn { font-size: 0.875rem; }
.settings-note { margin: 0 0.25rem; font-size: 0.8rem; line-height: 1.4; color: var(--col-ink-muted, #666); }

@media (max-width: 640px) {
    .lyrics-panel.bottom .lyrics-toolbar { grid-template-areas: "tabs tabs tabs" ". handle buttons"; row-gap: 2px; }
    .lyrics-panel.bottom .lyrics-tabs { grid-area: tabs; }
    .lyrics-panel.bottom .lyrics-resize { grid-area: handle; }
    .lyrics-panel.bottom .lyrics-toolbar-buttons { grid-area: buttons; }
    .share-list { grid-template-columns: minmax(0, 1fr); }
    .share-qr { width: min(220px, 100%); margin: 0 auto; }
    /* a listák és a szerkesztő fejlécében csak az ikonok, így a lista nevének több hely jut */
    .header-actions .btn-label { display: none; }
    .header-actions .btn { padding-left: 0.6rem; padding-right: 0.6rem; }
    .header-icon-btn { width: 34px; }
    .playlist-editor-title .header-title { font-size: 1.05rem; }
}

/* --- Keskeny képernyő (telefon, álló tablet) --- */
@media (max-width: 700px) {
    .hymn-header { flex-wrap: wrap; height: auto; min-height: 64px; padding: 0.5rem 0.75rem; row-gap: 0.5rem; }
    .hymn-header-actions { width: 100%; flex-shrink: 1; }
    .hymn-header-actions .custom-select { flex: 1; min-width: 0; }
    .hymn-header-actions .custom-select-btn { min-width: 0; width: 100%; }
    .playlist-grid { padding: 1rem; gap: 1rem; }
    .about-view { padding: 2rem 1rem; }
    .header-title.main { white-space: normal; text-align: center; }
    .playlist-editor-title .header-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; }
    .header-title.page-title { font-size: 1.3rem; line-height: 1.15; }
    .card.card-row { gap: 0.75rem 1rem; }
}

/* --- Segédosztályok ---
   A JSX Tailwind-osztályneveket használ, de Tailwind nincs betöltve: az itt használtakat pótoljuk. */
.block { display: block; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.font-bold { font-weight: 700; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-center { text-align: center; }
.uppercase { text-transform: uppercase; }
.tracking-widest { letter-spacing: 0.1em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.text-ink { color: var(--col-ink); }
.text-gray-500 { color: var(--col-ink-muted, #6b7280); }
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }
.border-b { border-bottom: 1px solid var(--col-border, #e5e7eb); }
.border-l { border-left: 1px solid var(--col-border, #e5e7eb); }
.border-gray-200 { border-color: var(--col-border, #e5e7eb); }
.border-gray-500 { border-color: var(--col-border-dark, #6b7280); }
.p-1 { padding: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pl-3 { padding-left: 0.75rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.ml-2 { margin-left: 0.5rem; }
.hover\:bg-gray-100:hover { background-color: var(--col-wash, #f3f4f6); }
.hover\:text-black:hover { color: #000; }
.hover\:underline:hover { text-decoration: underline; }
/* A könyvtár kártyái csoportokban (app.js: HymnList): a képernyőn kívüli csoportot a böngésző nem rendezi el és nem
   festi ki (a helyét a contain-intrinsic-size adja, az app.js számolja); a még ki nem rajzolt kártyák helye lefoglalva */
.hymn-group { content-visibility: auto; }
.library-pending { flex: none; }
