/*
 * My Pet My Song — global stylesheet.
 *
 * Placeholder styling (#4). The visual design refresh (#55) should mostly be a swap of the
 * tokens in :root below; components reference tokens, never raw values.
 *
 * Mobile-first: base rules target small screens, then min-width media queries add layout.
 * Breakpoints (custom properties can't be used inside @media, so they are fixed here):
 *   sm  36em  (576px)  — larger phones
 *   md  48em  (768px)  — tablets
 *   lg  64em  (1024px) — desktops; primary nav switches from the "Menu" disclosure to inline links
 *
 * Contents: tokens · base · layout (public) · marketing (hero, steps, samples, story, legal, contact)
 *           · nav · footer · admin layout · components
 *           (buttons, alerts, badges, forms) · Blazor framework UI · tables · customer portal · admin work queue
 */

/* ---------- Tokens ---------- */

:root {
    /* Color — all text/background pairs below meet WCAG AA (4.5:1) */
    --color-bg: #f7f7f5;
    --color-surface: #ffffff;
    --color-text: #1f2328;
    --color-text-muted: #545b63;
    --color-border: #d4d8dd;
    --color-primary: #2c5a85;
    --color-primary-hover: #21466a;
    --color-on-primary: #ffffff;
    --color-secondary-bg: #ffffff;
    --color-secondary-hover-bg: #eef2f6;
    --color-link: #2c5a85;
    --color-focus: #c2410c;
    --color-danger: #a12626;
    --color-danger-hover: #7f1d1d;
    --color-on-danger: #ffffff;

    --color-header-bg: var(--color-surface);
    --color-footer-bg: #ecedea;
    --color-lightbox-backdrop: rgb(0 0 0 / 0.8);

    --color-admin-header-bg: #23262d;
    --color-admin-header-text: #f3f4f6;
    --color-admin-accent: #f0b429;
    --color-admin-accent-text: #23262d;
    --color-admin-bg: #eef0f3;

    /* Feedback & status: background / text / border */
    --color-info-bg: #e7f0f9;
    --color-info-text: #12406b;
    --color-info-border: #a9c6e3;
    --color-success-bg: #e5f4ea;
    --color-success-text: #1b5a31;
    --color-success-border: #a7d4b5;
    --color-warning-bg: #fdf2dd;
    --color-warning-text: #6f4300;
    --color-warning-border: #ebc684;
    --color-error-bg: #fbe8e8;
    --color-error-text: #8b1d1d;
    --color-error-border: #e5aaaa;
    --color-attention-bg: #efe8f9;
    --color-attention-text: #4a2a78;
    --color-neutral-bg: #eceef0;
    --color-neutral-text: #3a424a;
    --color-muted-bg: #f1f1f1;
    --color-muted-text: #5a6067;

    /* Typography */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: var(--font-sans);
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.75rem;
    --font-size-xxl: 2.25rem;
    --line-height: 1.6;
    --line-height-tight: 1.2;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    /* Shape */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.08);
    --shadow-md: 0 4px 12px rgb(0 0 0 / 0.12);

    /* Layout */
    --container-max: 70rem;
    --container-pad: var(--space-4);
    --tap-target: 2.75rem; /* 44px minimum touch target */
    --focus-ring: 3px solid var(--color-focus);
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    line-height: var(--line-height-tight);
    margin: 0 0 var(--space-4);
}

h1 {
    font-size: var(--font-size-xl);
}

h2 {
    font-size: var(--font-size-lg);
}

p,
ul,
ol {
    margin: 0 0 var(--space-4);
}

a {
    color: var(--color-link);
    text-underline-offset: 0.15em;
}

a:hover {
    text-decoration-thickness: 2px;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

:focus-visible {
    outline: var(--focus-ring);
    outline-offset: 2px;
}

/* Programmatic focus targets (FocusOnNavigate's h1, skip-link's main) don't need a ring. */
h1:focus,
main:focus {
    outline: none;
}

@media (min-width: 48em) {
    h1 {
        font-size: var(--font-size-xxl);
    }
}

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

.nowrap {
    white-space: nowrap;
}

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

.skip-link {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 100;
    padding: var(--space-2) var(--space-4);
    background: var(--color-surface);
    color: var(--color-text);
    border: 2px solid var(--color-text);
    border-radius: var(--radius-sm);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

/* ---------- Layout (public site) ---------- */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.site-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-header {
    position: relative;
    background: var(--color-header-bg);
    border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: 4rem;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text);
    font-weight: 700;
    font-size: var(--font-size-lg);
    text-decoration: none;
    white-space: nowrap;
}

/* Logo slot placeholder: a plain circle until the real logo arrives (#55). */
.site-brand__logo {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    flex: none;
    border-radius: 50%;
    background: var(--color-primary);
}

.site-main {
    flex: 1;
    padding-block: var(--space-6);
}

.section {
    margin-top: var(--space-7);
}

.lead {
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    max-width: 40rem;
    text-wrap: pretty; /* no one-word last lines where supported */
}

.section__intro {
    color: var(--color-text-muted);
    max-width: 40rem;
}

/* ---------- Marketing: home hero, how it works, samples, our story, contact ---------- */

/* Hero: left-aligned on phones, where centred text wraps raggedly; centred, poster-style from md.
   text-wrap evens out the short lines (unsupported browsers just wrap normally). */
.hero {
    padding-block: var(--space-4) var(--space-2);
}

/* The hero artwork links to the order form (same as the Create button). */
.hero__art-link {
    display: block;
    max-width: 40rem;
    margin: 0 0 var(--space-5);
    border-radius: var(--radius-md);
}

.hero__logo {
    display: block;
    width: 100%;
    height: auto;
}

.hero__eyebrow {
    margin-bottom: var(--space-3);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-wrap: balance;
}

.hero__title {
    max-width: 22ch;
    text-wrap: balance;
}

.hero__lead {
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    max-width: 40rem;
    margin-bottom: var(--space-5);
    text-wrap: pretty;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

@media (min-width: 48em) {
    .hero {
        text-align: center;
    }

    .hero__art-link,
    .hero__title,
    .hero__lead {
        margin-inline: auto;
    }

    .hero__actions {
        justify-content: center;
    }
}

/* How it works: a numbered strip; one column on phones, four across from lg. */
.steps__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: var(--space-4);
    counter-reset: step;
}

.steps__item {
    counter-increment: step;
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.steps__item::before {
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-bottom: var(--space-3);
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-weight: 700;
}

.steps__title {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-2);
}

.steps__item p {
    margin: 0;
    color: var(--color-text-muted);
}

@media (min-width: 48em) {
    .steps__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 64em) {
    .steps__list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Samples: a sideways-scrolling strip of portrait cards (swipe on touch screens; with a mouse,
   ‹ › buttons that the script shows when the row overflows). The artwork is the play/stop button; a bar along its bottom shows progress. */
.sample-strip {
    position: relative;
}

/* position: relative so absolutely positioned children (.visually-hidden text) are clipped by the
   scroll box too; otherwise they widen the whole page on phones. */
.sample-strip__list {
    position: relative;
    list-style: none;
    margin: 0 calc(-1 * var(--space-4));
    padding: var(--space-2) var(--space-4) var(--space-3);
    display: flex;
    gap: var(--space-4);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--space-4);
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.sample-card {
    flex: 0 0 clamp(10.5rem, 44vw, 13.5rem);
    scroll-snap-align: start;
    min-width: 0;
}

.sample-card__play {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    padding: 0;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--color-neutral-bg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    cursor: pointer;
}

.sample-card--selected .sample-card__play {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

.sample-card__play:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

.sample-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sample-card__image--none {
    display: grid;
    place-items: center;
    background: var(--color-info-bg);
    color: var(--color-primary);
    font-size: var(--font-size-xxl);
}

.sample-card__play:hover .sample-card__image {
    transform: scale(1.03);
}

/* Play/pause icon in the top-right corner, kept off the artwork's middle. No badge behind it: a
   dark drop shadow keeps the white shape readable on light images. Drawn with CSS, no icon files. */
.sample-card__icon {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    width: 1.75rem;
    height: 1.75rem;
    filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.8)) drop-shadow(0 0 4px rgb(0 0 0 / 0.6));
    transition: transform 0.2s ease;
}

.sample-card__play:hover .sample-card__icon {
    transform: scale(1.15);
}

.sample-card__icon::before {
    content: "";
    position: absolute;
    left: 0.45rem;
    top: 0.2rem;
    border-style: solid;
    border-width: 0.675rem 0 0.675rem 1.05rem;
    border-color: transparent transparent transparent var(--color-on-primary);
}

.sample-card--playing .sample-card__icon::before {
    left: 0.35rem;
    top: 0.225rem;
    width: 0.4rem;
    height: 1.3rem;
    border: 0;
    background: var(--color-on-primary);
    box-shadow: 0.65rem 0 0 var(--color-on-primary);
}

.sample-card__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 0.3rem;
    background: rgb(255 255 255 / 0.5);
    opacity: 0;
}

.sample-card__progress::after {
    content: "";
    display: block;
    height: 100%;
    width: calc(var(--progress, 0) * 100%);
    background: var(--color-primary);
}

.sample-card--playing .sample-card__progress,
.sample-card__play[style*="--progress"] .sample-card__progress {
    opacity: 1;
}

.sample-card__title {
    margin: var(--space-2) 0 0;
    font-size: var(--font-size-base);
}

.sample-card__meta {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.sample-card__blurb {
    margin: var(--space-1) 0 0;
    font-size: var(--font-size-sm);
}

.sample-strip__arrow {
    position: absolute;
    top: calc(50% - 4rem);
    z-index: 1;
    display: grid;
    place-items: center;
    width: var(--tap-target);
    height: var(--tap-target);
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--font-size-xl);
    line-height: 1;
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

/* Arrows only with a mouse or trackpad; touch screens swipe. */
.sample-strip__arrow[hidden] {
    display: none;
}

@media (hover: none), (pointer: coarse) {
    .sample-strip__arrow {
        display: none;
    }
}

.sample-strip__arrow:hover {
    background: var(--color-secondary-hover-bg);
}

.sample-strip__arrow--prev {
    left: calc(-1 * var(--space-2));
}

.sample-strip__arrow--next {
    right: calc(-1 * var(--space-2));
}

.samples__cta {
    margin: var(--space-4) 0 0;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .sample-card__image,
    .sample-card__icon {
        transition: none;
    }

    .sample-card__play:hover .sample-card__image,
    .sample-card__play:hover .sample-card__icon {
        transform: none;
    }
}

/* Image lightbox: a native modal <dialog> opened with invoker commands (#100). */
.lightbox {
    max-width: min(100vw - 2 * var(--space-4), 60rem);
    max-height: calc(100dvh - 2 * var(--space-4));
    padding: 0;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.lightbox::backdrop {
    background: var(--color-lightbox-backdrop);
}

.lightbox__image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100dvh - 2 * var(--space-4));
    margin: 0 auto;
}

.lightbox__close {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    display: grid;
    place-items: center;
    width: var(--tap-target);
    height: var(--tap-target);
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--font-size-xl);
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.lightbox__close:hover {
    background: var(--color-secondary-hover-bg);
}

.samples__placeholder {
    padding: var(--space-5);
    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
}

/* Our Story: the text, then the closing call to action. */
.story__text {
    max-width: 40rem;
}

.story__signoff {
    font-style: italic;
    color: var(--color-text-muted);
}

.story__closing {
    margin-top: var(--space-5);
    padding: var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.story__tagline {
    font-family: var(--font-heading);
    font-size: var(--font-size-lg);
    font-weight: 700;
    line-height: var(--line-height-tight);
}

/* Legal pages (#52): /privacy, /terms, /refunds, /accessibility. A readable column of text. */
.legal {
    max-width: 44rem;
}

.legal__updated {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.legal h2 {
    margin-top: var(--space-6);
}

.legal li + li {
    margin-top: var(--space-2);
}

/* Contact page: details and form side by side from md. */
.contact {
    display: grid;
    gap: var(--space-6);
}

.contact-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--space-2) var(--space-4);
    margin: 0;
}

.contact-list dt {
    font-weight: 600;
}

.contact-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.contact__form {
    max-width: 36rem;
}

/* Honeypot: off-screen rather than display:none, which some bots detect. */
.contact__hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (min-width: 48em) {
    .contact {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    }

    .contact__intro {
        grid-column: 1 / -1;
    }
}

/* ---------- Primary nav ---------- */

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

.site-nav__link {
    display: flex;
    align-items: center;
    min-height: var(--tap-target);
    padding-inline: var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-weight: 500;
    text-decoration: none;
}

.site-nav__link:hover {
    background: var(--color-secondary-hover-bg);
}

.site-nav__link[aria-current="page"],
.site-nav__link.active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.3em;
}

/* Sign out is a form POST; its button looks like the other nav links. */
.site-nav__form {
    margin: 0;
}

.site-nav__link--button {
    width: 100%;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 500;
    text-align: start;
    cursor: pointer;
}

.site-nav__link--cta {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.site-nav__link--cta:hover {
    background: var(--color-primary-hover);
}

/* Mobile: a native <details> disclosure — works with no JS / no interactivity. */
.site-nav__toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--tap-target);
    padding-inline: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
}

.site-nav__toggle::-webkit-details-marker {
    display: none;
}

/* Three-line "hamburger", drawn with borders. */
.site-nav__toggle-icon {
    width: 1.125rem;
    height: 0.75rem;
    border-block: 2px solid currentColor;
    position: relative;
}

.site-nav__toggle-icon::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 50%;
    border-top: 2px solid currentColor;
    transform: translateY(-50%);
}

.site-nav__mobile[open] .site-nav__toggle {
    background: var(--color-secondary-hover-bg);
}

/* Open menu drops down full-width under the header (the header is the positioned ancestor). */
.site-nav__list--stacked {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    display: grid;
    gap: var(--space-1);
    padding: var(--space-2) var(--container-pad) var(--space-4);
    background: var(--color-header-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.site-nav__list--inline {
    display: none;
}

@media (min-width: 64em) {
    .site-nav__mobile {
        display: none;
    }

    .site-nav__list--inline {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        gap: var(--space-1);
    }
}

/* ---------- Footer ---------- */

.site-footer {
    background: var(--color-footer-bg);
    border-top: 1px solid var(--color-border);
    padding-block: var(--space-6);
    font-size: var(--font-size-sm);
}

.site-footer__inner {
    display: grid;
    gap: var(--space-4);
}

.site-footer__brand {
    font-weight: 700;
    margin-bottom: var(--space-1);
}

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

.site-footer__details a {
    display: inline-block;
    padding-block: var(--space-1);
    overflow-wrap: anywhere;
}

.site-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
}

.site-footer__links a {
    display: inline-block;
    padding-block: var(--space-2);
}

.site-footer__copy {
    color: var(--color-text-muted);
    margin: 0;
}

@media (min-width: 48em) {
    .site-footer__inner {
        grid-template-columns: 1fr auto;
        align-items: start;
    }

    .site-footer__copy {
        grid-column: 1 / -1;
    }
}

/* ---------- Admin layout ---------- */

.admin-shell {
    min-height: 100vh;
    background: var(--color-admin-bg);
}

.admin-header {
    background: var(--color-admin-header-bg);
    color: var(--color-admin-header-text);
}

.admin-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) var(--container-pad);
}

.admin-header a {
    color: var(--color-admin-header-text);
}

.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
}

.admin-brand a {
    text-decoration: none;
}

.admin-brand a:hover {
    text-decoration: underline;
}

.admin-header .admin-brand__label {
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--color-admin-accent);
    color: var(--color-admin-accent-text);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-header__exit {
    font-size: var(--font-size-sm);
}

.admin-nav {
    overflow-x: auto;
    padding-inline: var(--container-pad);
}

.admin-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: var(--space-1);
}

.admin-nav__link {
    display: flex;
    align-items: center;
    min-height: var(--tap-target);
    padding-inline: var(--space-3);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    text-decoration: none;
}

.admin-nav__link[aria-current="page"],
.admin-nav__link.active {
    border-bottom-color: var(--color-admin-accent);
}

.admin-header :focus-visible {
    outline-color: var(--color-admin-accent);
}

.admin-main {
    max-width: var(--container-max);
    padding: var(--space-6) var(--container-pad);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--tap-target);
    padding: var(--space-2) var(--space-5);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

.btn-secondary {
    background: var(--color-secondary-bg);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-secondary:hover {
    background: var(--color-secondary-hover-bg);
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-lg);
}

.btn-danger {
    background: var(--color-danger);
    color: var(--color-on-danger);
}

.btn-danger:hover {
    background: var(--color-danger-hover);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn__spinner {
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.75s linear infinite;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Alerts ---------- */

.alert {
    margin: 0 0 var(--space-4);
    padding: var(--space-3) var(--space-4);
    border: 1px solid;
    border-left-width: 4px;
    border-radius: var(--radius-sm);
}

.alert__title {
    font-weight: 700;
    margin-bottom: var(--space-1);
}

.alert__body > :last-child {
    margin-bottom: 0;
}

.alert--info {
    background: var(--color-info-bg);
    color: var(--color-info-text);
    border-color: var(--color-info-border);
}

.alert--success {
    background: var(--color-success-bg);
    color: var(--color-success-text);
    border-color: var(--color-success-border);
}

.alert--warning {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    border-color: var(--color-warning-border);
}

.alert--error {
    background: var(--color-error-bg);
    color: var(--color-error-text);
    border-color: var(--color-error-border);
}

/* ---------- Status badges ---------- */

.badge {
    display: inline-block;
    padding: 0.125rem var(--space-3);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.badge--neutral {
    background: var(--color-neutral-bg);
    color: var(--color-neutral-text);
}

.badge--info {
    background: var(--color-info-bg);
    color: var(--color-info-text);
}

.badge--attention {
    background: var(--color-attention-bg);
    color: var(--color-attention-text);
}

.badge--warning {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.badge--success {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.badge--muted {
    background: var(--color-muted-bg);
    color: var(--color-muted-text);
}

.badge-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* ---------- Forms ---------- */

.form-field {
    display: grid;
    gap: var(--space-1);
    margin-bottom: var(--space-5);
}

.form-field__label {
    font-weight: 600;
}

.form-field__help {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    min-height: var(--tap-target);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-text-muted);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
}

textarea {
    min-height: 6rem;
}

/* Sign-in pages (#16): one narrow card. */
.auth-card {
    max-width: 30rem;
    margin-inline: auto;
}

.auth-form {
    margin-block: var(--space-5);
}

/* Blazor's input validation classes */
.invalid {
    border-color: var(--color-error-text);
    outline: 1px solid var(--color-error-text);
}

.validation-message,
.validation-errors,
.form-field__error {
    color: var(--color-error-text);
    font-size: var(--font-size-sm);
    margin: 0;
}

/* Photo upload (#23, Features/Orders/PhotoUploader.razor) */
.photo-uploader__limits {
    color: var(--color-text-muted);
}

.photo-uploader__picker {
    display: grid;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
}

.upload-list {
    display: grid;
    gap: var(--space-2);
    margin: 0 0 var(--space-4);
    padding: 0;
    list-style: none;
}

.upload-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
}

.upload-item__name {
    overflow-wrap: anywhere;
}

.upload-item--error .upload-item__status {
    color: var(--color-error-text);
}

.photo-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

.photo-card {
    display: grid;
    gap: var(--space-2);
    align-content: start;
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

/* The original scaled by CSS until #23's server-side thumbnails exist. */
.photo-card__image,
.photo-card__placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--color-muted-bg);
}

.photo-card__placeholder {
    display: grid;
    place-items: center;
    color: var(--color-muted-text);
    font-weight: 600;
}

.photo-card__name {
    margin: 0;
    font-size: var(--font-size-sm);
    overflow-wrap: anywhere;
}

.photo-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* ---------- Order flow (#20–#26) ---------- */

.order-note {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin-top: var(--space-5);
    text-wrap: pretty;
}

/* Product selection: one column on phones, side by side from md. */
.product-grid {
    display: grid;
    gap: var(--space-5);
    margin-block: var(--space-5);
}

.product-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.product-card__name {
    margin: 0;
}

.product-card__price {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-primary);
}

.product-card__features {
    padding-left: var(--space-5);
    flex: 1;
}

.product-card__choose {
    align-self: stretch;
}

@media (min-width: 48em) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* Honeypot: off-screen for people, still in the DOM for bots. */
.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Step indicator: wraps on phones, never scrolls sideways. */
.order-progress {
    margin-bottom: var(--space-5);
}

.order-progress__summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.order-progress__product {
    font-weight: 600;
    color: var(--color-text);
}

.order-progress__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.order-progress__item a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--tap-target);
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    text-decoration: none;
}

.order-progress__number {
    display: inline-grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--color-neutral-bg);
    font-weight: 700;
}

.order-progress__item--done .order-progress__number {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.order-progress__item--current a {
    border-color: var(--color-primary);
    font-weight: 600;
}

.order-progress__item--current .order-progress__number {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

/* Below sm only the current step keeps its label, so all steps fit on one or two lines. */
@media (max-width: 35.99em) {
    .order-progress__item:not(.order-progress__item--current) .order-progress__label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

.order-form {
    max-width: 44rem;
}

.form-section {
    border: 0;
    margin: 0 0 var(--space-6);
    padding: 0;
    min-width: 0;
}

.form-section__title {
    padding: 0;
    margin-bottom: var(--space-4);
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.choice-group,
.repeat-group {
    border: 0;
    margin: 0 0 var(--space-5);
    padding: 0;
    min-width: 0;
}

.choice-group > legend,
.repeat-group > legend {
    padding: 0;
    margin-bottom: var(--space-2);
}

.choice-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* A labelled block of choices inside a choice group (music style: English / Spanish). */
.choice-subgroup + .choice-subgroup {
    margin-top: var(--space-3);
}

.choice-subgroup__title {
    margin: 0 0 var(--space-1);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.choice-group > .form-field__help {
    margin-top: var(--space-2);
}

.choice-list--stacked {
    flex-direction: column;
}

.choice {
    display: inline-flex;
    align-items: flex-start;
    gap: var(--space-2);
    min-height: var(--tap-target);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    cursor: pointer;
}

.choice input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0.125rem 0 0;
    flex: none;
    accent-color: var(--color-primary);
}

.choice:has(input:checked) {
    border-color: var(--color-primary);
    background: var(--color-info-bg);
}

.choice__label {
    display: block;
    font-weight: 600;
}

.choice__help {
    display: block;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* Primary action first in the markup (Enter submits it); shown on the right. */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.form-actions--start {
    flex-direction: row;
    justify-content: flex-start;
}

.btn-small {
    min-height: var(--tap-target);
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-sm);
}

.repeat-row {
    margin-bottom: var(--space-3);
}

.repeat-row--inline {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.repeat-row--inline .input {
    flex: 1;
    min-width: 0;
}

.repeat-row:not(.repeat-row--inline) {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.repeat-row__title {
    margin-bottom: var(--space-2);
    font-weight: 600;
}

.repeat-row__fields .form-field {
    margin-bottom: var(--space-3);
}

@media (min-width: 48em) {
    .repeat-row__fields {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 var(--space-3);
    }

    .repeat-row__fields .form-field:nth-child(3) {
        grid-column: 1 / -1;
    }
}

/* Consent step */
.consent-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-3);
}

.consent-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.consent-item--missing {
    border-color: var(--color-error-border);
    background: var(--color-error-bg);
}

.consent-item input[type="checkbox"] {
    width: 1.5rem;
    height: 1.5rem;
    margin: 0.125rem 0 0;
    flex: none;
    accent-color: var(--color-primary);
}

.consent-item__content {
    min-width: 0;
}

.consent-item__title {
    display: block;
    font-weight: 700;
    cursor: pointer;
}

.consent-item__text {
    margin: var(--space-1) 0 0;
    color: var(--color-text-muted);
}

.consent-item__points {
    padding-left: var(--space-4);
}

.consent-item__points li + li {
    margin-top: var(--space-1);
}

.consent-item__note {
    margin: var(--space-2) 0 0;
    color: var(--color-warning-text);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

/* Photos step */
.photo-step__status {
    margin-top: var(--space-4);
}

/* Order summary sections ("One more thing", Photos) */
.review-section {
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.review-section__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-3);
}

.review-section__header h2 {
    margin-bottom: var(--space-3);
}

.summary-list {
    display: grid;
    gap: var(--space-1) var(--space-4);
    margin: 0;
}

.summary-list dt {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.summary-list dd {
    margin: 0 0 var(--space-2);
    overflow-wrap: anywhere;
}

.summary-list__long {
    white-space: pre-line;
}

@media (min-width: 36em) {
    .summary-list {
        grid-template-columns: minmax(8rem, max-content) 1fr;
    }

    .summary-list dd {
        margin-bottom: 0;
    }
}

/* Coupon code box on "One more thing" (#116, #187) and the pay page */
.coupon-box {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.coupon-form__row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.coupon-form__row .input {
    flex: 1 1 12rem;
    max-width: 20rem;
    text-transform: uppercase;
}

.coupon-form__applied {
    margin: 0 0 var(--space-2);
}

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

.check-list li {
    padding-left: var(--space-5);
    position: relative;
}

.check-list li::before {
    position: absolute;
    left: 0;
    font-weight: 700;
}

.check-list__done::before {
    content: "✓";
    color: var(--color-success-text);
}

.check-list__todo::before {
    content: "○";
    color: var(--color-warning-text);
}

.confirmation .next-steps li {
    margin-bottom: var(--space-2);
}

/* ---------- Blazor framework UI ---------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    padding: var(--space-3) var(--space-6) var(--space-3) var(--space-4);
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    box-shadow: var(--shadow-md);
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 50%;
    right: var(--space-3);
    transform: translateY(-50%);
    border: 0;
    background: none;
    color: inherit;
    font-size: var(--font-size-lg);
    cursor: pointer;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ── Tables and definition lists (admin and portal) ─────────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table th,
.table td {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.table thead th {
    font-weight: 600;
    color: var(--color-text-muted);
}

/* Narrow screens: let wide tables scroll inside their own box, never the page. */
.table-wrap {
    overflow-x: auto;
}

.settings-list {
    display: grid;
    grid-template-columns: minmax(8rem, max-content) 1fr;
    gap: var(--space-2) var(--space-4);
    margin: 0;
}

.settings-list dt {
    font-weight: 600;
}

.settings-list dd {
    margin: 0;
}

/* ---------- Customer portal (#36–#39): my songs, order detail, preview, request changes ---------- */

.section--tight {
    margin-top: var(--space-6);
}

.prewrap {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.portal-back {
    margin-bottom: var(--space-3);
    font-size: var(--font-size-sm);
}

.portal-header {
    margin-bottom: var(--space-5);
}

.portal-header h1 {
    margin-bottom: var(--space-2);
    overflow-wrap: anywhere;
}

.portal-header__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.portal-subheading {
    margin-top: var(--space-5);
    font-size: var(--font-size-base);
}

.portal-empty,
.portal-next,
.portal-help,
.decision-card,
.feedback-card,
.order-card {
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.portal-empty > :last-child,
.portal-next > :last-child,
.portal-help > :last-child,
.decision-card > :last-child,
.feedback-card > :last-child {
    margin-bottom: 0;
}

.portal-next {
    border-left: 4px solid var(--color-primary);
}

.portal-next h2 {
    margin-bottom: var(--space-2);
}

.portal-next__more {
    margin-top: var(--space-3);
}

.portal-help {
    margin-top: var(--space-7);
    background: var(--color-bg);
}

.portal-help__title {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-2);
}

/* Order list: stacked cards on every width (a customer has few orders). */
.order-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-3);
}

.order-card--draft {
    border-style: dashed;
}

.order-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.order-card__title {
    margin: 0;
    font-size: var(--font-size-lg);
    overflow-wrap: anywhere;
}

.order-card__title a {
    color: inherit;
}

.order-card__status {
    margin-bottom: var(--space-1);
}

.order-card__meta {
    margin-bottom: var(--space-3);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.order-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-4);
}

/* Timeline: a vertical rule with a dot per entry. */
.timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 var(--space-5);
    border-left: 2px solid var(--color-border);
}

.timeline__item {
    position: relative;
    display: grid;
    gap: var(--space-1);
    padding-bottom: var(--space-4);
}

.timeline__item::before {
    content: "";
    position: absolute;
    left: calc(-1 * var(--space-5) - 0.45rem);
    top: 0.35rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: var(--color-primary);
}

.timeline__date {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.feedback-card + .feedback-card {
    margin-top: var(--space-3);
}

.feedback-card__title {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-2);
}

.feedback-card__date {
    margin-left: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: 400;
}

/* "What you told us": label above value on phones, side by side from sm. */
.brief-list {
    display: grid;
    gap: var(--space-1) var(--space-4);
    margin: 0;
}

.brief-list dt {
    font-weight: 600;
}

.brief-list dd {
    margin: 0 0 var(--space-3);
    overflow-wrap: anywhere;
}

@media (min-width: 36em) {
    .brief-list {
        grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr);
    }

    .brief-list dd {
        margin-bottom: var(--space-2);
    }
}

.photo-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr));
    gap: var(--space-2);
}

.photo-grid__item img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--color-neutral-bg);
}

/* Preview page (also the finished-song player on the order and downloads pages) */
.portal-next__player {
    margin: var(--space-3) 0;
}

.preview__audio {
    display: block;
    width: 100%;
    margin-bottom: var(--space-2);
}

.preview__note {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.preview__figure {
    margin: 0;
}

/* The watermarked page is shown at a modest size (#38: reduced resolution before payment). */
.preview__image {
    display: block;
    width: 100%;
    max-width: 36rem;
    margin-bottom: var(--space-2);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.round-info {
    color: var(--color-text-muted);
    font-weight: 600;
}

.preview-actions__grid {
    display: grid;
    gap: var(--space-4);
}

.decision-card--approve {
    border: 2px solid var(--color-primary);
}

.decision-card__title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2);
}

.decision-card .btn {
    width: 100%;
}

@media (min-width: 48em) {
    .preview-actions__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .decision-card .btn {
        width: auto;
    }
}

/* Request changes form: checkbox and radio "chips" with full-size tap targets. */
.revision-form {
    max-width: 40rem;
    margin-top: var(--space-5);
}

.chip-group,
.rating-group {
    min-width: 0;
    margin: 0 0 var(--space-5);
    padding: 0;
    border: 0;
}

.chip-group legend,
.rating-group legend {
    display: grid;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
    padding: 0;
}

.chip-group legend .form-field__help,
.rating-group legend .form-field__help {
    font-weight: 400;
}

.chip-group__options,
.rating-group__options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--tap-target);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    cursor: pointer;
}

.chip:hover {
    background: var(--color-secondary-hover-bg);
}

.chip:has(input:checked) {
    border-color: var(--color-primary);
    background: var(--color-info-bg);
    color: var(--color-info-text);
    font-weight: 600;
}

.chip:has(input:focus-visible) {
    outline: var(--focus-ring);
    outline-offset: 2px;
}

.chip input {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    accent-color: var(--color-primary);
}

.chip--rating {
    min-width: var(--tap-target);
    justify-content: center;
}

/* ── Admin work queue (#28–#34) ─────────────────────────────────────────────────────────── */

.admin-section {
    margin-block: var(--space-6);
}

.admin-hint {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.breadcrumb {
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
}

/* Status counts: two per row on phones, a single row on desktops. */
.stat-grid {
    list-style: none;
    margin: 0 0 var(--space-3);
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

@media (min-width: 48em) {
    .stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 64em) {
    .stat-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    height: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    border-color: var(--color-primary);
}

.stat-card[aria-current="true"] {
    border-color: var(--color-primary);
    outline: 2px solid var(--color-primary);
}

.stat-card__count {
    font-size: var(--font-size-xl);
    font-weight: 700;
    line-height: var(--line-height-tight);
}

.stat-card__label {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* Queue tabs (#147): Working / Finished, each with its count. */
.view-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.view-tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    color: var(--color-text-muted);
    font-weight: 600;
    text-decoration: none;
}

.view-tabs__tab:hover {
    color: var(--color-text);
}

.view-tabs__tab[aria-current="page"] {
    border-bottom-color: var(--color-primary);
    color: var(--color-text);
}

.view-tabs__count {
    padding: 0 var(--space-2);
    border-radius: var(--radius-pill);
    background: var(--color-secondary-hover-bg);
    font-size: var(--font-size-sm);
    font-weight: 400;
}

/* Filter / search forms above admin lists. */
.filter-bar {
    display: grid;
    gap: var(--space-3);
    margin-block: var(--space-4);
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.filter-bar__statuses {
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
}

.filter-bar__statuses legend {
    width: 100%;
    margin-bottom: var(--space-1);
}

.filter-bar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: var(--space-2);
}

@media (min-width: 48em) {
    .filter-bar {
        grid-template-columns: 2fr 1fr 1fr;
        align-items: end;
    }

    .filter-bar__statuses,
    .filter-bar__actions {
        grid-column: 1 / -1;
    }
}

.check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--tap-target);
}

.check input {
    width: 1.125rem;
    height: 1.125rem;
}

.table__sub {
    display: block;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* Queue (#190): an open order with nothing to pay, next to its status badge. */
.queue-free-tag {
    margin-inline-start: var(--space-1);
    padding-inline: var(--space-2);
}

.table__row--muted {
    color: var(--color-text-muted);
}

.table tbody th {
    font-weight: 600;
}

/* Phones: each row of a .table--cards becomes a labelled card instead of a sideways scroll. */
@media (max-width: 47.99em) {
    .table--cards thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .table--cards,
    .table--cards tbody,
    .table--cards tr,
    .table--cards th,
    .table--cards td {
        display: block;
    }

    .table--cards tr {
        margin-bottom: var(--space-3);
        padding: var(--space-2) var(--space-3);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        background: var(--color-surface);
    }

    .table--cards th,
    .table--cards td {
        display: grid;
        grid-template-columns: 7.5rem 1fr;
        gap: var(--space-2);
        padding: var(--space-1) 0;
        border: 0;
    }

    .table--cards [data-label]::before {
        content: attr(data-label);
        color: var(--color-text-muted);
        font-size: var(--font-size-sm);
        font-weight: 600;
    }
}

@media (min-width: 48em) {
    .table--cards {
        background: var(--color-surface);
    }

    .table--cards tbody th,
    .table--cards time {
        white-space: nowrap;
    }
}

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-block: var(--space-4);
}

.pager__status {
    color: var(--color-text-muted);
}

/* Order detail */
.order-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-4);
    margin-bottom: var(--space-4);
}

.order-header h1 {
    margin: 0;
}

.order-header__pet {
    color: var(--color-text-muted);
    font-weight: 400;
}

/* Label/value pairs: stacked on phones, two columns from tablets up. */
.detail-list {
    display: grid;
    gap: var(--space-1) var(--space-4);
    margin: 0 0 var(--space-4);
}

.detail-list dt {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.detail-list dd {
    margin: 0 0 var(--space-2);
    overflow-wrap: anywhere;
}

/* Customer-typed text keeps its line breaks. */
.detail-list__value {
    white-space: pre-line;
}

@media (min-width: 48em) {
    .detail-list {
        grid-template-columns: minmax(8rem, max-content) 1fr;
    }

    .detail-list dd {
        margin-bottom: 0;
    }
}

.detail-list--summary {
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.detail-columns {
    display: grid;
    gap: var(--space-4);
}

@media (min-width: 64em) {
    .detail-columns {
        grid-template-columns: 1fr 1fr;
    }
}

.plain-list {
    margin: 0;
    padding-left: var(--space-5);
    white-space: normal;
}

.copy-brief summary {
    cursor: pointer;
    min-height: var(--tap-target);
    display: flex;
    align-items: center;
    color: var(--color-link);
}

.copy-brief textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--font-size-sm);
}

/* Action bar: buttons in a row; a <details> second step for cancel / mark paid. */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.action-bar__item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    max-width: 100%;
}

.confirm > summary {
    list-style: none;
}

.confirm > summary::-webkit-details-marker {
    display: none;
}

.confirm__body {
    display: grid;
    gap: var(--space-2);
    width: min(28rem, 100%);
    margin-top: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
}

.confirm--danger > summary {
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.confirm--danger .confirm__body {
    border-color: var(--color-error-border);
    background: var(--color-error-bg);
}

/* Admin photos are bigger than the portal's (shared .photo-grid above). */
.photo-grid--large {
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: var(--space-4);
}

.photo-grid__caption {
    margin: var(--space-2) 0 var(--space-1);
    font-size: var(--font-size-sm);
}

.photo-grid__download {
    font-size: var(--font-size-sm);
}

.feedback-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-3);
}

.feedback-list__item {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-warning-border);
    border-radius: var(--radius-md);
    background: var(--color-warning-bg);
}

.feedback-list__meta {
    margin-bottom: var(--space-2);
}

.feedback-list__comments {
    margin: 0;
    white-space: pre-line;
}

.timeline__what {
    margin: 0;
    font-weight: 600;
}

.timeline__actor {
    color: var(--color-text-muted);
    font-weight: 400;
}

.timeline__note {
    margin: var(--space-1) 0 0;
    white-space: pre-line;
}

/* ── Payments: pay page, downloads, admin payment summary (#40, #44, #46) ──────────────────── */
.pay-summary {
    margin-block: var(--space-5);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.pay-summary__total {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.pay-summary__form {
    margin-top: var(--space-5);
}

.pay-summary__button {
    width: 100%;
}

.pay-summary__note {
    margin: var(--space-3) 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.download-list {
    display: grid;
    gap: var(--space-3);
    margin: var(--space-5) 0;
    padding: 0;
    list-style: none;
}

.download-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.download-item__title {
    margin: 0;
    font-weight: 600;
}

.download-item__text {
    flex: 1;
    min-width: 0;
}

.download-item__player {
    margin-top: var(--space-3);
}

.order-card__player {
    margin-top: var(--space-3);
}

.download-item__meta {
    margin: var(--space-1) 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}

.payment-summary__title {
    font-size: var(--font-size-lg);
}

.payment-summary__empty,
.payment-summary__meta {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.payment-summary__ref {
    overflow-wrap: anywhere;
}

@media (min-width: 36em) {
    .pay-summary__button {
        width: auto;
    }

    .download-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* Song generation (#57): the latest run as a card, its takes, lyrics and the manual controls. */
.generation {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.generation > * {
    margin: 0;
}

.generation__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.generation__header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
}

.generation__meta {
    font-size: var(--font-size-sm);
}

.generation__notes {
    margin: 0;
    white-space: pre-line;
}

.take-list {
    display: grid;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.take-list__item {
    display: grid;
    gap: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
}

.take-list__item > * {
    margin: 0;
}

.take-list__item .btn {
    justify-self: start;
}

.take-list__item audio {
    display: block;
    width: 100%;
}

.lyrics {
    margin: var(--space-2) 0 0;
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    font-family: inherit;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.lyrics-input {
    font-family: inherit;
}

.generation-history,
.generation-start,
.generation-cut {
    margin-top: var(--space-4);
}

.generation-start h3 {
    font-size: var(--font-size-lg);
}

.generation-cut {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.btn-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-link);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

/* Deliverable slots (#31): one card per slot, two columns from tablets up. */
.deliverable-grid {
    display: grid;
    gap: var(--space-4);
}

.deliverable-slot {
    display: grid;
    gap: var(--space-3);
    align-content: start;
    min-width: 0;
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.deliverable-slot > * {
    margin: 0;
}

.deliverable-slot__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.deliverable-slot__header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
}

.deliverable-slot__note {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-info-border);
    border-radius: var(--radius-sm);
    background: var(--color-info-bg);
    color: var(--color-info-text);
    font-size: var(--font-size-sm);
}

.deliverable-slot__media audio {
    display: block;
    width: 100%;
}

.deliverable-slot__image {
    display: block;
    max-width: 100%;
    max-height: 20rem;
    height: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.deliverable-slot__meta {
    font-size: var(--font-size-sm);
}

.deliverable-slot__empty {
    color: var(--color-text-muted);
    font-style: italic;
}

.deliverable-upload {
    display: grid;
    gap: var(--space-1);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
}

.deliverable-upload .input {
    max-width: 100%;
}

.deliverable-upload .form-field__help,
.deliverable-upload .upload-item {
    margin: 0;
}

.deliverable-slot__history summary {
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.deliverable-history {
    display: grid;
    gap: var(--space-2);
    margin: var(--space-2) 0 0;
    padding-left: var(--space-5);
    font-size: var(--font-size-sm);
    overflow-wrap: anywhere;
}

.deliverable-history .admin-hint {
    display: block;
}

@media (min-width: 48em) {
    .deliverable-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ── Event page (#110) ───────────────────────────────────────────────────────────────────── */
.event-page {
    max-width: 44rem;
}

.event-sponsor {
    margin-bottom: var(--space-5);
    text-align: center;
}

.event-sponsor__logo {
    display: block;
    max-width: min(100%, 20rem);
    max-height: 10rem;
    width: auto;
    height: auto;
    margin: 0 auto var(--space-3);
}

.event-sponsor__name {
    margin: 0 0 var(--space-3);
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.event-sponsor__message {
    margin: 0;
    white-space: pre-line;
}

.event-page__meta {
    margin-top: calc(-1 * var(--space-2));
    color: var(--color-text-muted);
}

/* The consent statements before an event order: a native modal <dialog> (invoker commands). */
.consent-dialog {
    width: min(100vw - 2 * var(--space-4), 40rem);
    max-height: calc(100dvh - 2 * var(--space-4));
    padding: var(--space-5);
    border: 0;
    border-radius: var(--radius-md);
    background: var(--color-bg);
    color: var(--color-text);
    box-shadow: var(--shadow-md);
    overflow-y: auto;
}

.consent-dialog::backdrop {
    background: var(--color-lightbox-backdrop);
}

.consent-dialog h2 {
    margin-top: 0;
}

.consent-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

/* Admin page heading with an action button beside it (events list, #110). */
.admin-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

/* Coupon edit form (#117) */
.coupon-edit__number {
    max-width: 10rem;
}

.admin-qr {
    display: block;
    width: 10rem;
    height: 10rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.admin-logo-preview {
    display: block;
    max-width: 12rem;
    max-height: 6rem;
    margin-bottom: var(--space-2);
}

/* Home page samples (#148): row buttons on the list, and the preview on the edit page, which reuses
   the home page's .sample-strip / .sample-card styles on the page background. */
.sample-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.sample-preview {
    padding: var(--space-4);
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
}

.sample-preview__visibility {
    margin-top: var(--space-4);
}

/* Hero images (#194): a file input styled as a drop zone (browsers take a dropped file on it, no script)
   and a grid of cards. Thumbnails sit on a checkerboard so transparency shows. */
.dropzone {
    display: block;
    width: 100%;
    min-height: 7rem;
    padding: var(--space-5);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    color: var(--color-text-muted);
    cursor: pointer;
}

.dropzone:hover,
.dropzone:focus-visible {
    border-color: var(--color-primary);
}

.dropzone::file-selector-button {
    margin-right: var(--space-3);
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
    gap: var(--space-4);
    padding: 0;
    list-style: none;
}

.hero-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    overflow: hidden;
}

.hero-card--current {
    border-color: var(--color-success-border);
    box-shadow: 0 0 0 2px var(--color-success-border);
}

.hero-card__art {
    display: grid;
    place-items: center;
    aspect-ratio: 5 / 2;
    padding: var(--space-3);
    background: repeating-conic-gradient(var(--color-bg) 0 25%, var(--color-surface) 0 50%) 0 0 / 1rem 1rem;
}

.hero-card__art img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.hero-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-4);
}

.hero-card__name {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.hero-card__meta {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.hero-card__warning {
    margin: 0;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-warning-border);
    border-radius: var(--radius-md);
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    font-size: var(--font-size-sm);
}

.hero-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* Shown above the hero only to an admin previewing an image (/?hero=…). */
.hero__preview-note {
    margin-bottom: var(--space-4);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-warning-border);
    border-radius: var(--radius-md);
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    font-size: var(--font-size-sm);
}

/* Admin tasks list: keep the line breaks the description was typed with. */
.admin-task__text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Category chips under the task status tabs. */
.chip-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-block: var(--space-3);
}

.chip-filter__label {
    margin-right: var(--space-1);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.chip-filter__chip {
    padding: 0.125rem var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    text-decoration: none;
}

.chip-filter__chip:hover {
    background: var(--color-secondary-hover-bg);
}

.chip-filter__chip[aria-current="page"] {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.admin-task-form {
    max-width: 40rem;
}

/* Tasks linked to an order, on its admin page. */
.order-tasks {
    display: grid;
    gap: var(--space-3);
    margin: 0 0 var(--space-3);
    padding: 0;
    list-style: none;
}

.order-tasks__item {
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.order-tasks__item p {
    margin: var(--space-2) 0 0;
}

/* Song playground (#166): a compact player in the list and on the song page; the give form (#168). */
.playground-player {
    display: block;
    width: 16rem;
    max-width: 100%;
}

.give-form {
    max-width: 32rem;
    margin-bottom: var(--space-5);
}

/* A gifted song on My Songs (#168). */
.order-card__gift {
    margin-bottom: var(--space-1);
    color: var(--color-success-text);
    font-weight: 600;
}

.add-customer {
    margin-bottom: var(--space-4);
}

/* Share links on My Songs: the address, Copy (shown by song-share.js) and Open. */
.share-link {
    display: grid;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.share-link__label {
    font-weight: 600;
}

.share-link__row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* The address gets its own row on phones, with Copy and Open side by side below it. */
.share-link__url {
    flex: 1 1 100%;
    min-width: 0;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
    font-size: var(--font-size-sm);
}

.share-link__button {
    flex: 1 1 0;
}

.share-link__button[hidden] {
    display: none;
}

@media (min-width: 48em) {
    .share-link__url {
        flex-basis: 14rem;
    }

    .share-link__button {
        flex: 0 0 auto;
    }
}

.share-link__help {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* The public song page (/songs/…): a big Play button first, then the "make yours" art. */
.shared-song {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    max-width: 30rem;
    margin: 0 auto;
    padding-block: var(--space-5);
    text-align: center;
}

.shared-song__eyebrow {
    margin: 0;
    color: var(--color-text-muted);
    font-weight: 600;
}

.shared-song__title {
    margin: 0;
}

.shared-song__play {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 10rem;
    height: 10rem;
    border: 0;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-on-primary);
    box-shadow: var(--shadow-md);
    font: inherit;
    font-size: var(--font-size-lg);
    font-weight: 700;
    cursor: pointer;
}

.shared-song__play[hidden] {
    display: none;
}

.shared-song__play:hover {
    background: var(--color-primary-hover);
}

.shared-song__play:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 4px;
}

/* A triangle, or two bars while playing. */
.shared-song__play-icon {
    width: 0;
    height: 0;
    margin-left: 0.5rem;
    border-style: solid;
    border-width: 1.5rem 0 1.5rem 2.5rem;
    border-color: transparent transparent transparent currentColor;
}

.shared-song--playing .shared-song__play-icon {
    width: 2.25rem;
    height: 3rem;
    margin-left: 0;
    border: 0;
    background: linear-gradient(to right, currentColor 0 35%, transparent 35% 65%, currentColor 65% 100%);
}

.shared-song__audio {
    width: 100%;
}

/* The event's or coupon batch's sponsor (#197). */
.shared-song__sponsor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.shared-song__sponsor-label {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.shared-song__sponsor-logo {
    display: block;
    max-width: min(100%, 16rem);
    max-height: 8rem;
    width: auto;
    height: auto;
}

.shared-song__cta {
    display: block;
    width: 100%;
    margin-top: var(--space-4);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.shared-song__cta img {
    display: block;
    width: 100%;
    height: auto;
}

/* /order: the package card and "How it works" side by side, the same height, from laptops up. */
.order-choose {
    display: grid;
    gap: var(--space-5);
    margin-block: var(--space-5);
}

.order-choose .product-form {
    display: flex;
    flex-direction: column;
}

.order-choose .product-grid {
    flex: 1;
    margin-block: 0;
    grid-template-columns: minmax(0, 1fr);
}

.order-steps {
    padding: var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.order-steps__heading {
    margin: 0 0 var(--space-4);
    font-size: var(--font-size-lg);
}

.order-steps__list {
    display: grid;
    gap: var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: order-step;
}

.order-steps__list li {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    column-gap: var(--space-3);
    counter-increment: order-step;
}

.order-steps__list li::before {
    content: counter(order-step);
    grid-row: span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-weight: 700;
}

.order-steps__list strong,
.order-steps__list span {
    display: block;
}

.order-steps__list span {
    color: var(--color-text-muted);
}

.order-steps .order-note {
    margin: var(--space-4) 0 0;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.order-steps .order-note + .order-note {
    padding-top: 0;
    border-top: 0;
    margin-top: var(--space-2);
}

@media (min-width: 64em) {
    .order-choose {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
