:root {
    --chords-accent: #01a982;
    --chords-accent-dark: #008567;
    --chords-accent-soft: #2ad2c9;
    --chords-muted: #9ca9a7;
    --chords-card-bg: rgba(255, 255, 255, .025);
    --chords-card-border: rgba(95, 122, 118, .26);
    --chords-text: #f3f6f5;
    --chords-text-muted: #aab5b3;
}

.public-chords-page {
    width: min(calc(100% - 48px), 1440px);
    margin-inline: auto;
    padding: 24px 0 64px;
    color: var(--chords-text);
}

.public-chords-layout {
    display: grid;
    grid-template-columns: 360px minmax(280px, .75fr) minmax(460px, 1.4fr);
    gap: 18px;
    align-items: stretch;
}

.public-chords-panel,
.public-chords-live {
    display: contents;
}

.public-chords-video-column,
.public-chords-now,
.public-chords-guitar,
.public-chords-timeline {
    min-width: 0;
    height: 450px;
    min-height: 450px;
    max-height: 450px;
    overflow: hidden;
    background: var(--chords-card-bg);
    border: 1px solid var(--chords-card-border);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.public-chords-video-column {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
}

.public-chords-video {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border-radius: 13px 13px 0 0;
}

.public-chords-video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.public-chords-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 20px;
    padding: 17px 0 14px;
    border-bottom: 1px solid rgba(42, 210, 201, .42);
}

.public-chords-track div { min-width: 0; }
.public-chords-track span {
    display: block;
    color: var(--chords-accent);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.public-chords-track h1 {
    margin: 4px 0 0;
    overflow: hidden;
    color: var(--chords-text);
    font-size: 1.05rem;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-chords-track > a {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(42, 210, 201, .55);
    border-radius: 8px;
    color: var(--chords-accent-soft);
    text-decoration: none;
}

.public-chords-facts {
    display: grid;
    gap: 9px;
    padding: 16px 20px 20px;
    color: var(--chords-text-muted);
    font-size: .78rem;
}

.public-chords-facts span {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: baseline;
    gap: 8px;
}

.public-chords-facts strong {
    overflow: hidden;
    color: var(--chords-text);
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-chords-now {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-rows: auto 150px auto auto;
    align-content: center;
    padding: 24px;
    text-align: center;
}

.public-chords-now > span,
.public-chords-guitar > span,
.public-compatible-notes > span {
    color: var(--chords-text-muted);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.public-chords-now > strong {
    width: 100%;
    height: 150px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--chords-accent-soft);
    font-size: clamp(4rem, 7vw, 7rem);
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transform-origin: center;
}

.public-chords-now > strong.is-long { font-size: clamp(3rem, 5vw, 5.25rem); }
.public-chords-now > strong.is-very-long { font-size: clamp(2.35rem, 4vw, 4rem); }

.public-chords-now > small {
    display: block;
    min-height: 22px;
    color: var(--chords-text-muted);
    font-size: .82rem;
    line-height: 22px;
}

.public-chords-guitar {
    grid-column: 3;
    grid-row: 1;
    display: grid;
    grid-template-rows: auto 28px 235px minmax(0, 1fr);
    padding: 24px;
}

.public-chords-guitar > strong {
    overflow: hidden;
    color: var(--chords-text);
    font-size: 1.05rem;
    font-weight: 650;
    line-height: 28px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-guitar-diagram {
    width: 100%;
    height: 235px;
    min-height: 235px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.public-guitar-diagram svg {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
}

.public-diagram-unavailable {
    color: var(--chords-text-muted);
    font-size: .82rem;
}

.public-compatible-notes {
    min-height: 0;
    overflow: hidden;
    padding-top: 12px;
    border-top: 1px solid rgba(95, 122, 118, .28);
}

.public-compatible-notes strong,
.public-compatible-notes small {
    display: block;
    overflow: hidden;
    margin-top: 5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-compatible-notes strong {
    color: var(--chords-accent-soft);
    font-size: .9rem;
    font-weight: 650;
}

.public-compatible-notes small {
    color: var(--chords-text-muted);
    font-size: .76rem;
}

.public-chords-timeline {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 280px;
    min-height: 280px;
    max-height: 280px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    grid-auto-rows: 52px;
    align-content: start;
    gap: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px;
    scrollbar-color: rgba(95, 122, 118, .55) transparent;
    scrollbar-width: thin;
}

.public-chords-timeline::-webkit-scrollbar { width: 7px; }
.public-chords-timeline::-webkit-scrollbar-track { background: transparent; }
.public-chords-timeline::-webkit-scrollbar-thumb {
    background: rgba(95, 122, 118, .48);
    border-radius: 8px;
}

.public-chord-row {
    width: 100%;
    height: 52px;
    min-height: 52px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    overflow: hidden;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--chords-text);
    text-align: left;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.public-chord-row time {
    overflow: hidden;
    color: var(--chords-text-muted);
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-chord-row strong {
    overflow: hidden;
    font-size: .96rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-chord-row:hover,
.public-chord-row.is-active {
    border-color: rgba(1, 169, 130, .75);
    background: rgba(1, 169, 130, .10);
    color: var(--chords-text);
}

html[data-theme="light"] body.music-body {
    --chords-card-bg: rgba(66, 85, 99, .035);
    --chords-card-border: rgba(95, 122, 118, .28);
    --chords-text: #172033;
    --chords-text-muted: #425563;
}

html[data-theme="light"] body.music-body .public-chords-track h1,
html[data-theme="light"] body.music-body .public-chords-facts strong,
html[data-theme="light"] body.music-body .public-chords-guitar > strong,
html[data-theme="light"] body.music-body .public-chord-row,
html[data-theme="light"] body.music-body .public-chord-row strong {
    color: #172033 !important;
    -webkit-text-fill-color: #172033 !important;
}

html[data-theme="light"] body.music-body .public-chords-track span,
html[data-theme="light"] body.music-body .public-chords-now > span,
html[data-theme="light"] body.music-body .public-chords-now > small,
html[data-theme="light"] body.music-body .public-chords-guitar > span,
html[data-theme="light"] body.music-body .public-compatible-notes > span,
html[data-theme="light"] body.music-body .public-compatible-notes > small,
html[data-theme="light"] body.music-body .public-chords-facts,
html[data-theme="light"] body.music-body .public-chord-row time {
    color: #425563 !important;
    -webkit-text-fill-color: #425563 !important;
}

html[data-theme="light"] body.music-body .public-chords-now > strong,
html[data-theme="light"] body.music-body .public-compatible-notes > strong {
    color: var(--chords-accent-dark) !important;
    -webkit-text-fill-color: var(--chords-accent-dark) !important;
}

html[data-theme="light"] body.music-body .public-guitar-diagram line,
html[data-theme="light"] body.music-body .public-guitar-diagram circle[fill="none"] { stroke: #425563 !important; }
html[data-theme="light"] body.music-body .public-guitar-diagram line[stroke="#01a982"] { stroke: #008567 !important; }
html[data-theme="light"] body.music-body .public-guitar-diagram text { fill: #425563 !important; }

@media (max-width: 1160px) {
    .public-chords-layout { grid-template-columns: 360px minmax(320px, 1fr); }
    .public-chords-video-column { grid-column: 1; grid-row: 1; }
    .public-chords-now { grid-column: 2; grid-row: 1; }
    .public-chords-guitar { grid-column: 1 / -1; grid-row: 2; }
    .public-chords-timeline { grid-column: 1 / -1; grid-row: 3; }
}

@media (max-width: 760px) {
    .public-chords-page { width: calc(100% - 20px); padding-top: 12px; }
    .public-chords-layout {
        grid-template-columns: minmax(96px, .42fr) minmax(180px, 1fr);
        gap: 12px 10px;
    }

    .public-chords-now {
        grid-column: 1;
        grid-row: 1;
        height: 300px;
        min-height: 300px;
        max-height: 300px;
        grid-template-rows: auto minmax(0, 1fr) auto auto;
        padding: 14px 10px;
    }

    .public-chords-now > span { font-size: .65rem; }
    .public-chords-now > strong {
        height: auto;
        min-height: 0;
        font-size: clamp(3.2rem, 16vw, 5rem);
    }
    .public-chords-now > strong.is-long { font-size: clamp(2rem, 10vw, 3.25rem); }
    .public-chords-now > strong.is-very-long { font-size: clamp(1.5rem, 8vw, 2.5rem); }
    .public-chords-now > small {
        min-height: 18px;
        font-size: .66rem;
        line-height: 18px;
        white-space: nowrap;
    }

    .public-chords-guitar {
        grid-column: 2;
        grid-row: 1;
        height: 300px;
        min-height: 300px;
        max-height: 300px;
        grid-template-rows: auto 24px minmax(0, 1fr);
        padding: 14px 12px;
    }
    .public-chords-guitar > span { font-size: .65rem; }
    .public-chords-guitar > strong { font-size: .9rem; line-height: 24px; }
    .public-guitar-diagram { height: 235px; min-height: 0; }
    .public-compatible-notes { display: none; }

    .public-chords-timeline {
        grid-column: 1 / -1;
        grid-row: 2;
        height: 280px;
        min-height: 280px;
        max-height: 280px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 10px;
    }

    .public-chords-video-column {
        grid-column: 1 / -1;
        grid-row: 3;
        height: auto;
        min-height: 0;
        max-height: none;
    }
    .public-chords-track { margin: 0 14px; padding: 12px 0; }
    .public-chords-track h1 { font-size: .95rem; }
    .public-chords-facts { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .public-chord-row { transition: none; }
}
