:root {
    --board-ink: #151514;
    --board-deep: #0e0e0d;
    --board-mid: #292824;
    --paper: #f5dc73;
    --paper-light: #fff1a9;
    --paper-shadow: rgba(0, 0, 0, 0.38);
    --ink: #171714;
    --muted-ink: #625a38;
    --yellow: #f8c72d;
    --yellow-dark: #aa7800;
    --red: #ba4e3d;
    --green: #286744;
    --blue: #255f71;
    --line: rgba(154, 123, 28, 0.2);
    --display: "Architects Daughter", "Comic Sans MS", cursive;
    --sans: "DM Sans", Inter, system-ui, sans-serif;
    --mono: "DM Mono", ui-monospace, monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(ellipse at 22% 18%, rgba(255, 255, 255, 0.04), transparent 30%),
        radial-gradient(ellipse at 78% 70%, rgba(0, 0, 0, 0.28), transparent 36%),
        repeating-linear-gradient(92deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 5px),
        var(--board-deep);
    font: 400 16px/1.5 var(--sans);
}

body.splash-active {
    overflow: hidden;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background: radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.58));
}

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding: 0;
    color: var(--ink);
    background:
        linear-gradient(90deg, transparent 0 8.4%, rgba(205, 99, 75, 0.48) 8.4% 8.58%, transparent 8.58%),
        repeating-linear-gradient(0deg, transparent 0 34px, var(--line) 34px 35px),
        linear-gradient(100deg, var(--paper) 0%, #f9e386 48%, #efd163 100%);
    opacity: 1;
    transition: opacity 380ms ease, visibility 380ms ease;
}

.splash-screen::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: 0.22;
    background:
        radial-gradient(circle at 20% 30%, #fff 0 1px, transparent 1.5px) 0 0 / 19px 17px,
        radial-gradient(ellipse at center, transparent 56%, rgba(119, 80, 0, 0.18));
    mix-blend-mode: multiply;
}

.splash-screen.is-complete {
    visibility: hidden;
    opacity: 0;
}

.splash-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 100%;
    min-height: 100dvh;
    padding: clamp(42px, 8vw, 76px) clamp(26px, 7vw, 68px) clamp(34px, 6vw, 54px);
    background: transparent;
}

.splash-card::after {
    position: absolute;
    top: 18px;
    right: 50%;
    width: 120px;
    height: 22px;
    content: "";
    background: rgba(255, 245, 186, 0.58);
    box-shadow: 0 3px 4px rgba(100, 70, 0, 0.12);
    transform: translateX(50%) rotate(2deg);
}

.splash-eyebrow {
    margin: 0 0 18px;
    color: var(--red);
    font-size: clamp(0.65rem, 2.5vw, 0.78rem);
    font-weight: 800;
    letter-spacing: 0.17em;
    text-align: center;
}

.splash-logo {
    font: 400 clamp(3.5rem, 13vw, 6.6rem) / 0.88 var(--display);
    letter-spacing: -0.09em;
    text-align: center;
    white-space: nowrap;
}

.splash-logo span {
    color: var(--red);
}

.splash-byline {
    margin: 18px 0 clamp(36px, 8vw, 58px);
    color: var(--muted-ink);
    font: 500 clamp(0.88rem, 3vw, 1rem) / 1.2 var(--mono);
    letter-spacing: 0.08em;
    text-align: center;
}

.splash-progress-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    color: var(--muted-ink);
    font: 800 0.7rem/1 var(--sans);
    letter-spacing: 0.13em;
    width: min(520px, 100%);
}

.splash-progress-row strong {
    min-width: 42px;
    color: var(--ink);
    font: 500 0.9rem/1 var(--mono);
    letter-spacing: 0;
    text-align: right;
}

.splash-progress {
    height: 14px;
    padding: 3px;
    overflow: hidden;
    background: rgba(255, 249, 213, 0.55);
    border: 2px solid var(--ink);
    box-shadow: 3px 3px 0 rgba(23, 23, 20, 0.18);
    width: min(520px, 100%);
}

.splash-progress span {
    display: block;
    width: 0;
    height: 100%;
    background:
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.18) 0 5px, transparent 5px 10px),
        var(--red);
}

.splash-enter {
    min-width: min(280px, 100%);
    min-height: 54px;
    margin-top: 28px;
    padding: 13px 24px;
    color: var(--paper-light);
    background: var(--board-ink);
    border: 2px solid var(--board-ink);
    box-shadow: 5px 6px 0 rgba(103, 64, 0, 0.24);
    font: 800 0.88rem/1 var(--sans);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.38;
    transform: translateY(8px);
    transition: opacity 220ms ease, transform 220ms ease, background 160ms ease;
}

.splash-screen.is-ready .splash-enter {
    opacity: 1;
    transform: translateY(0);
}

.splash-enter:disabled {
    cursor: wait;
}

.splash-enter:not(:disabled):hover,
.splash-enter:not(:disabled):focus-visible {
    color: var(--ink);
    background: var(--paper-light);
    outline: 3px solid var(--red);
    outline-offset: 4px;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
select {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 20;
    padding: 9px 14px;
    color: var(--paper-light);
    background: var(--board-ink);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.board {
    min-height: 100vh;
    padding: clamp(24px, 5vw, 74px) clamp(12px, 4vw, 60px);
}

.notebook {
    position: relative;
    width: min(1160px, 100%);
    margin: 0 auto;
    padding: clamp(26px, 5vw, 62px) clamp(16px, 5.5vw, 76px) 28px;
    overflow: hidden;
    background:
        linear-gradient(90deg, transparent 0 8.4%, rgba(205, 99, 75, 0.48) 8.4% 8.58%, transparent 8.58%),
        repeating-linear-gradient(0deg, transparent 0 34px, var(--line) 34px 35px),
        linear-gradient(100deg, var(--paper) 0%, #f9e386 48%, #efd163 100%);
    box-shadow:
        0 24px 55px var(--paper-shadow),
        0 0 0 10px #1e1d1a,
        0 0 0 14px #37342d,
        0 0 0 18px #121211;
}

.notebook::before,
.notebook::after {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    content: "";
}

.notebook::before {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 0.2;
    background: radial-gradient(circle at 20% 30%, #fff 0 1px, transparent 1.5px) 0 0 / 19px 17px;
    mix-blend-mode: multiply;
}

.notebook::after {
    top: 20px;
    right: 22px;
    width: 72px;
    height: 14px;
    background: rgba(255, 245, 186, 0.48);
    box-shadow: 0 3px 4px rgba(100, 70, 0, 0.12);
    transform: rotate(3deg);
}

.site-header,
main,
.site-footer {
    position: relative;
    z-index: 1;
}

.site-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: clamp(28px, 5vw, 58px);
}

.eyebrow,
.section-kicker,
.note-label {
    margin: 0 0 7px;
    color: var(--red);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.brand-lockup h1 {
    margin: 0;
    font: 400 clamp(3rem, 7vw, 6.7rem) / 0.87 var(--display);
    letter-spacing: -0.09em;
    transform: rotate(-2deg);
}

.brand-lockup h1 span {
    color: var(--red);
}

.subtitle {
    max-width: 465px;
    margin: 16px 0 0;
    color: var(--muted-ink);
    font-size: clamp(1rem, 1.6vw, 1.18rem);
    font-weight: 600;
}

.price-note {
    position: relative;
    flex: 0 0 auto;
    width: 176px;
    padding: 19px 16px 15px;
    text-align: center;
    background: #f7c938;
    box-shadow: 4px 7px 0 rgba(103, 64, 0, 0.17);
    transform: rotate(3deg);
}

.price-note .tape {
    position: absolute;
    top: -12px;
    left: 34px;
    width: 104px;
    height: 24px;
    background: rgba(255, 245, 187, 0.55);
    transform: rotate(-4deg);
}

.price-note strong {
    display: block;
    font: 400 1.48rem/1.05 var(--display);
}

.price-note small {
    display: block;
    margin-top: 12px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.paper-card {
    margin-top: 24px;
    padding: clamp(18px, 3vw, 34px);
    background: rgba(255, 242, 160, 0.46);
    border: 1px solid rgba(139, 99, 12, 0.22);
    box-shadow: 4px 6px 0 rgba(114, 78, 0, 0.1);
}

.composer {
    margin-top: 0;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.section-heading.compact {
    align-items: center;
    margin-bottom: 14px;
}

.section-heading > div:first-child {
    min-width: 0;
    max-width: 100%;
}

.report-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.new-report-button {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 0.78rem;
}

.section-heading h2 {
    margin: 0;
    font: 400 clamp(1.75rem, 4vw, 3.25rem) / 1 var(--display);
    letter-spacing: -0.04em;
}

.doodle-mark {
    color: var(--red);
    font-size: 2rem;
    transform: rotate(16deg);
}

.status-message {
    margin: -7px 0 20px;
    padding: 12px 15px;
    color: var(--ink);
    background: rgba(255, 249, 207, 0.64);
    border-left: 5px solid var(--blue);
    font-weight: 700;
}

.status-message.success {
    border-color: var(--green);
}

.status-message.error {
    border-color: var(--red);
}

.status-message[hidden] {
    display: none;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.composer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(230px, 0.75fr);
    gap: clamp(18px, 4vw, 50px);
}

.input-group label,
.field-label-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
}

.input-group label span,
.field-hint {
    color: var(--muted-ink);
    font-size: 0.78rem;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    color: var(--ink);
    background: rgba(255, 247, 197, 0.6);
    border: 2px solid rgba(71, 55, 9, 0.28);
    border-radius: 2px;
    outline: 0;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input,
select {
    min-height: 48px;
    padding: 11px 13px;
}

textarea {
    min-height: 290px;
    padding: 16px;
    resize: vertical;
    font: 400 0.9rem/1.75 var(--mono);
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.audio-upload {
    margin-top: 18px;
}

.audio-dropzone {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 88px;
    padding: 15px 17px;
    background: rgba(255, 247, 197, 0.48);
    border: 2px dashed rgba(71, 55, 9, 0.42);
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease;
}

.audio-dropzone:hover,
#audioFile:focus-visible + .audio-dropzone {
    background: rgba(255, 249, 213, 0.75);
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 95, 113, 0.22);
    outline: 3px solid rgba(37, 95, 113, 0.45);
    outline-offset: 2px;
}

.audio-dropzone-mark {
    display: grid;
    flex: 0 0 45px;
    width: 45px;
    height: 45px;
    place-items: center;
    color: var(--paper-light);
    background: var(--ink);
    font: 400 1.7rem var(--display);
    transform: rotate(-3deg);
}

.audio-dropzone span:last-child,
.audio-dropzone small {
    display: block;
}

.audio-dropzone small {
    margin-top: 2px;
    color: var(--muted-ink);
}

.audio-file-status,
.upload-progress-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.audio-file-status {
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(40, 103, 68, 0.09);
    border-left: 4px solid var(--green);
}

.audio-file-status strong,
.audio-file-status span {
    display: block;
    overflow-wrap: anywhere;
}

.audio-file-status span {
    color: var(--muted-ink);
    font-size: 0.76rem;
}

.audio-remove {
    min-height: 36px;
    padding: 6px 9px;
    color: var(--red);
    background: transparent;
    border: 1px solid currentColor;
    font-weight: 800;
}

.upload-progress-wrap {
    margin-top: 10px;
}

.upload-progress-label {
    margin-bottom: 5px;
    color: var(--muted-ink);
    font-size: 0.75rem;
    font-weight: 800;
}

.upload-progress-wrap progress {
    width: 100%;
    height: 12px;
    accent-color: var(--green);
}

input::placeholder,
textarea::placeholder {
    color: rgba(89, 79, 37, 0.62);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 95, 113, 0.22);
    outline: 3px solid rgba(37, 95, 113, 0.45);
    outline-offset: 2px;
}

.field-label-row,
.field-footer,
.action-row,
.history-item,
.history-meta,
.report-actions,
.report-topline {
    display: flex;
    align-items: center;
}

.field-label-row,
.field-footer {
    justify-content: space-between;
    gap: 12px;
}

.field-footer {
    margin-top: 7px;
    color: var(--muted-ink);
    font-size: 0.74rem;
}

.genre-group {
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(103, 75, 0, 0.25);
}

.genre-description {
    margin: 10px 0 0;
    color: var(--muted-ink);
    font-size: 0.86rem;
}

.aside-note {
    margin-top: 23px;
}

.how-note {
    margin-top: 25px;
    padding: 17px;
    background: rgba(255, 249, 207, 0.42);
    border-left: 4px solid var(--red);
    transform: rotate(-1deg);
}

.how-note p:last-child {
    margin: 0;
    color: var(--muted-ink);
    font-size: 0.9rem;
}

.check-list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.check-list li {
    position: relative;
    padding-left: 25px;
    font-weight: 700;
}

.check-list li::before {
    position: absolute;
    top: 2px;
    left: 0;
    color: var(--green);
    content: "✓";
    font-weight: 800;
}

.action-row {
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 17px;
}

.button {
    min-height: 48px;
    padding: 11px 17px;
    border: 2px solid var(--ink);
    border-radius: 2px;
    font-weight: 800;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 rgba(29, 26, 9, 0.26);
}

.button:active {
    transform: translate(0, 0);
    box-shadow: none;
}

.button:disabled {
    cursor: wait;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

.button-primary {
    color: var(--paper-light);
    background: var(--ink);
}

.button-primary:hover {
    background: #33332e;
}

.button-secondary {
    color: var(--ink);
    background: rgba(255, 243, 166, 0.45);
}

.button-quiet {
    color: var(--muted-ink);
    background: transparent;
    border-color: transparent;
}

.button-arrow {
    margin-left: 10px;
    color: var(--yellow);
    font-size: 1.25em;
}

.keyboard-hint {
    margin-left: auto;
    color: var(--muted-ink);
    font-size: 0.78rem;
}

kbd {
    display: inline-block;
    min-width: 22px;
    margin: 0 2px;
    padding: 1px 5px;
    color: var(--ink);
    background: rgba(255, 247, 197, 0.65);
    border: 1px solid rgba(65, 53, 10, 0.35);
    border-bottom-width: 2px;
    font: 500 0.72rem var(--mono);
    text-align: center;
}

.report-badge,
.history-count,
.access-chip,
.mini-score {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    color: var(--ink);
    background: var(--yellow);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.results-section {
    margin-top: 40px;
}

.results-container {
    display: grid;
    gap: 23px;
    min-width: 0;
    max-width: 100%;
}

.results-section,
#resultsDashboard,
.results-container > *,
.report-hero-copy,
.song-details > *,
.song-analysis,
.production-metric,
.section-card,
.section-header > *,
.section-content > *,
.description-card > * {
    min-width: 0;
    max-width: 100%;
}

.results-container p,
.results-container li,
.results-container h3,
.results-container h4,
.results-container h5,
.results-container strong,
.results-container small,
.results-container span,
.lyrics-display,
.lyric-line,
.section-analysis {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.report-topline {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(75, 59, 12, 0.25);
}

.report-topline p {
    margin: 0;
    color: var(--muted-ink);
    font-size: 0.82rem;
}

.loading-state,
.error-state {
    padding: 34px 16px;
    text-align: center;
}

.loading-state h3,
.error-state h3 {
    margin: 0 0 8px;
    font: 400 2rem/1 var(--display);
}

.loading-state p,
.error-state p {
    max-width: 560px;
    margin: 0 auto;
    color: var(--muted-ink);
}

.loading-mark {
    margin-bottom: 10px;
    color: var(--red);
    font-size: 2rem;
}

.error-state {
    border-left: 5px solid var(--red);
    background: rgba(186, 78, 61, 0.08);
}

.report-hero,
.song-info-section,
.billboard-context,
.overall-summary,
.overall-scores,
.section-breakdown,
.suggestions,
.export-options,
.production-section,
.combined-review,
.platform-descriptions {
    padding: clamp(16px, 3vw, 26px);
    background: rgba(255, 249, 207, 0.48);
    border: 1px solid rgba(98, 76, 11, 0.17);
}

.report-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    background: var(--ink);
    color: var(--paper-light);
}

.report-hero h3,
.song-info-section h3,
.billboard-context h3,
.overall-summary h3,
.overall-scores h3,
.section-breakdown h3,
.suggestions h3,
.export-options h3,
.production-section h3,
.combined-review h3,
.platform-descriptions h3 {
    margin: 0 0 14px;
    font: 400 clamp(1.4rem, 2.4vw, 2rem) / 1 var(--display);
}

.structure-detection-note {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-left: 4px solid var(--green);
    background: rgba(42, 99, 86, 0.08);
    color: var(--muted-ink);
    line-height: 1.55;
}

.structure-detection-note strong {
    color: var(--green);
}

.report-hero h3 {
    margin: 0;
    color: var(--yellow);
}

.production-section {
    border-top: 6px solid var(--blue);
}

.report-subheading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.measurement-chip {
    flex: 0 0 auto;
    padding: 5px 8px;
    color: var(--blue);
    border: 1px solid var(--blue);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.audio-source {
    margin: -4px 0 16px;
    color: var(--muted-ink);
    font: 500 0.8rem var(--mono);
    overflow-wrap: anywhere;
}

.production-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.production-metric {
    min-height: 116px;
    padding: 15px;
    background: rgba(37, 95, 113, 0.09);
    border-left: 4px solid var(--blue);
}

.production-metric strong,
.production-metric span,
.production-metric small {
    display: block;
}

.production-metric strong {
    font: 400 1.75rem/1 var(--display);
}

.production-metric span {
    margin-top: 7px;
    font-weight: 800;
}

.production-metric small {
    margin-top: 3px;
    color: var(--muted-ink);
    font-size: 0.68rem;
}

.arrangement-read {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 247, 188, 0.65);
}

.arrangement-read h4,
.arrangement-read p {
    margin: 0;
}

.arrangement-read p {
    margin-top: 5px;
    color: var(--muted-ink);
}

.transition-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
}

.transition-list span {
    padding: 4px 7px;
    background: rgba(248, 199, 45, 0.28);
    font-size: 0.72rem;
    font-weight: 800;
}

.combined-review {
    background: var(--ink);
    color: var(--paper-light);
    border-left: 6px solid var(--yellow);
}

.combined-review .section-kicker {
    color: var(--yellow);
}

.combined-review p {
    margin: 0;
}

.combined-review small {
    display: block;
    margin-top: 13px;
    color: #d8ce9a;
}

.description-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-top: 11px;
    padding: 14px;
    background: rgba(255, 247, 188, 0.68);
    border-left: 4px solid var(--green);
}

.description-card p {
    margin: 5px 0 0;
    color: var(--muted-ink);
    white-space: normal;
}

.description-card .button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 7px 12px;
}

.report-hero-copy {
    max-width: 620px;
}

.report-hero-copy p,
.song-description p {
    margin: 8px 0 0;
}

.score-big {
    flex: 0 0 auto;
    font: 400 clamp(3.4rem, 8vw, 6.4rem) / 0.8 var(--display);
    color: var(--yellow);
}

.song-details {
    display: grid;
    grid-template-columns: minmax(180px, 0.65fr) minmax(0, 1.2fr);
    gap: 18px;
}

.song-title-artist h4 {
    margin: 0;
    font-size: 1.4rem;
}

.artist-name {
    margin: 3px 0 0;
    color: var(--muted-ink);
}

.song-description h5 {
    margin: 0;
    color: var(--muted-ink);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.song-analysis {
    grid-column: 1 / -1;
}

.analysis-grid,
.summary-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.analysis-item,
.stat {
    padding: 12px;
    background: rgba(250, 224, 108, 0.5);
}

.analysis-item {
    font-size: 0.86rem;
}

.themes-section {
    margin-top: 15px;
}

.themes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 7px;
}

.theme-tag {
    padding: 5px 9px;
    background: rgba(37, 95, 113, 0.13);
    border: 1px solid rgba(37, 95, 113, 0.28);
    font-size: 0.78rem;
    font-weight: 700;
}

.billboard-context {
    background: rgba(255, 247, 187, 0.62);
    border-left: 5px solid var(--yellow-dark);
}

.billboard-context p {
    margin: 5px 0;
}

.top-songs {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed rgba(74, 56, 4, 0.32);
}

.top-songs h4 {
    margin: 0 0 5px;
    font-size: 0.85rem;
}

.top-songs ul {
    margin: 0;
    padding-left: 21px;
    color: var(--muted-ink);
    font-size: 0.88rem;
}

.summary-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-value,
.stat-label {
    display: block;
}

.stat-value {
    font-size: 1.12rem;
    font-weight: 800;
}

.stat-label {
    margin-top: 2px;
    color: var(--muted-ink);
    font-size: 0.72rem;
    font-weight: 700;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.score-card {
    padding: 16px;
    background: rgba(255, 248, 200, 0.65);
    border-top: 5px solid var(--blue);
}

.score-card.excellent {
    border-color: var(--green);
}

.score-card.good {
    border-color: var(--blue);
}

.score-card.average {
    border-color: var(--yellow-dark);
}

.score-card.poor {
    border-color: var(--red);
}

.score-label {
    color: var(--muted-ink);
    font-size: 0.8rem;
    font-weight: 800;
}

.score-value {
    margin: 4px 0 10px;
    font: 400 2.55rem/0.9 var(--display);
}

.score-bar {
    height: 8px;
    overflow: hidden;
    background: rgba(79, 63, 9, 0.16);
}

.score-fill {
    height: 100%;
    background: currentColor;
}

.score-card.excellent .score-fill {
    color: var(--green);
}

.score-card.good .score-fill {
    color: var(--blue);
}

.score-card.average .score-fill {
    color: var(--yellow-dark);
}

.score-card.poor .score-fill {
    color: var(--red);
}

.section-card {
    margin-top: 13px;
    padding: 17px;
    max-width: 100%;
    overflow: hidden;
    background: rgba(255, 247, 188, 0.64);
    border-left: 4px solid var(--red);
}

.section-card summary {
    display: block;
    width: 100%;
    cursor: pointer;
    list-style: none;
}

.section-card summary::-webkit-details-marker {
    display: none;
}

.section-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    width: 100%;
}

.section-header h4 {
    min-width: 0;
    max-width: 100%;
    margin: 0;
    font: 400 1.35rem/1.15 var(--display);
    overflow-wrap: anywhere;
    text-transform: capitalize;
}

.section-detection-badge {
    display: inline-block;
    max-width: 100%;
    margin-left: 8px;
    padding: 3px 6px;
    border: 1px solid var(--green);
    color: var(--green);
    font: 800 0.62rem/1 var(--sans);
    letter-spacing: 0.08em;
    overflow-wrap: anywhere;
    vertical-align: middle;
}

.section-scores {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 5px;
    width: 100%;
    min-width: 0;
}

.mini-score {
    max-width: 100%;
    min-height: 23px;
    padding: 2px 6px;
    background: rgba(37, 95, 113, 0.14);
    font-size: 0.65rem;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.mini-score.excellent {
    background: rgba(40, 103, 68, 0.17);
}

.mini-score.average {
    background: rgba(170, 120, 0, 0.16);
}

.mini-score.poor {
    background: rgba(186, 78, 61, 0.15);
}

.section-content {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(180px, 0.7fr);
    gap: 20px;
    margin-top: 16px;
    width: 100%;
    min-width: 0;
}

.lyrics-display {
    padding: 13px 15px;
    background: rgba(255, 249, 213, 0.66);
    font: 400 0.86rem/1.85 var(--mono);
    white-space: normal;
}

.lyric-line {
    min-height: 1.85em;
    white-space: normal;
}

.rhyme-highlight {
    padding: 0 2px;
    background: rgba(248, 199, 45, 0.66);
    font-weight: 500;
}

.section-analysis {
    min-width: 0;
    max-width: 100%;
    color: var(--muted-ink);
    font-size: 0.85rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.section-analysis > div + div {
    margin-top: 14px;
}

.suggestions-list {
    display: grid;
    gap: 10px;
}

.suggestion {
    margin: 0;
    padding: 12px 14px;
    background: rgba(248, 199, 45, 0.3);
    border-left: 3px solid var(--yellow-dark);
}

.export-options {
    background: var(--ink);
    color: var(--paper-light);
}

.export-options h3 {
    color: var(--yellow);
}

.report-actions {
    flex-wrap: wrap;
    gap: 10px;
}

.report-actions .button {
    border-color: var(--paper-light);
}

.report-actions .button-secondary {
    color: var(--paper-light);
    background: transparent;
}

.history-section {
    margin-top: 40px;
}

.history-count {
    background: rgba(37, 95, 113, 0.13);
    letter-spacing: 0;
}

.history-list {
    display: grid;
    gap: 10px;
}

.history-item {
    justify-content: space-between;
    gap: 16px;
    padding: 13px 0;
    border-top: 1px solid rgba(80, 62, 7, 0.2);
}

.history-meta {
    flex-wrap: wrap;
    gap: 7px 12px;
}

.history-meta strong {
    min-width: 140px;
}

.history-meta span {
    color: var(--muted-ink);
    font-size: 0.82rem;
}

.access-chip {
    min-height: 22px;
    padding: 2px 6px;
    background: rgba(40, 103, 68, 0.16);
    color: var(--green);
    font-size: 0.62rem;
}

.access-chip.paid {
    background: rgba(170, 120, 0, 0.17);
    color: var(--yellow-dark);
}

.history-open-btn {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 13px;
    color: var(--ink);
    background: transparent;
    border: 1px solid rgba(23, 23, 20, 0.55);
    font-weight: 800;
}

.history-open-btn:hover {
    background: rgba(255, 247, 188, 0.65);
}

.history-empty {
    margin: 0;
    color: var(--muted-ink);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-top: 30px;
    color: var(--muted-ink);
    font-size: 0.78rem;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px 22px;
    flex-wrap: wrap;
}

.site-footer a {
    font-weight: 800;
}

.footer-links a:first-child {
    color: var(--ink);
    text-decoration-color: var(--red);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(10, 10, 9, 0.76);
}

.paywall-modal {
    position: relative;
    width: min(500px, 100%);
    padding: clamp(24px, 5vw, 42px);
    color: var(--ink);
    background:
        repeating-linear-gradient(0deg, transparent 0 33px, rgba(154, 123, 28, 0.16) 33px 34px),
        var(--paper-light);
    box-shadow: 8px 10px 0 rgba(0, 0, 0, 0.24);
    transform: rotate(-1deg);
}

.paywall-modal h2 {
    margin: 0;
    font: 400 clamp(2rem, 5vw, 3.5rem) / 1 var(--display);
}

.modal-lede {
    margin: 14px 0 22px;
    color: var(--muted-ink);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
    font-size: 1.8rem;
}

.price-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.price-lockup strong {
    font: 400 3.4rem/0.8 var(--display);
}

.price-lockup span {
    color: var(--muted-ink);
    font-size: 0.8rem;
    font-weight: 800;
}

.modal-list {
    padding: 17px;
    background: rgba(248, 199, 45, 0.26);
}

.modal-actions {
    display: grid;
    gap: 5px;
    margin-top: 23px;
}

.button-wide {
    width: 100%;
}

.modal-status {
    min-height: 1.2em;
    margin: 12px 0 0;
    color: var(--red);
    font-size: 0.83rem;
    font-weight: 700;
}

.hidden,
[hidden] {
    display: none !important;
}

@media (max-width: 820px) {
    .board {
        padding: 20px 12px;
    }

    .notebook {
        padding: 28px 20px 24px;
        box-shadow: 0 18px 38px var(--paper-shadow), 0 0 0 7px #1e1d1a, 0 0 0 10px #37342d;
    }

    .composer-grid {
        grid-template-columns: 1fr;
    }

    .composer-aside {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .genre-group {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .aside-note,
    .how-note {
        margin-top: 0;
    }

    .score-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .production-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .splash-screen {
        padding: 0;
    }

    .splash-card {
        padding-right: 26px;
        padding-left: 26px;
    }

    .splash-logo {
        font-size: clamp(3rem, 16vw, 4.25rem);
    }

    .board {
        padding: 0;
    }

    .notebook {
        min-height: 100vh;
        padding: 24px 15px 20px;
        box-shadow: none;
    }

    .site-header {
        display: block;
        padding-bottom: 25px;
    }

    .price-note {
        display: flex;
        align-items: center;
        justify-content: space-around;
        width: 100%;
        margin-top: 25px;
        padding: 12px;
        transform: rotate(-1deg);
    }

    .price-note .tape {
        top: -8px;
        left: calc(50% - 52px);
    }

    .price-note small {
        margin-top: 0;
    }

    .metadata-grid,
    .composer-aside,
    .song-details,
    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .paper-card {
        padding: 17px 13px;
        box-shadow: 2px 4px 0 rgba(114, 78, 0, 0.1);
    }

    .field-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .action-row,
    .action-row .button {
        width: 100%;
    }

    .keyboard-hint {
        width: 100%;
        margin-left: 0;
        text-align: center;
    }

    .report-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .results-section .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .report-heading-actions {
        align-items: flex-start;
        justify-content: flex-start;
        width: 100%;
    }

    .score-big {
        align-self: flex-end;
    }

    .summary-stats,
    .score-grid,
    .production-grid {
        grid-template-columns: 1fr;
    }

    .report-subheading,
    .description-card {
        align-items: stretch;
        flex-direction: column;
    }

    .measurement-chip {
        align-self: flex-start;
    }

    .description-card .button {
        width: 100%;
    }

    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-scores {
        justify-content: flex-start;
    }

    .history-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .history-open-btn {
        width: 100%;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

@media print {
    body,
    .board,
    .notebook {
        background: white !important;
        box-shadow: none !important;
    }

    .board {
        padding: 0;
    }

    .notebook {
        width: 100%;
        padding: 0;
    }

    .site-header,
    .composer,
    .history-section,
    .site-footer,
    .export-options,
    .report-badge {
        display: none !important;
    }

    .results-section {
        display: block !important;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .report-hero,
    .paper-card,
    .report-hero-copy,
    .score-card {
        color: black !important;
        background: white !important;
        border-color: #222 !important;
        box-shadow: none !important;
    }

    .section-card,
    .section-content {
        break-inside: avoid;
    }
}