:root {
    color-scheme: dark;
    --bg: #010401;
    --paper: rgba(3, 11, 4, 0.92);
    --panel: rgba(4, 15, 6, 0.98);
    --line: rgba(115, 255, 123, 0.24);
    --text: #d9ffd8;
    --muted: #78b879;
    --accent: #7dff65;
    --accent-soft: rgba(125, 255, 101, 0.12);
    --success: #a4ff8e;
    --warning: #c8ff85;
    --shadow: 0 0 24px rgba(125, 255, 101, 0.12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Consolas, "Lucida Console", "Courier New", monospace;
    background:
        radial-gradient(circle at top right, rgba(125, 255, 101, 0.2), transparent 24%),
        radial-gradient(circle at left center, rgba(42, 112, 54, 0.18), transparent 32%),
        repeating-linear-gradient(180deg, rgba(125, 255, 101, 0.035) 0 1px, transparent 1px 3px),
        linear-gradient(180deg, #010401, #041006 42%, #020803);
}

a {
    color: inherit;
}

h1,
h2,
h3,
p {
    margin: 0;
}

.page-shell {
    width: min(1500px, calc(100% - 28px));
    margin: 12px auto 24px;
    display: grid;
    gap: 10px;
}

.auth-shell {
    width: min(900px, calc(100% - 28px));
}

.hero-card,
.panel,
.stat-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    background:
        linear-gradient(135deg, rgba(8, 24, 9, 0.96), rgba(4, 15, 6, 0.98)),
        var(--panel);
}

.hero-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-mark {
    width: 88px;
    height: 88px;
    flex: 0 0 auto;
    filter: drop-shadow(0 0 16px rgba(125, 255, 101, 0.3));
}

.hero-card h1 {
    font-size: 1.45rem;
    line-height: 1.1;
}

.hero-copy,
.helper,
.small {
    color: var(--muted);
    font-size: 0.9rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.66rem;
    color: var(--accent);
}

.panel {
    padding: 12px 14px;
    display: grid;
    gap: 10px;
}

.panel h2 {
    font-size: 1.15rem;
    line-height: 1.15;
}

.auth-panel {
    gap: 16px;
}

.stack-form,
.field-block {
    display: grid;
    gap: 5px;
}

.field-block span {
    font-size: 0.84rem;
    color: var(--muted);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px 12px;
    background: rgba(255, 250, 242, 0.95);
    color: #041006;
    font: inherit;
}

.panel-actions,
.upload-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.primary-button,
.ghost-button,
.danger-button,
button {
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 7px 11px;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    background: rgba(115, 255, 123, 0.06);
    color: var(--text);
}

.primary-button {
    background: var(--accent);
    color: #031106;
    border-color: rgba(125, 255, 101, 0.45);
}

.danger-button,
button.danger {
    background: rgba(200, 255, 133, 0.08);
    color: var(--warning);
}

.ghost-button {
    background: transparent;
}

.notice {
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
}

.notice.warning {
    background: rgba(200, 255, 133, 0.08);
    color: var(--warning);
}

.notice.success {
    background: rgba(164, 255, 142, 0.08);
    color: var(--success);
}

.helper-block {
    display: grid;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--line);
}

.helper-block p {
    color: var(--muted);
    font-size: 0.9rem;
}

.disclaimer-panel {
    gap: 8px;
    background:
        radial-gradient(circle at top right, rgba(125, 255, 101, 0.1), transparent 34%),
        rgba(4, 15, 6, 0.96);
}

.disclaimer-panel p {
    color: var(--muted);
    font-size: 0.9rem;
}

.disclaimer-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 0.86rem;
}

.disclaimer-list li {
    margin: 5px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
}

.stat-card {
    padding: 10px 12px;
    background: rgba(4, 15, 6, 0.96);
}

.stat-card strong {
    display: block;
    margin-top: 3px;
    font-size: 1.35rem;
    line-height: 1;
}

.stat-card p:first-child {
    color: var(--muted);
    font-size: 0.82rem;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.drop-zone {
    position: relative;
    display: grid;
    gap: 10px;
    place-items: center;
    min-height: 220px;
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(125, 255, 101, 0.1), transparent 34%),
        rgba(115, 255, 123, 0.04);
    text-align: center;
}

.drop-zone.is-dragging {
    border-color: rgba(125, 255, 101, 0.62);
    background: rgba(125, 255, 101, 0.1);
}

.drop-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.drop-copy {
    display: grid;
    gap: 6px;
}

.drop-copy strong {
    font-size: 1.1rem;
}

.drop-copy span {
    color: var(--muted);
    font-size: 0.86rem;
}

.result {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 12px;
    align-items: start;
}

.preview-link,
.upload-thumb {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(115, 255, 123, 0.04);
}

.preview-link img,
.upload-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
}

.links {
    display: grid;
    gap: 10px;
}

.copy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
}

.uploads-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.uploads-head span,
.empty-state {
    color: var(--muted);
    font-size: 0.9rem;
}

.upload-list {
    display: grid;
    gap: 8px;
}

.upload-item {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px;
    background: rgba(115, 255, 123, 0.04);
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.upload-thumb img {
    width: 72px;
}

.upload-meta {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.upload-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.upload-actions {
    justify-content: flex-end;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.admin-table th,
.admin-table td {
    padding: 8px 7px;
    border-top: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
}

.admin-table th {
    color: var(--accent);
    font-size: 0.78rem;
}

.admin-table th a {
    color: var(--accent);
    text-decoration: none;
}

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

.notice-chip {
    display: inline-flex;
    width: fit-content;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 7px;
    background: rgba(115, 255, 123, 0.06);
    color: var(--muted);
    font-size: 0.78rem;
}

.notice-chip.warning {
    color: var(--warning);
    background: rgba(200, 255, 133, 0.08);
}

.admin-actions {
    display: grid;
    gap: 6px;
    min-width: 210px;
}

.admin-actions form,
.block-form {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.block-form input[type="text"] {
    min-width: 120px;
    width: 150px;
    padding: 7px 9px;
}

@media (max-width: 800px) {
    .hero-card,
    .hero-brand {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-mark {
        width: 72px;
        height: 72px;
    }

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

    .preview-link {
        width: min(220px, 100%);
    }

    .upload-item {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .upload-thumb img {
        width: 64px;
    }

    .upload-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .page-shell,
    .auth-shell {
        width: min(100%, calc(100% - 14px));
    }

    .copy-row {
        grid-template-columns: 1fr;
    }
}
