:root {
    color-scheme: dark;
    --bg: #070707;
    --panel: #101010;
    --line: rgba(255, 255, 255, 0.12);
    --text: #f7f4eb;
    --muted: #b9b4a8;
    --gold: #e7b700;
    --gold-strong: #ffd21c;
    --red: #ff5c62;
    --green: #51d190;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: var(--gold-strong);
}

.shell {
    width: min(calc(100% - 32px), 980px);
    margin: 0 auto;
    padding: 56px 0;
}

.panel,
.stat {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.panel {
    padding: 24px;
}

.form-panel {
    max-width: 560px;
    margin: 8vh auto 0;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--gold);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 12px;
    font-size: clamp(34px, 6vw, 56px);
    line-height: 1;
}

h2 {
    margin-bottom: 0;
    font-size: 22px;
}

.lead,
.hint,
.fine-print,
.field-help {
    color: var(--muted);
}

.field-help {
    margin: -6px 0 0;
    font-size: 14px;
}

form {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

label {
    font-weight: 800;
}

input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #070707;
    color: var(--text);
    font: inherit;
}

button,
.button,
.secondary {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--gold);
    color: #090909;
    font: inherit;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.notice {
    margin: 18px 0;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.success {
    border-color: rgba(81, 209, 144, 0.5);
}

.error {
    border-color: rgba(255, 92, 98, 0.5);
    color: #ffd9db;
}

.hp {
    position: absolute;
    left: -9999px;
}

.admin-head,
.table-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0;
}

.stat {
    padding: 18px;
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.stat strong {
    font-size: 34px;
}

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

.storage-panel {
    margin-bottom: 22px;
}

.storage-list {
    display: grid;
    gap: 10px;
    margin: 14px 0 0;
}

.storage-list div {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 12px;
}

.storage-list dt {
    color: var(--muted);
    font-weight: 800;
}

.storage-list dd {
    min-width: 0;
    margin: 0;
}

code {
    overflow-wrap: anywhere;
}

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

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 13px;
}

.empty {
    color: var(--muted);
    text-align: center;
}

@media (max-width: 640px) {
    .shell {
        padding-top: 12px;
    }

    .form-panel {
        margin-top: 0;
    }

    .admin-head,
    .table-actions,
    .stats {
        display: grid;
        grid-template-columns: 1fr;
    }

    .storage-list div {
        grid-template-columns: 1fr;
    }
}
