@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=GFS+Didot&family=Source+Sans+3:wght@400;500;600;700&family=Noto+Sans:ital,wght@0,400;0,600;0,700;1,400&family=Noto+Serif:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    --ink: #1f1610;
    --ink-soft: #6b4d2f;
    --gold: #d9bd86;
    --brass: #8f6f43;
    --ui-font: 'Source Sans 3', 'Noto Sans', sans-serif;
    --display-font: 'GFS Didot', 'Noto Serif', serif;
}

body {
    font-family: var(--ui-font);
    background-color: #17120e;
    background-image:
        radial-gradient(ellipse at 50% -10%, rgba(140, 96, 48, 0.30) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 110%, rgba(0, 0, 0, 0.6) 0%, transparent 70%);
    background-attachment: fixed;
    margin: 0;
    padding: 20px 15px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #f0e2c0;
}

.navbar-container {
    width: 100%;
    max-width: 1040px;
    margin-bottom: 25px;
}

.top-nav {
    display: flex;
    gap: 8px;
    background-image: linear-gradient(to bottom, #2e251d, #1f1812);
    border: 1px solid #4d3c2b;
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

.nav-btn {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
    color: #e8d6ae;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.nav-btn.active, .nav-btn:hover {
    background-color: rgba(217, 189, 134, 0.18);
    color: #ffffff;
}

.page-container {
    width: 100%;
    max-width: 1040px;
}

.page-title {
    font-family: var(--display-font);
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 25px;
    color: var(--gold);
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.search-box {
    width: 100%;
    padding: 14px 18px;
    font-size: 1.1rem;
    background: #231b14;
    border: 1px solid var(--brass);
    border-radius: 8px;
    color: #ffffff;
    box-sizing: border-box;
    outline: none;
}
.search-box:focus {
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(217, 189, 134, 0.3);
}

.alphabet-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.alpha-btn {
    background: #2e251d;
    border: 1px solid #4d3c2b;
    color: #e8d6ae;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
}
.alpha-btn.active, .alpha-btn:hover {
    background: var(--brass);
    color: #fff;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 20px;
}

.category-card {
    background: rgba(35, 27, 20, 0.9);
    border: 1px solid var(--brass);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(217, 189, 134, 0.2);
    padding-bottom: 10px;
}

.category-header-info {
    display: flex;
    flex-direction: column;
}

/* Uniform Category Page Avatar (Curved Square) */
.category-avatar {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--brass);
    flex-shrink: 0;
}

.category-title {
    font-family: var(--ui-font);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Category Card Lifespan */
.category-lifespan {
    font-size: 0.82rem;
    color: #b89f72;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

/* Song Viewer Avatar Slot: Stacked vertically so lifespan sits strictly below the image */
.header-avatar-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    width: 120px;
    flex-shrink: 0;
}

/* Uniform Song Viewer Avatar (Curved Square) */
.viewer-artist-avatar {
    width: 110px;
    height: 110px;
    border-radius: 16px;
    object-fit: cover;
    border: 2px solid var(--brass, #8f6f43);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.28);
    background-color: #fff;
}

/* Lifespan strictly positioned below the viewer image, matching the song title color (--ink) */
.avatar-lifespan {
    font-size: 0.78rem;
    font-family: 'EB Garamond', 'Noto Serif', serif;
    font-weight: 600;
    color: var(--ink);
    margin-top: 6px;
    text-align: center;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge {
    font-size: 0.75rem;
    background: var(--brass);
    color: #fff;
    padding: 2px 7px;
    border-radius: 10px;
}

.song-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.song-list li {
    margin-bottom: 6px;
}

.song-item-link {
    color: #f0e2c0;
    text-decoration: none;
    font-size: 1.05rem;
    display: block;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}

.song-item-link:hover {
    background: rgba(217, 189, 134, 0.15);
    color: #ffffff;
}

.no-results {
    text-align: center;
    grid-column: 1 / -1;
    font-size: 1.2rem;
    color: #a48455;
    padding: 40px;
}

/* Sheet & Header Styles */
.sheet-container {
    position: relative;
    width: 100%;
    max-width: 980px;
    background-color: #f2e3c6;
    border: 1px solid var(--brass);
    border-radius: 8px;
    padding: 52px 44px 46px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.75);
    color: #241911;
    box-sizing: border-box;
}

/* Header Wrapper Grid accommodating the 120px avatar slot on the left */
.song-header-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: 135px 1fr;
    align-items: center;
    gap: 15px;
}

.song-header { 
    width: 100%;
    text-align: center; 
    margin-bottom: 0;
    box-sizing: border-box;
}

.song-title {
    font-family: var(--display-font);
    font-weight: 400;
    font-size: clamp(1.9rem, 5vw, 2.9rem);
    color: var(--ink);
    margin: 0 0 22px;
}
.meta-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 0;
}
.meta-item[hidden] { display: none !important; }
.meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 22px;
}
.meta-item + .meta-item { border-left: 1px solid rgba(90, 60, 30, 0.28); }
.meta-label, .song-title::before {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.meta-value {
    font-family: 'EB Garamond', 'Noto Serif', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
}

.song-content { padding-top: 14px; line-height: 1.4; }
.lyric-line-block { margin-bottom: 20px; align-items: flex-end; display: flex; flex-wrap: nowrap; width: max-content; }
.token-pair { display: inline-flex; flex-direction: column; align-items: flex-start; white-space: pre; }
.token-lyric { font-family: 'EB Garamond', 'Noto Serif', serif !important; font-size: 1em; font-weight: 500; color: var(--ink); }
.token-chord, .instrumental-chord { font-family: var(--ui-font) !important; font-size: 0.86em; font-weight: 700; }
.instrumental-grid-block { display: grid; column-gap: 5ch; row-gap: 8px; margin-bottom: 16px; width: fit-content; }
.instrumental-grid-block:has(+ .instrumental-grid-block) { margin-bottom: 8px; }   /* rows split only by a time-signature change stay as tight as rows of one grid */
.verse-space { height: 14px; }
.chord-section {
    --section-rule: color-mix(in srgb, var(--section-accent) 50%, transparent);
    --section-wash: color-mix(in srgb, var(--section-accent) 12%, transparent);
    margin-block: 0 1.1rem;
    padding: 0.85rem 0 0.2rem clamp(0.75rem, 2.5vw, 1.5rem);
}

.chord-section-label {
    margin: 0 0 0.9rem;
    color: inherit;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.15;
}

.chord-section[data-section="intro"] {
    padding-block-start: clamp(1.25rem, 4vw, 2.5rem);
    border-block-start: 1px solid var(--section-rule);
    border-start-end-radius: 2.75rem;
    background: linear-gradient(130deg, var(--section-wash), transparent 70%);
}

.chord-section[data-section="intro"] .chord-section-label {
    font-size: 1.125rem;
    font-style: italic;
    margin-block-end: 1.1rem;
}

.chord-section[data-section="bridge"] {
    --bridge-tint: color-mix(in srgb, var(--section-accent) 70%, #6689a0);
    --section-rule: color-mix(in srgb, var(--bridge-tint) 50%, transparent);
    --section-wash: color-mix(in srgb, var(--bridge-tint) 16%, transparent);
    margin-block: 0.75rem 1.25rem;
    padding-block: 0.9rem 0.65rem;
    border-block: 1px dashed var(--section-rule);
    border-inline-start: 3px solid var(--bridge-tint);
    border-radius: 0.3rem;
    background: linear-gradient(90deg, var(--section-wash), transparent 85%);
}

.chord-section[data-section="bridge"] .chord-section-label {
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: inherit;
}

.chord-section[data-section="verse"] {
    box-shadow: inset 1px 0 var(--section-rule);
}

.chord-section[data-section="verse"] .chord-section-label {
    font-family: system-ui, sans-serif;
    font-weight: 650;
    letter-spacing: 0.13em;
}

.chord-section[data-section="chorus"] {
    padding-block: clamp(1rem, 3vw, 1.65rem) 0.45rem;
    border-block: 1px solid var(--section-rule);
    border-radius: 0.35rem;
    background: var(--section-wash);
}

.chord-section[data-section="chorus"] .chord-section-label {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: clamp(0.65rem, 3vw, 1.4rem);
    margin-inline-end: clamp(0.75rem, 2.5vw, 1.5rem);
    margin-block-end: 1.15rem;
    font-weight: 700;
}

.chord-section[data-section="chorus"] .chord-section-label::before,
.chord-section[data-section="chorus"] .chord-section-label::after {
    content: "";
    flex: 1;
    border-block-start: 3px double var(--section-rule);
}

@media print {
    .chord-section { background: none; }
    .chord-section[data-section="verse"] { box-shadow: none; }
    .chord-section-label { break-after: avoid; }
}

@media (max-width: 768px) {
    .song-header-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .header-avatar-slot {
        margin-bottom: 15px;
    }
}

/* Theme Switcher & Transposition Controls */
.theme-switcher { position: fixed; right: 16px; bottom: 16px; z-index: 3000; }
.theme-switcher-btn { width: 52px; height: 52px; border-radius: 50%; background: rgba(28, 21, 15, 0.94); color: #e8d6ae; border: 1px solid rgba(217, 189, 134, 0.6); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.theme-switcher-panel { position: absolute; right: 0; bottom: 62px; min-width: 280px; background: rgba(28, 21, 15, 0.98); border: 1px solid rgba(217, 189, 134, 0.55); border-radius: 12px; padding: 8px; display: none; }
.theme-switcher.open .theme-switcher-panel { display: block; }
.theme-option { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 14px; background: none; border: none; color: #f0e2c0; cursor: pointer; border-radius: 8px; }

.transpose-control { position: fixed; left: 16px; bottom: 16px; z-index: 3000; display: flex; align-items: center; height: 52px; padding: 0 4px; background: rgba(28, 21, 15, 0.94); color: #e8d6ae; border: 1px solid rgba(217, 189, 134, 0.6); border-radius: 26px; }
.transpose-control button { background: none; border: none; color: inherit; cursor: pointer; }
.transpose-step { width: 46px; height: 44px; font-size: 2.1rem; }
.transpose-value { min-width: 70px; display: flex; flex-direction: column; align-items: center; }
.transpose-number { font-size: 1.2rem; font-weight: 700; }
.transpose-caption { font-size: 0.62rem; text-transform: uppercase; color: #b89f72; }
/* Modern library: quiet surfaces, Greek system typography, generous touch targets. */
:root {
    --ink: #182b34;
    --ink-soft: #52656e;
    --gold: #182b34;
    --brass: #cbd5d6;
    --accent: #175c51;
    --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Arial, sans-serif;
    --display-font: var(--ui-font);
}
* { box-sizing: border-box; }
body { background: #f4f6f5; color: var(--ink); padding: 24px 28px 100px; line-height: 1.55; }
.navbar-container { max-width: 1280px; margin-bottom: 42px; }
.top-nav { background: #fff; border: 1px solid #e0e6e4; border-radius: 14px; box-shadow: 0 2px 6px #182b3404; padding: 6px; gap: 4px; flex-wrap: wrap; }
.nav-btn { color: #52656e; text-transform: none; letter-spacing: 0; font-size: 0.94rem; border-radius: 9px; padding: 12px 16px; min-height: 46px; white-space: nowrap; }
.nav-btn:hover, .nav-btn.active { color: #175c51; background: #e9f2ee; }
.page-container { max-width: 1280px; }
.page-title { color: var(--ink); text-align: left; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 650; line-height: 1.2; letter-spacing: -0.035em; margin: 0 0 32px; }
.filter-controls { gap: 18px; margin-bottom: 28px; }
.search-box { background: #fff; color: var(--ink); border: 1px solid #ccd7d3; border-radius: 12px; font: inherit; padding: 16px 18px; min-height: 52px; }
.search-box::placeholder { color: #697c83; }
.search-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #175c5114; }
.alphabet-bar { justify-content: flex-start; gap: 6px; }
.alpha-btn { background: #fff; border-color: #dce3e0; color: #52656e; border-radius: 8px; min-width: 40px; min-height: 44px; font: 600 0.85rem var(--ui-font); }
.alpha-btn.active, .alpha-btn:hover { background: #175c51; border-color: #175c51; color: #fff; }
.categories-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 22px; }
.category-card { background: #fff; border: 1px solid #e0e6e4; border-radius: 16px; padding: 22px; box-shadow: 0 3px 12px #182b3404; }
.category-header { border-color: #e7ece9; padding-bottom: 18px; margin-bottom: 10px; }
.category-title { color: var(--ink); font-size: 1.05rem; letter-spacing: -0.015em; }
.category-avatar { border-color: #e0e6e4; }
.category-lifespan { color: #62767d; letter-spacing: 0; }
.badge { background: #edf3f0; color: #175c51; font-size: 0.75rem; }
.song-item-link { color: #3a515a; font-size: 0.96rem; padding: 10px 8px; min-height: 44px; }
.song-item-link:hover { background: #edf5f1; color: #175c51; }
.no-results { color: #62767d; }
.sheet-container { background: #fff; border: 1px solid #dfe6e2; border-radius: 18px; padding: 48px 40px; max-width: 1120px; box-shadow: 0 12px 44px #182b3408; color: var(--ink); }
.song-header-wrapper { border-bottom: 1px solid #e0e6e4; padding-bottom: 30px; }
.song-title { font-weight: 650; letter-spacing: -0.03em; }
.meta-grid { gap: 18px 0; }
.meta-item { padding: 0 18px; }
.meta-item + .meta-item { border-color: #e0e6e4; }
.meta-label, .song-title::before { text-transform: none; letter-spacing: 0; font-size: 0.75rem; color: #62767d; }
.meta-value { font-family: var(--ui-font); font-size: 0.98rem; font-weight: 500; }
.avatar-lifespan { font-family: var(--ui-font); color: #62767d; letter-spacing: 0; }
.viewer-artist-avatar { box-shadow: none; border: 1px solid #dfe6e2; }
.token-lyric { font-family: var(--ui-font) !important; font-weight: 400; }
.token-chord, .instrumental-chord { font-family: var(--ui-font) !important; }
.ornament { display: none; }
.theme-switcher-btn, .transpose-control { background: #fff; color: #175c51; border: 1px solid #ccd7d3; box-shadow: 0 4px 18px #182b3410; }
.theme-switcher-btn svg { width: 24px; height: 24px; }
.theme-switcher-panel { background: #fff; border: 1px solid #dfe6e2; box-shadow: 0 12px 40px #182b3420; }
.theme-option { color: var(--ink); min-height: 44px; font: inherit; }
.theme-option:hover, .theme-option[aria-checked="true"] { background: #e9f2ee; }
.theme-option .tick { visibility: hidden; }
.theme-option[aria-checked="true"] .tick { visibility: visible; }
.theme-switcher-title { font-size: 0.8rem; color: #62767d; padding: 8px 14px; }
.transpose-caption { text-transform: none; color: #62767d; letter-spacing: 0; }
a, button, input { -webkit-tap-highlight-color: #175c5120; }
a:focus-visible, button:focus-visible { outline: 2px solid #175c51; outline-offset: 4px; }
.library-hero { padding: 54px 0 64px; max-width: 800px; }
.eyebrow { color: #175c51; font-size: 0.83rem; font-weight: 650; margin: 0 0 22px; }
.library-hero .page-title { font-size: clamp(2.8rem, 6vw, 4.8rem); line-height: 1.08; margin-bottom: 28px; letter-spacing: -0.055em; }
.hero-description { color: #52656e; max-width: 590px; font-size: 1.1rem; line-height: 1.8; margin-bottom: 30px; }
.primary-link { display: inline-flex; align-items: center; gap: 34px; background: #175c51; color: #fff; border-radius: 10px; padding: 14px 22px; text-decoration: none; font-weight: 600; }
.primary-link:hover { background: #10473e; }
.browse-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 20px; }
.browse-heading h2 { font-size: 1.1rem; font-weight: 600; margin: 0; }
.browse-heading > span { color: #62767d; font-size: 0.85rem; }
.browse-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.browse-card { display: block; position: relative; padding: 26px 24px 42px; color: var(--ink); text-decoration: none; background: #fff; border: 1px solid #dfe6e2; border-radius: 14px; transition: border-color .2s, transform .2s; }
.browse-card:hover { border-color: #175c51; transform: translateY(-3px); }
.browse-number { color: #62767d; font-size: 0.74rem; }
.browse-card h3 { margin: 32px 0 10px; font-size: 1.3rem; letter-spacing: -0.025em; }
.browse-card p { color: #62767d; font-size: 0.87rem; margin: 0; }
.browse-arrow { position: absolute; right: 22px; top: 22px; color: #175c51; }
@media (max-width: 1000px) { .browse-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) {
    body { padding: 16px 16px 96px; }
    .navbar-container { margin-bottom: 30px; }
    .top-nav .nav-btn { flex: 1 1 25%; padding: 12px 10px; }
    .library-hero { padding: 28px 0 44px; }
    .browse-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
    .sheet-container { padding: 28px 18px; }
    .meta-item { padding: 0 10px; }
    .meta-item + .meta-item { border: 0; }
}
@media (max-width: 420px) { .browse-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
@media print {
    body { background: #fff; padding: 0; }
    .navbar-container, .theme-switcher, .transpose-control { display: none; }
    .sheet-container { max-width: none; border: 0; box-shadow: none; padding: 0; }
}

/* Profile photos under artist / composer / lyricist names */
.meta-people { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.meta-avatar {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(143, 111, 67, 0.55);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
    background-color: #fff;
}
@media (max-width: 750px) { .meta-avatar { width: 52px; height: 52px; } }

/* Song header: title, then the three credits (each with photo), then compact details */
.song-header-wrapper { display: block; }
.credits-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    max-width: 760px;
    margin: 4px auto 22px;
}
.credit-item { padding: 4px 18px; justify-content: flex-start; text-align: center; }
.credit-item .meta-value { margin-top: 3px; line-height: 1.25; }
.credit-item .meta-people { margin-top: 12px; flex-wrap: wrap; }
.credit-item .meta-avatar { width: 88px; height: 88px; border-radius: 14px; }
.details-grid { margin-top: 0; padding-top: 18px; border-top: 1px solid rgba(128, 128, 128, 0.25); max-width: 760px; margin-left: auto; margin-right: auto; }
.details-grid .meta-item { padding: 0 22px; }
@media (max-width: 700px) {
    .credits-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .credit-item { padding: 4px 6px; }
    .credit-item .meta-value { font-size: 0.85rem; }
    .credit-item .meta-avatar { width: 64px; height: 64px; }
    .details-grid .meta-item { padding: 0 12px; }
}
@media (max-width: 700px) {
    .credit-item .meta-value { font-size: 0.78rem !important; letter-spacing: 0 !important; }
    .credit-item .meta-label, .credits-plate .song-title::before { font-size: 0.6rem !important; letter-spacing: 0.04em !important; }
    .details-grid { flex-wrap: nowrap; }
    .details-grid .meta-item { padding: 0 8px !important; }
    .details-grid .meta-value { font-size: 0.85rem !important; letter-spacing: 0 !important; }
    .details-grid .meta-label, .credits-plate .song-title::before { font-size: 0.6rem !important; letter-spacing: 0.04em !important; }
}

/* ---- Credits plate: one framed structure — joined photos, caption band, details footer ---- */
.credits-plate {
    max-width: 760px;
    margin: 6px auto 22px;
    border: 1px solid rgba(128, 128, 128, 0.38);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(128, 128, 128, 0.07);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}
.credits-plate .credits-grid { max-width: none; margin: 0; gap: 0; }
.credits-plate .credit-item {
    display: flex; flex-direction: column; align-items: stretch !important;
    padding: 0 !important; border: 0 !important; text-align: center;
}
.credits-plate .credit-item + .credit-item { border-left: 1px solid rgba(128, 128, 128, 0.38) !important; }
.credits-plate .meta-people { align-self: stretch !important; width: 100%; order: 0; margin: 0; gap: 0; flex-wrap: nowrap; display: flex; }
.credits-plate .meta-avatar {
    flex: 1 1 0; min-width: 0; width: 100%; height: 170px;
    border: 0; border-radius: 0; box-shadow: none; object-fit: cover; object-position: center 25%;
}
.credits-plate .meta-people .meta-avatar + .meta-avatar { border-left: 1px solid rgba(128,128,128,.38); }
.credits-plate .credit-item .meta-label { order: 1; margin: 12px 8px 0; }
.credits-plate .credit-item .meta-value { order: 2; margin: 2px 8px 14px; }
.credits-plate .details-grid {
    max-width: none; margin: 0; padding: 12px 0;
    border-top: 1px solid rgba(128, 128, 128, 0.38);
    background: rgba(128, 128, 128, 0.08);
}
@media (max-width: 700px) {
    .credits-plate { border-radius: 14px; }
    .credits-plate .meta-avatar { height: 112px; }
    .credits-plate .credit-item .meta-label { margin: 8px 4px 0; }
    .credits-plate .credit-item .meta-value { margin: 2px 4px 10px; }
}

/* Composer = lyricist: one wide column, photo shown once */
.credits-plate .credits-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.credits-plate .credits-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.credits-plate .credits-one { grid-template-columns: minmax(0, 1fr); }
.credits-plate .credits-one .meta-people { justify-content: center; }
.credits-plate .credits-one .meta-avatar { height: 260px; width: min(100%, 340px) !important; flex: 0 0 auto; margin: 0 auto; }
.credits-plate .credits-two .meta-avatar { height: 250px; }
@media (max-width: 700px) { .credits-plate .credits-two .meta-avatar { height: 150px; } }

/* Placeholder tile for people without a photo: keeps the plate symmetrical */
.meta-placeholder {
    display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem; font-weight: 300; letter-spacing: 0.06em;
    color: rgba(128, 128, 128, 0.85);
    background: linear-gradient(160deg, rgba(128,128,128,0.22), rgba(128,128,128,0.08));
}

/* ---- Solo songs: artist = composer = lyricist -> original layout, one photo far left ---- */
.song-header-wrapper.header-solo {
    display: grid; grid-template-columns: 135px minmax(0, 1fr); align-items: center; gap: 15px;
}
.song-header-wrapper.header-solo:has(> .header-avatar-slot[hidden]) {
    grid-template-columns: minmax(0, 1fr);
}
.header-solo .header-avatar-slot[hidden], .solo-credit[hidden] { display: none; }
.header-solo .header-avatar-slot { width: 135px; }
.header-solo .viewer-artist-avatar { width: 120px; height: 120px; }
.header-solo .credits-plate { border: 0; box-shadow: none; background: none; overflow: visible; margin-top: 0; }
.header-solo .details-grid { background: none; border-top: 0; padding-top: 0; }
.solo-credit { display: flex; flex-direction: column; align-items: center; margin: 0 auto 14px; text-align: center; }
.solo-credit .meta-value { font-size: 1.15rem; margin-top: 2px; }
@media (max-width: 700px) {
    .song-header-wrapper.header-solo { display: flex; flex-direction: column; align-items: center; }
    .header-solo .header-avatar-slot { margin-bottom: 6px; }
}

/* Solo songs: original header — one photo far left, separate columns for every field */
.header-solo .credits-plate { border: 0; box-shadow: none; background: none; overflow: visible; }
.header-solo .credits-plate > :not(.song-title):not(.plate-bar) { display: none; }
.legacy-grid[hidden] { display: none; }

/* Names that link to their artist / composer / lyricist page: no visible link styling */
.person-link, .person-link:visited { color: inherit; font: inherit; text-decoration: none; border: 0; opacity: 1; cursor: pointer; }
.person-link:hover, .person-link:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

/* ---- Title is the header band of the credits card ---- */
.credits-plate .song-title {
    margin: 0 !important;
    padding: 20px 24px 18px;
    text-align: center;
    background: rgba(128, 128, 128, 0.10);
    border-bottom: 1px solid rgba(128, 128, 128, 0.38);
    font-size: clamp(1.7rem, 4.2vw, 2.5rem) !important;
    line-height: 1.15;
}
.header-solo .credits-plate .song-title { background: none; border: 0; padding: 0 0 14px; }
.song-header .credits-plate { margin-top: 0; }
@media (max-width: 700px) { .credits-plate .song-title { padding: 14px 14px 12px; } .header-solo .credits-plate .song-title { padding: 6px 0 12px; } }

/* Robust against themes that force display on .meta-grid */
.legacy-grid[hidden], .meta-grid.legacy-grid[hidden] { display: none !important; }
.header-solo .legacy-grid { display: grid; }
.credits-plate .meta-grid.details-grid {
    display: flex !important; flex-wrap: wrap; justify-content: center; align-items: flex-start;
    gap: 6px 0 !important; border: 0 !important; border-top: 1px solid rgba(128, 128, 128, 0.38) !important;
    border-radius: 0 !important; padding: 12px 0 !important; margin: 0 !important;
    background: rgba(128, 128, 128, 0.08) !important;
}
.credits-plate .details-grid .meta-item { padding: 0 22px !important; }
.credits-plate .details-grid .meta-item + .meta-item { border-left: 1px solid rgba(128, 128, 128, 0.38) !important; padding-left: 22px !important; }
@media (max-width: 700px) {
    .credits-plate .details-grid .meta-item { padding: 0 8px !important; }
    .credits-plate .details-grid .meta-item + .meta-item { padding-left: 8px !important; }
}
.header-solo .credits-plate > :not(.song-title):not(.plate-bar) { display: none !important; }

/* Photos always fill their column edge to edge, whatever padding a theme gives .meta-item */
.credits-plate .credits-grid > .meta-item.credit-item { padding: 0 !important; margin: 0 !important; }
.credits-plate .credits-grid > .meta-item.credit-item + .meta-item.credit-item { border-left: 1px solid rgba(128, 128, 128, 0.38) !important; }
.credits-plate .credits-grid > .meta-item.credit-item .meta-people { margin: 0 !important; padding: 0 !important; }

/* Details footer: three equal, centred columns that line up with the photos above */
.credits-plate .meta-grid.details-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0 !important;
    padding: 12px 0 !important;
}
.credits-plate .details-grid .meta-item {
    padding: 2px 10px !important;
    align-items: center !important;
    justify-content: flex-start;
    text-align: center;
}
.credits-plate .details-grid .meta-item + .meta-item { padding-left: 10px !important; }
.credits-plate .details-grid .meta-value { text-align: center; }

/* ===== Single-person header (artist = composer = lyricist): theme-proof ===== */
.song-header-wrapper.header-solo .credits-plate > .credits-grid,
.song-header-wrapper.header-solo .credits-plate > .meta-grid.details-grid { display: none !important; }
.song-header-wrapper.header-solo .meta-grid.legacy-grid {
    display: flex !important; flex-wrap: wrap; justify-content: center; align-items: flex-start;
    gap: 14px 0 !important; margin: 4px 0 0 !important; padding: 12px 0 0 !important;
    background: none !important; border: 0 !important; border-top: 1px solid rgba(128, 128, 128, 0.38) !important;
    border-radius: 0 !important; box-shadow: none !important;
}
.song-header-wrapper.header-solo .legacy-grid .meta-item {
    padding: 0 16px !important; margin: 0 !important; align-items: center !important; text-align: center;
    border: 0 !important; flex: 0 1 auto;
}
.song-header-wrapper.header-solo .legacy-grid .meta-item + .meta-item { border-left: 1px solid rgba(128, 128, 128, 0.38) !important; padding-left: 16px !important; }
.song-header-wrapper.header-solo .legacy-grid .meta-value { text-align: center; }
.song-header-wrapper.header-solo .credits-plate { margin: 0 !important; }
.song-header-wrapper.header-solo .credits-plate .song-title { padding: 0 0 12px !important; background: none !important; border: 0 !important; }
.song-header-wrapper.header-solo .header-avatar-slot { align-self: center; }
@media (max-width: 700px) {
    .song-header-wrapper.header-solo .legacy-grid .meta-item { padding: 0 10px !important; }
    .song-header-wrapper.header-solo .legacy-grid .meta-item + .meta-item { padding-left: 10px !important; }
    .song-header-wrapper.header-solo .legacy-grid .meta-item:nth-child(4) { border-left: 0 !important; }
}
@media (max-width: 899px) {
    .song-header-wrapper.header-solo .meta-grid.legacy-grid {
        display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 14px 0 !important;
    }
    .song-header-wrapper.header-solo .legacy-grid .meta-item { padding: 0 8px !important; }
    .song-header-wrapper.header-solo .legacy-grid .meta-item + .meta-item { padding-left: 8px !important; }
    .song-header-wrapper.header-solo .legacy-grid .meta-item:nth-child(3n+1) { border-left: 0 !important; }
    .song-header-wrapper.header-solo .legacy-grid .meta-item:nth-child(n+4) { border-left: 1px solid rgba(128, 128, 128, 0.38) !important; }
    .song-header-wrapper.header-solo .legacy-grid .meta-item:nth-child(4) { border-left: 0 !important; }
}
@media (min-width: 900px) {
    .song-header-wrapper.header-solo .meta-grid.legacy-grid { flex-wrap: nowrap !important; }
    .song-header-wrapper.header-solo .legacy-grid .meta-item { flex: 1 1 auto !important; min-width: min-content; padding: 0 10px !important; }
    .song-header-wrapper.header-solo .legacy-grid .meta-item + .meta-item { padding-left: 10px !important; }
    .song-header-wrapper.header-solo .legacy-grid .meta-value, .song-header-wrapper.header-solo .legacy-grid .meta-label { overflow-wrap: normal; word-break: normal; }
}

/* ---- Previous / next song buttons ---- */
.song-pager { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin: 34px 0 6px; padding-top: 22px; border-top: 1px solid rgba(128, 128, 128, 0.35); }
.song-pager[hidden] { display: none; }
.song-pager-btn {
    display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; min-height: 64px; justify-content: center;
    color: inherit; text-decoration: none; border: 1px solid rgba(128, 128, 128, 0.45); border-radius: 14px;
    background: rgba(128, 128, 128, 0.07); transition: background .15s, border-color .15s;
    -webkit-tap-highlight-color: transparent;
}
.song-pager-btn:hover, .song-pager-btn:focus-visible { background: rgba(128, 128, 128, 0.16); border-color: rgba(128, 128, 128, 0.75); }
.song-pager-prev { grid-column: 1; align-items: flex-start; text-align: left; }
.song-pager-next { grid-column: 2; align-items: flex-end; text-align: right; }
.song-pager-cap { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; }
.song-pager-title { font-size: clamp(.8rem, 3.7vw, 1.05rem); font-weight: 600; line-height: 1.25; overflow-wrap: break-word; hyphens: manual; }
@media (max-width: 560px) { .song-pager { gap: 10px; } .song-pager-btn { padding: 12px 12px; } .song-pager-title { font-size: 0.92rem; } }

/* ---- Edit link ---- */
.song-edit-link { display: block; width: fit-content; margin: 16px auto 0; padding: 6px 10px; font-size: 0.8rem; color: inherit; opacity: 0.5; text-decoration: none; }
.song-edit-link:hover, .song-edit-link:focus-visible { opacity: 1; text-decoration: underline; }

/* ---- Previous / next buttons at the top of the sheet ---- */
.song-pager.song-pager-top { margin: 0 0 22px; padding: 0 0 18px; border-top: 0; border-bottom: 1px solid rgba(128, 128, 128, 0.35); }
.song-pager-top .song-pager-btn { min-height: 52px; padding: 10px 16px; }
@media (max-width: 560px) { .song-pager.song-pager-top { margin-bottom: 16px; padding-bottom: 14px; } }

/* ---- Biography block on an individual's page ---- */
.person-bio { padding: 4px 20px 18px; line-height: 1.65; font-size: 0.98rem; border-bottom: 1px solid rgba(128,128,128,0.2); margin-bottom: 8px; }
.person-bio .bio-title { margin: 14px 0 8px; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.65; font-weight: 600; }
.person-bio p { margin: 0 0 0.7em; }
.person-bio .bio-source { font-size: 0.78rem; opacity: 0.6; }
.person-bio .bio-source a { color: inherit; }

/* Shared soft grade so differently lit credit photos sit together (brightness is set per photo by script) */
.credits-plate .meta-avatar:not(.meta-unknown):not(.meta-placeholder) {
    filter: grayscale(0.45) sepia(0.12) contrast(1.05) brightness(var(--photo-bright, 1));
}

/* Keep neighbouring chords from touching when several sit at the end of a row */
.token-pair .token-chord { width: 0; overflow: visible; padding-right: 0; white-space: pre; }

/* Rhythm icons */
.rhythm-icon { display: inline-flex; align-items: center; justify-content: center; color: inherit; background: color-mix(in srgb, currentColor 9%, transparent); }

/* Inline rhythm icons next to rhythm names */
.rhythm-inline { display: inline-flex; vertical-align: -0.2em; margin-left: .4em; opacity: .85; }
.rhythm-inline svg { width: 1.15em; height: 1.15em; }

/* Musicians strip (songs with several credited musicians) */
.credits-plate .musicians-strip { border-top: 1px solid rgba(128,128,128,.38); padding: 12px 10px 14px; text-align: center; }
.musicians-title { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin-bottom: 10px; }
.musicians-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; }
.musician-card { width: 112px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.musician-photo { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; object-position: center 20%; background: rgba(128,128,128,.15); }
.musician-photo.meta-unknown { object-fit: contain; padding: 14px; box-sizing: border-box; }
.musician-name { font-weight: 600; font-size: .85rem; line-height: 1.25; }
.musician-inst { font-size: .74rem; opacity: .75; line-height: 1.25; }
@media (max-width: 560px) { .musician-card { width: 96px; } .musician-photo { width: 72px; height: 72px; } }

/* Tab view toggle */
.tab-toggle { display: inline-block; margin: 0 0 12px; padding: 8px 20px; font: inherit; font-size: 1.5rem; font-weight: 600; cursor: pointer; color: var(--ink); background: transparent; border: 1.5px solid currentColor; border-radius: 999px; }
.tab-toggle:hover { opacity: .75; }
.score-content[hidden] { display: none; }
/* Keep engraved font metrics intact; only colours follow the theme. */
.score-content .score-paper { max-width: 1000px; margin: 8px auto 0; color: inherit; overflow-x: auto; }
.score-content .score-paper svg { display: block; max-width: none; color: inherit; overflow: visible; }
.score-content .score-paper svg text { fill: currentColor; }
.score-content .score-paper .abcjs-annotation { font-weight: 700; }
.score-content .score-paper .abcjs-lyric { font-family: Palatino, "Palatino Linotype", "Book Antiqua", "URW Palladio L", serif !important; font-weight: 400; font-size: 13.5px; }
.score-content .score-note { font-size: .9rem; opacity: .7; text-align: center; margin: 10px 0 0; }
.tab-content[hidden], .song-content[hidden] { display: none; }
.tab-content { padding-top: 6px; }
.tab-content .tab-label { font-weight: 700; font-size: 1.1em; margin: 14px 0 4px; }
.tab-content .tab-pane[hidden] { display: none; }
.tab-instruments { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 6px; font-family: inherit; }
.tab-instruments button { border: 1px solid color-mix(in srgb, currentColor 35%, transparent); background: color-mix(in srgb, currentColor 8%, transparent); color: inherit; font: inherit; font-size: .95rem; padding: 7px 14px; border-radius: 18px; cursor: pointer; opacity: .6; touch-action: manipulation; }
.tab-instruments button[aria-pressed="true"] { opacity: 1; background: color-mix(in srgb, currentColor 18%, transparent); font-weight: 700; }
.tab-content pre { margin: 0 0 14px; font-family: ui-monospace, Menlo, Consolas, monospace; line-height: 1.25; white-space: pre; overflow-x: auto; }

/* Song list: a line of the lyrics shown under the title when a search matched only the lyrics */
.lyric-hit { margin-top: 2px; font-size: .82rem; font-weight: 400; color: var(--muted, #68797f); font-style: italic; white-space: normal; }

/* ---- Control bar: transpose (left) and tools (right) sit in their own symmetrical band above the title ---- */
.credits-plate .plate-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; min-height: 58px; padding: 10px 16px; background: rgba(128, 128, 128, 0.17); border-bottom: 1px solid rgba(128, 128, 128, 0.38); box-sizing: border-box; }
.header-solo .credits-plate .plate-bar { background: none; border: 0; padding: 0 0 10px; }
/* "Τίτλος" caption above the title, in the same style as the other header captions */
.credits-plate .song-title::before { content: "Τίτλος"; display: block; margin: 0 0 6px; line-height: 1.2; color: var(--caption-color, inherit) !important; }
@media (max-width: 700px) { .credits-plate .song-title::before { margin-bottom: 4px; } .credits-plate .plate-bar { min-height: 52px; padding: 8px 12px; } }
.credits-plate .plate-bar > :first-child { justify-self: start; }
.credits-plate .plate-bar > :last-child { justify-self: end; }
.plate-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; justify-self: center; min-width: 0; gap: 8px; }
.plate-mid > .view-switch { order: 0; }
.plate-mid > .gender-switch { order: 1; align-self: center; }
.plate-mid:empty { display: none; }
/* phones: transpose + tools on the first row, the view/gender switches centred underneath */
@media (max-width: 640px) { .credits-plate .plate-bar.has-mid { grid-template-columns: 1fr 1fr; row-gap: 8px; } .credits-plate .plate-bar.has-mid .plate-mid { grid-column: 1 / -1; grid-row: 2; } .credits-plate .plate-bar.has-mid > :last-child { grid-column: 2; grid-row: 1; } .credits-plate .plate-bar.has-mid > :first-child { grid-column: 1; grid-row: 1; } }

/* Gender switch in the control bar */
.gender-switch, .view-switch { display: inline-flex; flex: none; height: 34px; border-radius: 17px; overflow: hidden; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); background: color-mix(in srgb, currentColor 8%, transparent); }
.gender-switch[hidden], .view-switch[hidden] { display: none; }
.gender-switch button, .view-switch button { width: 34px; border: 0; background: none; color: inherit; font: inherit; font-size: 1.35rem; line-height: 1; cursor: pointer; opacity: .55; }
.gender-switch button + button, .view-switch button + button { border-left: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
.gender-switch button.on, .view-switch button[aria-pressed="true"] { opacity: 1; background: color-mix(in srgb, currentColor 18%, transparent); font-weight: 700; }

/* touch: larger, steadier targets for the header switches (iPad / phones) */
.gender-switch button, .view-switch button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
@media (pointer: coarse) {
    .gender-switch, .view-switch { height: 44px; border-radius: 22px; }
    .gender-switch button, .view-switch button { width: 48px; font-size: 1.5rem; }
    .view-switch button svg { width: 1.6rem; height: 1.6rem; }
}

/* iPad: keep the page from panning sideways (the score is wider than a small screen and scrolls inside its own box) and keep the switch icons centred */
html, body { overscroll-behavior-x: none; }
.score-content { max-width: 100%; min-width: 0; overflow-x: clip; }
.score-content .score-paper { max-width: min(1000px, 100%); -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.gender-switch button, .view-switch button { display: inline-flex; align-items: center; justify-content: center; padding: 0; margin: 0; -webkit-appearance: none; appearance: none; }
.view-switch button svg { display: block; flex: none; }

/* Mobile optimisation: compact one-row scrollable nav, tighter spacing */
@media (max-width: 600px) {
    .navbar-container { margin-bottom: 14px; }
    .top-nav { flex-wrap: wrap; overflow: visible; padding: 4px; gap: 2px; border-radius: 12px; }
    .top-nav::-webkit-scrollbar { display: none; }
    .top-nav .nav-btn { flex: 1 1 auto; padding: 8px 10px; min-height: 40px; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; }
    .song-pager { gap: 8px; }
    .song-pager-btn { padding: 10px 10px; }
    .song-pager-title { font-size: 0.85rem; line-height: 1.25; }
    body { -webkit-text-size-adjust: 100%; }
    .theme-switcher { right: 10px; bottom: 10px; }
    .transpose-control { left: 10px; bottom: 10px; }
    .theme-switcher-btn, .transpose-control { height: 46px; }
    .theme-switcher-btn { width: 46px; }
    .theme-switcher-panel { min-width: min(280px, calc(100vw - 24px)); }
}
@media (max-width: 600px) {
    .credits-plate .credits-one .meta-avatar { height: 170px; width: 100% !important; }
}

/* People without a photo join the details footer as ordinary columns */
.credits-plate .meta-grid.details-grid:has(.detail-moved) {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)) !important;
    row-gap: 10px !important;
}
.credits-plate .details-grid .detail-moved .meta-value { font-size: inherit; }

/* Browse pages: each card carries the full song table, so cards use the whole width */
.categories-grid { grid-template-columns: minmax(0, 1fr) !important; }
.category-card .song-table-scroll { margin: 12px 0 4px; }
.category-card .song-table td:first-child { min-width: 180px; }

/* Biography popup on the people pages */
.category-header.has-bio-popup { cursor: pointer; }
.category-header.has-bio-popup:hover .category-title { text-decoration: underline; }
.bio-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.bio-popup { position: relative; background: #fff; color: #182b34; max-width: 640px; width: 100%; max-height: 85vh; overflow-y: auto; border-radius: 16px; padding: 24px 26px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); line-height: 1.6; }
.bio-popup-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; padding-right: 32px; }
.bio-popup-head img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; }
.bio-popup-head h2 { margin: 0; font-size: 1.3rem; }
.bio-popup p { margin: 0 0 10px; }
.bio-popup .bio-source { font-size: 0.8rem; opacity: 0.7; }
.bio-popup .bio-empty { opacity: 0.7; }
.bio-close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 1.8rem; line-height: 1; cursor: pointer; color: inherit; }

/* Header buttons: icon + label, centred, never wrap inside a button */
.top-nav .nav-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.top-nav .nav-btn .ui-icon { vertical-align: 0 !important; }
@media (max-width: 560px) { .top-nav .nav-btn { gap: 6px; } }

/* The active header button already names the page: keep the heading for screen readers only */
.page-title, .sr-title { position: absolute !important; width: 1px; height: 1px; margin: -1px !important; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.navbar-container { margin-bottom: 24px; }
/* Share the available space between labeled controls and keep icon slots compact. */
.top-nav {
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    overflow: visible;   /* the header never scrolls: tabs wrap and account actions live in a menu */
}
.top-nav .nav-btn {
    box-sizing: border-box;
    flex: 1 0 0;
    min-inline-size: max-content;
    block-size: 44px;
    min-block-size: 44px;
    padding: 8px 10px;
    gap: 6px;
    font-size: 0.9rem;
}
.top-nav .acc-nav { display: contents; }
.top-nav .nav-btn[data-ico="admin"],
.top-nav .nav-btn.acc-sign-in {
    flex: 0 0 44px;
    min-inline-size: 44px;
    padding-inline: 0;
}

.version-switch { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; margin:14px 0 6px; }
.version-btn { font:inherit; font-size:.9rem; padding:7px 14px; border-radius:999px; border:1px solid currentColor; background:transparent; color:inherit; cursor:pointer; opacity:.7; }
.version-btn.active { opacity:1; font-weight:600; background:rgba(128,128,128,.18); }

/* Match the navigation controls while keeping the icon clear on each theme. */
.top-nav .nav-btn.acc-sign-in {
    min-width: 40px;
    min-height: 40px;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: var(--read-muted, #52656e) !important;
}
.top-nav .nav-btn.acc-sign-in:hover,
.top-nav .nav-btn.acc-sign-in:focus-visible {
    background: color-mix(in srgb, var(--read-accent, #175c51) 12%, var(--read-surface, #fff)) !important;
    color: var(--read-accent, #175c51) !important;
}
.top-nav .nav-btn.acc-sign-in:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.year-countdown-trigger {
    font: inherit;
    color: inherit;
    background: transparent;
    border: 0;
    padding: 2px 4px;
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 0.25em;
}
.year-countdown-trigger:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.public-domain-dialog {
    width: min(31rem, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    padding: clamp(1rem, 5vw, 1.7rem);
    border: 1px solid color-mix(in srgb, CanvasText 20%, Canvas);
    border-radius: 14px;
    color: CanvasText;
    background: Canvas;
    box-shadow: 0 24px 72px #0004;
}
.public-domain-dialog::backdrop { background: #0008; }
.public-domain-dialog h2 { font-size: 1.15rem; margin: 0; }
.public-domain-status { font-size: 1.5rem; font-weight: 700; margin: 0.8rem 0 0.35rem; }
.public-domain-scope { font-size: 0.9rem; }
.public-domain-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.2rem; }
.public-domain-actions button { font: inherit; padding: 0.35rem 0.65rem; cursor: pointer; }

/* Quick navigation remains outside the printable music. */
.song-jump { position: relative; max-width: 38rem; margin: 0 auto 1.2rem; font: 400 0.95rem/1.4 system-ui, sans-serif; }
.song-jump label { display: block; margin-bottom: 0.4rem; font-size: 0.8rem; font-weight: 650; color: inherit; }
.song-jump input { display: block; box-sizing: border-box; width: 100%; min-height: 44px; padding: 0.7rem 0.9rem; border: 1px solid #87969b; border-radius: 0.65rem; background: Canvas; color: CanvasText; font: inherit; }
.song-jump input:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.song-jump-results { position: absolute; inset-inline: 0; top: 100%; z-index: 50; max-height: 22rem; overflow: auto; margin-top: 0.35rem; border: 1px solid #87969b; border-radius: 0.65rem; box-shadow: 0 8px 24px #0003; background: Canvas; color: CanvasText; }
.song-jump-results[hidden] { display: none; }
.song-jump-results a { display: grid; gap: 0.15rem; padding: 0.7rem 0.9rem; color: inherit; text-decoration: none; border-bottom: 1px solid #87969b55; }
.song-jump-results a:last-child { border: 0; }
.song-jump-results a:hover, .song-jump-results a:focus-visible { background: color-mix(in srgb, CanvasText 10%, Canvas); outline: 2px solid currentColor; outline-offset: -2px; }
.song-jump-results span { font-size: 0.8rem; color: inherit; }
.song-jump-results p { padding: 0.7rem 0.9rem; margin: 0; }
.song-end-tools { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin: 1.75rem auto 1rem; padding-block: 1rem; border-block-start: 1px solid #87969b66; }
.song-end-tools > span { font: 650 0.8rem/1.3 system-ui, sans-serif; color: inherit; }
.song-end-tools .song-end-transpose { position: static; inset: auto; z-index: auto; width: auto; height: 52px; flex: none; margin: 0; background: Canvas; color: CanvasText; border: 1px solid #87969b; }
.song-end-transpose .transpose-caption { color: inherit; }
@media print { .song-jump, .song-end-tools { display: none !important; } }


/* Previous, search and next share one balanced navigation row. */
.song-pager.song-pager-top {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 1.45fr) minmax(0, 1fr);
    align-items: center; gap: clamp(8px, 2vw, 16px);
}
.song-pager-top > :first-child:not(.song-jump) { grid-column: 1; }
.song-pager-top > .song-jump { grid-column: 2; grid-row: 1; }
.song-pager-top > :last-child:not(.song-jump) { grid-column: 3; }
.song-pager-top .song-jump {
    width: 100%; min-width: 0; max-width: none; margin: 0; padding: 0; text-align: center;
    font-family: var(--ui-font, system-ui, sans-serif); color: inherit;
}
.song-pager-top .song-jump label {
    display: flex; align-items: center; gap: 8px; margin: 0 0 7px;
    font: 650 0.68rem/1.25 var(--ui-font, system-ui, sans-serif); color: inherit;
}
.song-pager-top .song-jump label::before,
.song-pager-top .song-jump label::after {
    content: ""; flex: 1; border-top: 1px solid rgba(128,128,128,0.38);
}
.song-jump-field { position: relative; }
.song-jump-icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; pointer-events: none; }
.song-pager-top .song-jump input {
    width: 100%; min-height: 44px; padding: 0.65rem 34px;
    border: 1px solid rgba(128,128,128,0.45); border-radius: 0.5rem;
    background: rgba(128,128,128,0.06); color: inherit;
    font-family: inherit; font-size: 0.94rem; text-align: center;
}
.song-pager-top .song-jump input::placeholder { color: inherit; opacity: 0.75; }
.song-pager-top .song-jump-results { text-align: center; }
@media (max-width: 560px) {
    .song-pager.song-pager-top { grid-template-columns: minmax(40px, 1fr) minmax(0, 3fr) minmax(40px, 1fr); gap: 8px; }
    .song-pager-top .song-pager-btn { padding: 10px 6px; align-items: center; justify-content: center; }
    .song-pager-top .song-pager-title { display: none; }
    .song-pager-top .song-pager-cap { font-size: 0; opacity: 1; }
    .song-pager-top .song-pager-prev .song-pager-cap::before { content: "←"; font-size: 1.3rem; }
    .song-pager-top .song-pager-next .song-pager-cap::before { content: "→"; font-size: 1.3rem; }
    .song-pager-top .song-jump input { font-size: 16px; padding-inline: 30px; }
    .song-pager-top .song-jump label { font-size: 0.62rem; }
}

/* Rhythm navigation uses the same plain link treatment as people credits. */
a.rhythm-link {
    display: inline-flex; align-items: center; gap: 0.35rem;
    min-height: 0; padding: 0; border: 0; border-radius: 0;
    background: none; color: inherit; font: inherit; line-height: inherit;
    text-decoration: none; vertical-align: baseline; cursor: pointer;
}
a.rhythm-link:hover, a.rhythm-link:focus-visible {
    background: none; text-decoration: underline; text-underline-offset: 3px;
}
a.rhythm-link .rhythm-inline { margin: 0; flex: none; }
.song-table a.rhythm-link { font-size: inherit; }
/* Rhythm icons always sit to the right of the rhythm's name (in lists, song headers and the Rhythms page headings) */
.category-header .rhythm-icon { order: 2; }

.bio-edit-btn { position: absolute; top: 12px; right: 46px; border: 0; background: transparent; color: inherit; font-size: 1.05rem; line-height: 1; cursor: pointer; opacity: 0.35; padding: 2px 4px; }
.bio-edit-btn:hover, .bio-edit-btn:focus-visible { opacity: 0.9; }
.song-table th.song-rights-cell, .song-table td.song-rights-cell { text-align: center; vertical-align: middle; white-space: nowrap; width: 1%; }
.category-card .song-table td { vertical-align: middle; }
.category-card .song-table td:not(:first-child) { min-width: 90px; }
.category-card .song-table td.song-rights-cell, .category-card .song-table th.song-rights-cell { min-width: 0; padding-inline: 10px; }

/* Songs with several time signatures: one bracket on the right per run of rows sharing a time signature (drawn by viewer-core.js; sizes follow the sheet's font size) */
#song-content { position: relative; }
.ts-bracket { position: absolute; right: 0.2em; width: 0.75em; pointer-events: none; z-index: 1; }
/* the height is only implied: the stroke fades out between its two ends, so the handwritten label carries the section */
.ts-bracket::before { content: ''; position: absolute; inset: 0; box-sizing: border-box; border: 0.09em solid var(--ts-ink, color-mix(in srgb, currentColor 60%, transparent)); border-left: 0; border-radius: 0 0.95em 0.7em 0 / 0 1.3em 0.9em 0; opacity: .9;
    -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 0.9em, transparent 2.4em, transparent calc(100% - 2.4em), #000 calc(100% - 0.9em), #000 100%); mask-image: linear-gradient(to bottom, #000 0, #000 0.9em, transparent 2.4em, transparent calc(100% - 2.4em), #000 calc(100% - 0.9em), #000 100%); }
.ts-change { position: absolute; left: 0; width: max-content; pointer-events: none; z-index: 1; }
.ts-label { display: grid; justify-items: center; transform: rotate(-4deg); gap: 0; font: 700 0.95em/0.85 'Caveat', 'Segoe Print', 'Bradley Hand', cursive; color: color-mix(in srgb, currentColor 62%, transparent); font-variant-numeric: lining-nums; }
.ts-label > span:first-child { padding-bottom: 0.02em; border-bottom: 0.07em solid currentColor; min-width: 0.9em; text-align: center; border-radius: 0.1em; }
@media print { .ts-bracket { border-color: #444; } .ts-label { color: #444; } }

/* Alternative notation: tiny time-signature label at the top-left of the first row of each run */
.ts-mark { position: absolute; left: 0.25em; transform: translateY(-0.55em); font: 700 0.72em/1 'Caveat', 'Segoe Print', 'Bradley Hand', cursive; color: var(--ink, #000); letter-spacing: 0.02em; pointer-events: none; z-index: 1; }
#ts-style-toggle { display: block; margin: 0 0 6px auto; padding: 3px 10px; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 8px; background: transparent; color: inherit; font: 600 0.72rem/1.4 system-ui, sans-serif; opacity: 0.7; cursor: pointer; }
#ts-style-toggle:hover { opacity: 1; }
@media print { #ts-style-toggle { display: none; } }

/* rows that change time signature part-way keep room above the chord line for the handwritten marks */
.lyric-line-block.has-ts-inline { padding-top: 1.9em; }
.ts-inline { display: inline-block; width: 0; height: 0; }
.ts-change.ts-above .ts-label { font-size: 0.8em; transform: rotate(-4deg); }

.person-bio .bio-more { background: none; border: 0; padding: 0; margin: 2px 0 8px; font: inherit; font-size: 0.9rem; font-weight: 600; color: inherit; opacity: 0.75; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.person-bio .bio-more:hover { opacity: 1; }
.person-bio p[hidden], .person-bio .bio-source[hidden] { display: none; }

/* Features that need an account: shown to guests, faded and struck through */
.is-locked{position:relative;opacity:.42;filter:grayscale(1)}
.view-switch button.is-locked::after,.transpose-control.is-locked::after{content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit;background:linear-gradient(to top right,transparent calc(50% - 1px),currentColor calc(50% - 1px),currentColor calc(50% + 0.5px),transparent calc(50% + 0.5px));opacity:.85}
@media (hover:hover){.is-locked:hover{opacity:.6}}
.score-locked{display:flex;flex-direction:column;align-items:center;gap:12px;padding:40px 16px;text-align:center}
.score-locked p{margin:0}
.score-locked button{cursor:pointer;font:inherit;padding:8px 18px;border-radius:999px;border:1px solid currentColor;background:transparent;color:inherit}

/* Song header: when the rhythm name wraps, keep the icon right beside the last word instead of at the far edge */
#meta-rhythm a.rhythm-link { display: inline; }
/* The rhythm text is centred exactly like the other credits: its icon sits in a reserved side margin instead of pushing the text off-centre */
#meta-rhythm, #lg-rhythm { position: relative; width: fit-content; max-width: 100%; margin-inline: auto; padding-inline: 1.5em; }
#meta-rhythm a.rhythm-link .rhythm-inline, #lg-rhythm a.rhythm-link .rhythm-inline { display: inline-block; position: absolute; right: .1em; top: 50%; transform: translateY(-50%); margin: 0; }

/* Engraved score: glyphs (noteheads, clefs, rests, accidentals) follow the theme text colour so they stay visible on dark themes */
.score-content .score-paper svg { fill: currentColor; }
.score-content .score-paper svg [fill="none"] { fill: none; }

/* Song header: a word is never broken in the middle, in any theme or width. Text that would not fit is scaled down by fitHeaderWords() (viewer-core.js). */
.song-header-wrapper, .song-header-wrapper * { overflow-wrap: normal !important; word-break: normal !important; hyphens: manual !important; }

/* X1 / X2 row zoom (under the song header) */
.zoom-bar { display: flex; justify-content: center; gap: 0; margin: 4px auto 12px; }
.zoom-bar[hidden] { display: none; }
.zoom-bar button { min-width: 56px; padding: 6px 16px; border: 1px solid currentColor; background: transparent; color: inherit; font: 700 .9rem/1 inherit; font-family: inherit; cursor: pointer; opacity: .55; }
.zoom-bar button:first-child { border-radius: 9px 0 0 9px; border-right-width: 0; }
.zoom-bar button:last-child { border-radius: 0 9px 9px 0; }
.zoom-bar button[aria-pressed="true"] { opacity: 1; background: color-mix(in srgb, currentColor 14%, transparent); }
.zoom-bar button:disabled { opacity: .25; cursor: not-allowed; }
.tab-content .tab-section { margin-block: 0 .9rem; }
.tab-content .tab-section pre { margin-bottom: 8px; }

/* Works still under copyright: only the master sees chords/tabs/lyrics/score; everybody else gets this notice */
.song-restricted-note { margin: 1.5rem auto; max-width: 38rem; padding: 1rem 1.25rem; border: 1px solid color-mix(in srgb, CanvasText 25%, Canvas); border-radius: 0.6rem; text-align: center; line-height: 1.55; }
body.song-restricted :is(#view-switch, .transpose-control, .song-end-tools, #song-end-tools, .zoom-bar, #zoom-bar) { display: none !important; }

/* Songs added by users: uploader + votes in the chord header */
.uploader-bar { display: flex; flex-wrap: wrap; gap: .6rem 1.1rem; align-items: center; justify-content: center; padding: .6rem 1rem; border-top: 1px solid color-mix(in srgb, CanvasText 18%, Canvas); font-size: .9rem; }
.uploader-votes { display: inline-flex; gap: .4rem; align-items: center; }
.vote-btn { font: inherit; padding: .2rem .65rem; border: 1px solid color-mix(in srgb, CanvasText 30%, Canvas); border-radius: 999px; background: transparent; color: inherit; cursor: pointer; }
.vote-btn { display: inline-flex; align-items: center; gap: .35rem; }
.vote-btn svg { width: 1.1em; height: 1.1em; }
.vote-btn.on { background: color-mix(in srgb, CanvasText 14%, Canvas); font-weight: 700; }
.vote-btn.on svg { fill: currentColor; fill-opacity: .25; }
.vote-btn:disabled { opacity: .45; cursor: not-allowed; }
.uploader-edit { text-decoration: underline; color: inherit; }
/* The ΚΚ / ΙΚ column is only for the master and lieutenant accounts (public-domain.js adds .rights-visible) */
html:not(.rights-visible) .song-table th.song-rights-cell, html:not(.rights-visible) .song-table td.song-rights-cell { display: none !important; }

/* Credits plate details footer: even columns, equal heights, one text size, no icon on top of the text */
.credits-plate .meta-grid.details-grid:has(.detail-moved) {
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)) !important;
    row-gap: 14px !important;
    align-items: stretch !important;
    overflow: hidden;
}
.credits-plate .details-grid:has(.detail-moved) .meta-item {
    border-left: 0 !important;
    box-shadow: -1px 0 0 rgba(128, 128, 128, 0.38);
    padding: 2px 12px !important;
    justify-content: flex-start;
}
.credits-plate .details-grid:has(.detail-moved) .meta-value { font-size: .9rem !important; line-height: 1.3; overflow-wrap: normal; }
.credits-plate .details-grid:has(.detail-moved) .meta-label { text-align: center; }
.details-grid #meta-rhythm { width: auto; padding-inline: 0; margin-inline: 0; }
.details-grid #meta-rhythm a.rhythm-link .rhythm-inline { position: static; transform: none; display: inline-block; vertical-align: middle; margin-inline-start: .3em; }

/* Account menu in the header (replaces the separate «Προσθήκη τραγουδιού», «Οι λίστες μου» and «Έξοδος» buttons) */
.top-nav .acc-menu { position: relative; display: inline-flex; flex: 0 0 auto; margin-inline-start: auto; }
.top-nav .acc-user { flex: 0 0 auto; min-inline-size: 0; }
.top-nav .acc-user-name { max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-menu-list { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 60; min-width: 220px; padding: 6px; display: flex; flex-direction: column; gap: 2px;
    background: var(--read-surface, #fff); color: var(--read-text, #182b34); border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.22); }
.acc-menu-list[hidden] { display: none; }
.acc-menu-who { padding: 8px 12px 6px; font-size: .78rem; opacity: .65; border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent); margin-bottom: 4px; }
.acc-menu-item { display: block; padding: 10px 12px; border-radius: 8px; color: inherit; text-decoration: none; font-size: .92rem; }
.acc-menu-item:hover, .acc-menu-item:focus-visible { background: color-mix(in srgb, var(--read-accent, #175c51) 12%, transparent); outline: none; }

/* Κοινό Κτήμα / Ιδιωτικό Κτήμα (rights) is visible only to master and lieutenant accounts */
html:not(.rights-visible) .song-view-buttons,
html:not(.rights-visible) #public-domain-catalog-note,
html:not(.rights-visible) #public-domain-view,
html:not(.rights-visible) #upcoming-domain-view,
html:not(.rights-visible) .public-domain-stamp,
html:not(.rights-visible) #public-domain-dialog { display: none !important; }
