:root {
    color-scheme: dark;
    --background: #070b16;
    --sidebar: #0b1220;
    --surface: #101827;
    --surface-raised: #151f31;
    --surface-soft: rgba(255, 255, 255, .035);
    --border: rgba(148, 163, 184, .16);
    --border-strong: rgba(148, 163, 184, .28);
    --text: #e8eef7;
    --muted: #94a3b8;
    --blue: #38bdf8;
    --blue-dark: #0ea5e9;
    --purple: #a78bfa;
    --green: #34d399;
    --amber: #fbbf24;
    --red: #fb7185;
    --radius: .9rem;
    --shadow: 0 1.5rem 4rem rgba(0, 0, 0, .24);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
}

body {
    min-width: 20rem;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 75% -10%, rgba(56, 189, 248, .08), transparent 34rem),
        var(--background);
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    color: #7dd3fc;
}

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

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

:focus-visible {
    outline: .18rem solid var(--blue);
    outline-offset: .18rem;
}

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

.admin-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 16.5rem minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 1.4rem 1rem;
    border-right: 1px solid var(--border);
    background: rgba(11, 18, 32, .92);
    backdrop-filter: blur(1rem);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: .8rem;
    color: var(--text);
}

.admin-brand:hover {
    color: var(--text);
}

.admin-brand-mark {
    display: grid;
    width: 2.7rem;
    height: 2.7rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: .75rem;
    color: #06111d;
    font-size: 1.3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    box-shadow: 0 .6rem 2rem rgba(56, 189, 248, .15);
}

.admin-brand small,
.admin-brand strong {
    display: block;
}

.admin-brand small {
    margin-bottom: .05rem;
    color: var(--muted);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.admin-brand strong {
    font-size: 1.1rem;
    letter-spacing: -.02em;
}

.sidebar nav {
    display: grid;
    gap: .35rem;
    margin-top: 2.4rem;
}

.sidebar nav a {
    padding: .75rem .85rem;
    border: 1px solid transparent;
    border-radius: .65rem;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 650;
}

.sidebar nav a:hover {
    color: var(--text);
    background: var(--surface-soft);
}

.sidebar nav a.active {
    border-color: rgba(56, 189, 248, .17);
    color: var(--blue);
    background: rgba(56, 189, 248, .08);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem .8rem .2rem;
    border-top: 1px solid var(--border);
}

.sidebar-footer span,
.sidebar-footer small {
    display: block;
}

.sidebar-footer span {
    font-size: .88rem;
    font-weight: 700;
}

.sidebar-footer small {
    margin-top: .18rem;
    color: var(--muted);
    font-size: .74rem;
}

.link-button {
    margin: .7rem 0 0;
    padding: 0;
    border: 0;
    color: var(--blue);
    background: none;
    cursor: pointer;
}

.admin-main {
    width: min(100%, 96rem);
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.6rem;
}

.eyebrow {
    display: block;
    margin-bottom: .35rem;
    color: var(--blue);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    letter-spacing: -.045em;
    line-height: 1.05;
}

h2 {
    margin-bottom: 0;
    font-size: 1.08rem;
    letter-spacing: -.02em;
}

.button {
    display: inline-flex;
    min-height: 2.65rem;
    align-items: center;
    justify-content: center;
    padding: .65rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: .65rem;
    color: var(--text);
    font-size: .84rem;
    font-weight: 750;
    line-height: 1;
    background: var(--surface-soft);
    cursor: pointer;
}

.button:hover {
    border-color: rgba(56, 189, 248, .38);
    color: var(--text);
    background: rgba(56, 189, 248, .07);
}

.button-primary {
    border-color: transparent;
    color: #06111d;
    background: linear-gradient(135deg, var(--blue), #67e8f9);
    box-shadow: 0 .7rem 2rem rgba(56, 189, 248, .13);
}

.button-primary:hover {
    color: #06111d;
    background: linear-gradient(135deg, #7dd3fc, #a5f3fc);
}

.button-danger {
    border-color: rgba(251, 113, 133, .28);
    color: #fda4af;
    background: rgba(251, 113, 133, .06);
}

.button-danger:hover {
    border-color: rgba(251, 113, 133, .5);
    color: #fecdd3;
    background: rgba(251, 113, 133, .1);
}

.button-small {
    min-height: 2.15rem;
    padding: .5rem .75rem;
    font-size: .76rem;
}

.button-wide {
    width: 100%;
}

.panel {
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(16, 24, 39, .82);
    box-shadow: 0 .6rem 2rem rgba(0, 0, 0, .08);
}

.panel-heading {
    display: flex;
    min-height: 4.25rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
}

.panel-heading small {
    color: var(--muted);
    font-size: .74rem;
}

.panel-heading .eyebrow {
    margin-bottom: .2rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.metric-card {
    position: relative;
    min-height: 9rem;
    padding: 1.2rem;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(21, 31, 49, .95), rgba(16, 24, 39, .72));
}

.metric-card::after {
    position: absolute;
    right: -1.8rem;
    bottom: -2.5rem;
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    background: rgba(56, 189, 248, .055);
    content: "";
}

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

.metric-card span {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 750;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.metric-card strong {
    margin: .5rem 0 .35rem;
    font-size: 2rem;
    letter-spacing: -.04em;
}

.metric-card small {
    color: var(--muted);
    font-size: .72rem;
    line-height: 1.4;
}

.metric-accent {
    border-color: rgba(167, 139, 250, .22);
}

.metric-accent::after {
    background: rgba(167, 139, 250, .08);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
}

th,
td {
    padding: .95rem 1.2rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

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

tbody tr:hover {
    background: rgba(255, 255, 255, .018);
}

td small {
    display: block;
    margin-top: .2rem;
    color: var(--muted);
    font-size: .68rem;
}

.release-link {
    color: var(--text);
    font-weight: 800;
}

.row-action {
    white-space: nowrap;
    font-size: .76rem;
    font-weight: 750;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: .3rem .58rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.badge-published {
    border-color: rgba(52, 211, 153, .25);
    color: var(--green);
    background: rgba(52, 211, 153, .07);
}

.badge-draft {
    border-color: rgba(148, 163, 184, .24);
    color: #cbd5e1;
    background: rgba(148, 163, 184, .07);
}

.badge-suspended {
    border-color: rgba(251, 191, 36, .25);
    color: var(--amber);
    background: rgba(251, 191, 36, .07);
}

.badge-withdrawn {
    border-color: rgba(251, 113, 133, .25);
    color: var(--red);
    background: rgba(251, 113, 133, .07);
}

.empty-inline,
.empty-state {
    padding: 2rem;
    color: var(--muted);
    text-align: center;
}

.empty-inline p {
    margin-bottom: 1rem;
}

.empty-state {
    max-width: 42rem;
    margin: 10vh auto 0;
}

.empty-state h2 {
    margin-bottom: .65rem;
    color: var(--text);
    font-size: 1.5rem;
}

.error-code {
    display: block;
    margin-bottom: .7rem;
    color: var(--blue);
    font-size: 3rem;
    font-weight: 900;
}

.filter-bar {
    display: flex;
    gap: .45rem;
    margin: -.2rem 0 1rem;
    overflow-x: auto;
}

.filter-bar a {
    padding: .48rem .72rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 750;
}

.filter-bar a.active,
.filter-bar a:hover {
    border-color: rgba(56, 189, 248, .25);
    color: var(--blue);
    background: rgba(56, 189, 248, .07);
}

.alert {
    margin-bottom: 1rem;
    padding: .9rem 1rem;
    border: 1px solid var(--border);
    border-radius: .7rem;
    color: var(--text);
    font-size: .82rem;
    line-height: 1.55;
    background: var(--surface);
}

.alert strong,
.alert span,
.alert p {
    display: block;
}

.alert p {
    margin: .4rem 0 .65rem;
    color: var(--muted);
}

.alert-error {
    border-color: rgba(251, 113, 133, .26);
    background: rgba(251, 113, 133, .065);
}

.alert-success {
    border-color: rgba(52, 211, 153, .24);
    background: rgba(52, 211, 153, .06);
}

.alert-warning {
    border-color: rgba(251, 191, 36, .24);
    background: rgba(251, 191, 36, .06);
}

.secret-token {
    display: block;
    padding: .7rem;
    overflow-wrap: anywhere;
    border: 1px solid var(--border);
    border-radius: .45rem;
    color: #bae6fd;
    background: rgba(7, 11, 22, .7);
    user-select: all;
}

.publish-layout {
    display: grid;
    gap: 1.25rem;
}

.publish-layout .panel {
    margin-bottom: 0;
}

.form-section {
    padding-bottom: 1.2rem;
}

.form-section > label,
.form-section > .form-grid,
.form-section > .file-grid,
.form-section > .option-grid,
.form-section > .form-actions,
.form-section > form {
    margin-right: 1.2rem;
    margin-left: 1.2rem;
}

.step-number {
    display: inline-grid;
    width: 1.8rem;
    height: 1.8rem;
    margin-right: .6rem;
    place-items: center;
    border-radius: .45rem;
    color: var(--blue);
    font-size: .68rem;
    font-weight: 850;
    background: rgba(56, 189, 248, .09);
}

.panel-heading > div:has(.step-number) {
    display: flex;
    align-items: center;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding-top: 1.2rem;
}

label,
legend {
    color: #dbe7f3;
    font-size: .76rem;
    font-weight: 750;
}

label > span {
    color: var(--muted);
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    margin-top: .45rem;
    padding: .7rem .75rem;
    border: 1px solid var(--border-strong);
    border-radius: .55rem;
    color: var(--text);
    background: rgba(7, 11, 22, .7);
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(56, 189, 248, .34);
}

textarea {
    min-height: 8rem;
    resize: vertical;
    line-height: 1.55;
}

select {
    color-scheme: dark;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .9rem;
    padding-top: 1.2rem;
}

.file-field {
    display: flex;
    min-height: 10rem;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
    border: 1px dashed rgba(148, 163, 184, .32);
    border-radius: .7rem;
    background: rgba(7, 11, 22, .35);
}

.file-field:hover {
    border-color: rgba(56, 189, 248, .42);
    background: rgba(56, 189, 248, .035);
}

.file-field strong,
.file-field span {
    display: block;
}

.file-field span {
    min-height: 2.5rem;
    margin: .35rem 0 .6rem;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 500;
    line-height: 1.45;
}

.file-field input {
    margin-top: auto;
    padding: .5rem;
    font-size: .7rem;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
    margin-top: 1rem;
}

.check-field {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .85rem;
    border: 1px solid var(--border);
    border-radius: .65rem;
    background: var(--surface-soft);
}

.check-field input {
    width: auto;
    margin: .15rem 0 0;
}

.check-field strong,
.check-field small {
    display: block;
}

.check-field small {
    margin-top: .2rem;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 500;
    line-height: 1.4;
}

.check-field.compact {
    margin-top: .55rem;
    padding: .65rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .7rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.release-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1.35rem;
    border: 1px solid rgba(56, 189, 248, .18);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(56, 189, 248, .07), rgba(167, 139, 250, .035));
}

.release-hero h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    letter-spacing: -.05em;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(18rem, .8fr);
    gap: 1.25rem;
}

.detail-list {
    margin: 0;
    padding: .2rem 1.2rem;
}

.detail-list div {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr);
    gap: 1rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--border);
}

.detail-list div:last-child {
    border-bottom: 0;
}

.detail-list dt {
    color: var(--muted);
    font-size: .72rem;
}

.detail-list dd {
    min-width: 0;
    margin: 0;
    font-size: .78rem;
}

code {
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

.hash {
    display: block;
    overflow-wrap: anywhere;
    color: #bae6fd;
    font-size: .7rem;
}

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

.panel > .muted {
    padding: 1.1rem 1.2rem 0;
    font-size: .78rem;
    line-height: 1.55;
}

.action-stack {
    display: grid;
    gap: .6rem;
    padding: 1rem 1.2rem 1.2rem;
}

.action-stack .button {
    width: 100%;
}

.artifact-list article {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
}

.artifact-list article:last-child {
    border-bottom: 0;
}

.artifact-type {
    color: var(--purple);
    font-size: .65rem;
    font-weight: 850;
    letter-spacing: .08em;
}

.artifact-list strong {
    display: block;
    margin-bottom: .25rem;
    font-size: .8rem;
}

.artifact-list > article > small {
    color: var(--muted);
    font-size: .68rem;
    white-space: nowrap;
}

.release-notes {
    padding: 1.2rem;
    font-size: .82rem;
    line-height: 1.65;
}

.danger-panel {
    max-width: 44rem;
    border-color: rgba(251, 113, 133, .28);
}

.danger-content {
    padding: 1.2rem;
}

.danger-content > p {
    color: #cbd5e1;
    font-size: .82rem;
    line-height: 1.65;
}

.danger-content .form-stack {
    padding-top: .6rem;
}

.token-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(20rem, .75fr);
}

.token-list article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
}

.token-list article:last-child {
    border-bottom: 0;
}

.token-list strong,
.token-list span {
    display: block;
}

.token-list > article > div:first-child > span,
.token-meta span {
    margin-top: .25rem;
    color: var(--muted);
    font-size: .68rem;
}

.token-meta {
    text-align: right;
}

.form-stack {
    display: grid;
    gap: 1rem;
    padding-top: 1.2rem;
}

fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.prose-panel {
    max-width: 58rem;
    padding-bottom: 1.2rem;
}

.prose-panel > p,
.integration-steps,
.endpoint,
.code-sample {
    margin-right: 1.2rem;
    margin-left: 1.2rem;
}

.prose-panel > p {
    color: #cbd5e1;
    font-size: .85rem;
    line-height: 1.7;
}

.endpoint {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    margin-top: 1.2rem;
    margin-bottom: 1.2rem;
    padding: .85rem 1rem;
    border: 1px solid var(--border);
    border-radius: .6rem;
    background: rgba(7, 11, 22, .48);
}

.endpoint span {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.endpoint code {
    overflow-wrap: anywhere;
    color: #bae6fd;
    font-size: .75rem;
}

.integration-steps {
    display: grid;
    gap: .7rem;
    padding: 0;
    list-style: none;
}

.integration-steps li {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: .8rem;
    align-items: start;
}

.integration-steps li > span {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 50%;
    color: var(--blue);
    font-size: .7rem;
    font-weight: 850;
    background: rgba(56, 189, 248, .09);
}

.integration-steps strong {
    font-size: .82rem;
}

.integration-steps p {
    margin: .2rem 0 0;
    color: var(--muted);
    font-size: .74rem;
    line-height: 1.5;
}

.code-sample {
    padding: 1rem;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: .65rem;
    color: #bae6fd;
    background: #080d17;
    font-size: .74rem;
    line-height: 1.65;
}

.login-body {
    background:
        radial-gradient(circle at 15% 15%, rgba(56, 189, 248, .12), transparent 28rem),
        radial-gradient(circle at 85% 80%, rgba(167, 139, 250, .1), transparent 28rem),
        var(--background);
}

.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1.25rem;
}

.login-card {
    width: min(100%, 29rem);
    padding: clamp(1.4rem, 5vw, 2.2rem);
    border: 1px solid var(--border);
    border-radius: 1.1rem;
    background: rgba(16, 24, 39, .9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(1rem);
}

.login-heading {
    margin: 2.2rem 0 1.4rem;
}

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

.login-heading p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.55;
}

.login-card .form-stack {
    padding-top: 0;
}

.back-link {
    display: inline-block;
    margin-top: 1.3rem;
    color: var(--muted);
    font-size: .75rem;
}

@media (max-width: 70rem) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .file-field {
        min-height: 8rem;
    }

    .detail-grid,
    .token-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 52rem) {
    .admin-shell {
        display: block;
    }

    .sidebar {
        position: static;
        width: auto;
        height: auto;
        padding: 1rem;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar nav {
        display: flex;
        margin-top: 1rem;
        overflow-x: auto;
    }

    .sidebar nav a {
        flex: 0 0 auto;
    }

    .sidebar-footer {
        display: none;
    }

    .admin-main {
        padding: 1.2rem;
    }

    .form-grid,
    .option-grid {
        grid-template-columns: 1fr;
    }

    .token-list article {
        grid-template-columns: 1fr auto;
    }

    .token-meta {
        grid-column: 1 / -1;
        grid-row: 2;
        text-align: left;
    }
}

@media (max-width: 38rem) {
    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header .button {
        width: 100%;
    }

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

    .metric-card {
        min-height: auto;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .button {
        width: 100%;
    }

    .detail-list div {
        grid-template-columns: 1fr;
        gap: .35rem;
    }

    .artifact-list article {
        grid-template-columns: 1fr;
        gap: .4rem;
    }

    .endpoint {
        grid-template-columns: 1fr;
        gap: .35rem;
    }
}

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