:root {
    color-scheme: dark;
    --background: #000;
    --foreground: #f7f7f8;
    --muted: #b9bec8;
    --panel: #101115;
    --panel-soft: #15171c;
    --line: #2b2f36;
    --silver: #d7dbe2;
    --danger: #b00020;
    --success: #00cc77;
    --home-safe-top: 150;
    --home-safe-bottom: 104;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 280px;
    background: var(--background);
    color: var(--foreground);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--background);
    color: var(--foreground);
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

.skip {
    position: fixed;
    left: -9999px;
    top: 1rem;
    z-index: 1000;
}

.skip:focus {
    left: 1rem;
    padding: .65rem .85rem;
    border-radius: .7rem;
    background: #fff;
    color: #000;
}

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    height: 150px;
    padding: 10px 18px 0;
    pointer-events: none;
    background: linear-gradient(#000 0%, rgba(0, 0, 0, .74) 62%, transparent 100%);
}

.site-header > * {
    pointer-events: auto;
}

.site-header > a[aria-label="Home"] {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    max-height: 132px;
}

.site-logo {
    display: block;
    width: min(390px, 62vw);
    max-height: 132px;
    object-fit: contain;
}

.pill,
.header-action {
    position: absolute;
    right: 18px;
    top: 18px;
    padding: .55rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(17, 17, 17, .9);
    color: #fff;
    text-decoration: none;
    backdrop-filter: blur(12px);
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 60;
    display: flex;
    gap: .25rem;
    transform: translateX(-50%);
    padding: .45rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(12, 13, 16, .88);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
    backdrop-filter: blur(14px);
}

.bottom-nav a,
.bottom-nav button {
    min-width: 74px;
    padding: .72rem 1rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.bottom-nav a:hover,
.bottom-nav a:focus-visible,
.bottom-nav button:hover,
.bottom-nav button:focus-visible {
    background: #fff;
    color: #000;
    outline: none;
}

.bottom-nav form {
    margin: 0;
}

.main-content {
    min-height: 100vh;
    padding-bottom: 120px;
}

.home-stage {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 520px;
    overflow: hidden;
    background: #000;
    touch-action: manipulation;
}

#home-canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

.home-fallback {
    max-width: 1120px;
    margin: 0 auto;
    padding: 165px 18px 125px;
}

.home-fallback .artist-card span {
    display: block;
    margin-top: .85rem;
    font-size: 1.05rem;
    font-weight: 800;
    text-align: center;
}

.page-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 175px 22px 130px;
}

.page-shell.narrow {
    max-width: 620px;
}

.lead {
    max-width: 820px;
    color: #c7cbd3;
    font-size: 1.15rem;
    line-height: 1.65;
}

h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 900;
    letter-spacing: -.05em;
    line-height: .98;
}

h2 {
    margin: 2rem 0 .8rem;
    font-size: 1.55rem;
    font-weight: 800;
}

h3 {
    margin: 1.2rem 0 .5rem;
    font-size: 1.1rem;
}

.artist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 24px;
    margin-top: 28px;
}

.artist-card,
.dash-card,
.list-card,
.form-card,
.notice,
.panel {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025));
    box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}

.artist-card,
.form-card,
.list-card,
.notice,
.panel {
    padding: 18px;
}

.artist-card > a {
    color: #fff;
    text-decoration: none;
}

.artist-card img,
.artist-photo {
    display: block;
    width: 300px;
    height: 300px;
    max-width: 100%;
    margin: auto;
    border-radius: 16px;
    object-fit: cover;
}

.artist-card h2 {
    margin: 1rem 0 .4rem;
    text-align: center;
}

.dash-card {
    display: flex;
    min-height: 112px;
    align-items: flex-end;
    padding: 18px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    text-decoration: none;
}

.dash-card:hover,
.dash-card:focus-visible {
    border-color: #fff;
    transform: translateY(-2px);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.actions a,
.button,
button:not(.nav-button) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: .7rem 1rem;
    border: 1px solid var(--silver);
    border-radius: 999px;
    background: #fff;
    color: #000;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.actions a:hover,
.actions a:focus-visible,
.button:hover,
.button:focus-visible,
button:not(.nav-button):hover,
button:not(.nav-button):focus-visible {
    background: #dfe3e9;
    outline: none;
}

button.danger,
.button.danger {
    border-color: #ff5470;
    background: transparent;
    color: #ff8da0;
}

button.secondary,
.button.secondary {
    border-color: var(--line);
    background: var(--panel-soft);
    color: #fff;
}

button:disabled {
    cursor: wait;
    opacity: .62;
}

.artist-hero {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    align-items: start;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 32px 0 18px;
}

.tabs button {
    border-color: var(--line);
    background: var(--panel-soft);
    color: #fff;
}

.tabs button[aria-selected="true"] {
    border-color: #fff;
    background: #fff;
    color: #000;
}

label {
    display: block;
    margin: .35rem 0;
    color: #d5d8df;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    margin: .45rem 0;
    padding: .82rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #07080a;
    color: #fff;
    font: inherit;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: .45rem;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #8f96a3;
    outline: 2px solid rgba(255, 255, 255, .13);
    outline-offset: 1px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin: 24px 0;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
    gap: 16px;
}

.table-wrap {
    max-width: 100%;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

td,
th {
    padding: .82rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: #0c0d10;
    color: #fff;
    font-size: .85rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.flash {
    position: fixed;
    top: 132px;
    right: 18px;
    z-index: 99;
    max-width: min(420px, calc(100vw - 36px));
    padding: 1rem;
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .42);
}

.flash.success {
    background: var(--success);
    color: #001b10;
}

.flash.error {
    background: var(--danger);
    color: #fff;
}

.fine,
.muted {
    color: #aab0ba;
    font-size: .9rem;
}

.calendar-box {
    margin: 20px 0;
    padding: 14px;
    border-radius: 18px;
    background: #fff;
    color: #111;
}

.badge,
.status-badge {
    display: inline-block;
    padding: .25rem .55rem;
    border: 1px solid #f5d27a;
    border-radius: 999px;
    color: #f5d27a;
    font-size: .82rem;
    font-weight: 800;
}

.status-badge.success {
    border-color: #6ee7a8;
    color: #6ee7a8;
}

.status-badge.danger {
    border-color: #ff7189;
    color: #ff7189;
}

.small-form {
    margin-top: 14px;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: .6rem 0;
}

.inline-form input,
.inline-form select {
    width: auto;
    min-width: 160px;
    flex: 1 1 160px;
}

.unread {
    border-color: #f5d27a;
}

.is-loading::after {
    content: "Loading...";
    position: fixed;
    right: 20px;
    bottom: 90px;
    z-index: 100;
    padding: .6rem 1rem;
    border-radius: 999px;
    background: #fff;
    color: #000;
    font-weight: 900;
}

.embed iframe {
    max-width: 100%;
    border: 0;
    border-radius: 14px;
}

.empty-state {
    padding: 2rem;
    border: 1px dashed var(--line);
    border-radius: 18px;
    color: var(--muted);
    text-align: center;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0 1.4rem;
}

details.panel > summary {
    cursor: pointer;
    font-weight: 800;
}

@media (max-width: 720px) {
    :root {
        --home-safe-top: 142;
        --home-safe-bottom: 104;
    }

    .site-header {
        height: 142px;
        padding: 8px 10px 0;
    }

    .site-header > a[aria-label="Home"] {
        max-height: 122px;
    }

    .site-logo {
        width: min(330px, 80vw);
        max-height: 122px;
    }

    .pill,
    .header-action {
        right: 10px;
        top: 10px;
        padding: .42rem .7rem;
        font-size: .82rem;
    }

    .bottom-nav {
        width: calc(100% - 20px);
        justify-content: space-around;
    }

    .bottom-nav a,
    .bottom-nav button {
        min-width: 0;
        padding: .7rem .56rem;
        font-size: clamp(.8rem, 3.7vw, 1rem);
    }

    .page-shell,
    .page-shell.narrow {
        padding: 158px 14px 126px;
    }

    .artist-hero {
        grid-template-columns: 1fr;
    }

    .artist-photo {
        width: min(300px, 100%);
        height: auto;
        aspect-ratio: 1;
    }

    .artist-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
        gap: 12px;
    }

    .artist-card {
        padding: 10px;
        border-radius: 16px;
    }

    .artist-card img {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        border-radius: 12px;
    }

    .home-fallback {
        padding-top: 150px;
    }

    h1 {
        font-size: clamp(2.4rem, 13vw, 4rem);
    }

    .flash {
        top: 138px;
        right: 10px;
    }
}

@media (max-width: 390px) {
    :root {
        --home-safe-top: 132;
    }

    .site-header {
        height: 132px;
    }

    .site-logo {
        width: min(290px, 78vw);
        max-height: 112px;
    }

    .page-shell,
    .page-shell.narrow {
        padding-top: 145px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
.header-action {
    margin: 0;
    padding: 0;
    overflow: hidden;
}
.header-action .nav-button {
    min-height: 0;
    padding: .55rem 1rem;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    cursor: pointer;
}
@media (max-width: 720px) {
    .header-action .nav-button { padding: .42rem .7rem; font-size: .82rem; }
}

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

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

.page-heading h1 {
    margin-bottom: .55rem;
}

.page-heading .lead {
    margin: 0;
}

.pill-link {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: .7rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-soft);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.pill-link:hover,
.pill-link:focus-visible {
    border-color: #fff;
    outline: none;
}

.form-card > h2:first-child {
    margin-top: 0;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 12px;
    margin: 1rem 0;
}

.check {
    display: flex;
    gap: .5rem;
    align-items: center;
    min-height: 48px;
    padding: .7rem .85rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #090a0d;
}

.check input {
    flex: 0 0 auto;
    margin: 0;
}

.required-control::after {
    content: " Required for artist users";
    color: #f5d27a;
    font-size: .78rem;
    font-weight: 700;
}

.admin-thumb {
    display: block;
    width: 130px;
    height: 130px;
    margin: .7rem 0 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    object-fit: cover;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    align-items: center;
}

.table-actions > a {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    padding: .48rem .72rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #fff;
    font-size: .9rem;
    font-weight: 750;
    text-decoration: none;
}

.table-actions .inline-form {
    margin: 0;
}

.danger-button {
    min-height: 36px !important;
    padding: .48rem .72rem !important;
    border-color: #ff7189 !important;
    background: transparent !important;
    color: #ff91a4 !important;
    font-size: .9rem !important;
}

.admin-tools,
.dashboard-sections {
    margin-top: 28px;
}

.dash-card {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    transition: transform .18s ease, border-color .18s ease;
}

.dash-card strong {
    display: block;
    margin-bottom: .25rem;
    font-size: 1.15rem;
}

.dash-card span {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.35;
}

.booking-list {
    display: grid;
    gap: 14px;
}

.booking-card {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
}

.booking-card > div:first-child {
    flex: 1 1 420px;
}

.booking-card h3 {
    margin-top: .7rem;
}

.compact-control {
    min-width: min(100%, 220px);
    margin: 0;
}

.compact-control select {
    margin-bottom: 0;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 14px;
}

.health-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-left-width: 5px;
    border-radius: 16px;
    background: var(--panel);
}

.health-card.status-ok {
    border-left-color: #6ee7a8;
}

.health-card.status-warning {
    border-left-color: #f5d27a;
}

.health-card.status-error {
    border-left-color: #ff7189;
}

.health-title {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.health-title span {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .08em;
}

.health-card p {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.5;
}

.release-card {
    display: grid;
    grid-template-columns: minmax(100px, 180px) 1fr;
    gap: 18px;
    margin-bottom: 16px;
}

.release-cover {
    width: 100%;
    border-radius: 14px;
    aspect-ratio: 1;
    object-fit: cover;
}

code {
    overflow-wrap: anywhere;
    color: #e9edf5;
    font-size: .85em;
}

@media (max-width: 640px) {
    .page-heading {
        display: block;
    }

    .page-heading .pill-link {
        margin-top: 14px;
    }

    .release-card {
        grid-template-columns: 1fr;
    }

    .release-cover {
        max-width: 220px;
    }

    .table-actions {
        min-width: 180px;
    }
}

/* v5.1 authentication surface */
.auth-page .site-header {
    height: 138px;
    padding-top: 6px;
    background: linear-gradient(#000 0%, #000 72%, rgba(0, 0, 0, .82) 88%, transparent 100%);
}

.auth-page .site-header > a[aria-label="Home"] {
    max-height: 118px;
}

.auth-page .site-logo {
    width: min(340px, 68vw);
    max-height: 118px;
}

.auth-shell {
    max-width: 590px;
    padding-top: 168px;
}

.auth-heading {
    margin-bottom: 1.2rem;
    text-align: center;
}

.auth-heading h1 {
    margin-bottom: .75rem;
    font-size: clamp(2.55rem, 8vw, 4.65rem);
}

.eyebrow {
    margin: 0 0 .55rem;
    color: #9ca3af;
    font-size: .74rem;
    font-weight: 850;
    letter-spacing: .19em;
    text-transform: uppercase;
}

.auth-lead {
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.55;
}

.auth-role-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    max-width: 360px;
    margin: 0 auto 1rem;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #0b0c0f;
}

.auth-role-switch a {
    padding: .68rem .9rem;
    border-radius: 999px;
    color: #c4c8d0;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.auth-role-switch a[aria-current="page"] {
    background: #fff;
    color: #000;
}

.auth-card {
    padding: clamp(20px, 4vw, 30px);
}

.auth-card label {
    margin-top: .7rem;
}

.auth-submit {
    width: 100%;
    margin-top: .75rem;
}

.auth-help {
    margin: 1rem 0 0;
    text-align: center;
}

.auth-secondary {
    margin-top: 1rem;
}

.auth-secondary > summary {
    cursor: pointer;
    font-weight: 800;
}

.auth-secondary[open] > summary {
    margin-bottom: 1rem;
}

.auth-secondary form {
    margin: 0;
}

@media (max-width: 720px) {
    .auth-page .site-header {
        height: 122px;
    }

    .auth-page .site-header > a[aria-label="Home"] {
        max-height: 104px;
    }

    .auth-page .site-logo {
        width: min(290px, 72vw);
        max-height: 104px;
    }

    .auth-shell {
        padding-top: 140px;
        padding-right: 16px;
        padding-left: 16px;
    }

    .auth-heading h1 {
        font-size: clamp(2.45rem, 12vw, 3.55rem);
    }
}
