:root {
    --bg: #0b1220;
    --bg-alt: #111827;
    --panel: #162033;
    --panel-strong: #1c2940;
    --text: #e7eefc;
    --muted: #9aabc7;
    --line: #2c3a53;
    --accent: #1f8f84;
    --accent-strong: #176e67;
    --danger: #fda4af;
    --success: #86efac;
    --shadow: 0 24px 70px rgba(2, 6, 23, 0.45);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Gill Sans", "Trebuchet MS", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(45, 212, 191, 0.12), transparent 24%),
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.09), transparent 28%),
        linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
}

.shell {
    width: min(980px, calc(100vw - 32px));
    margin: 32px auto 48px;
}

.topbar,
.section-header,
.input-row,
.meta div,
table td:last-child form {
    display: flex;
    align-items: center;
}

.topbar,
.section-header {
    justify-content: space-between;
    gap: 16px;
}

.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    color: var(--muted);
}

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

h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.panel {
    background: linear-gradient(180deg, rgba(28, 41, 64, 0.96) 0%, rgba(22, 32, 51, 0.96) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.panel.narrow {
    max-width: 420px;
}

.lede,
.hint,
.error-text,
label span,
th,
td {
    color: var(--muted);
}

.form-grid {
    display: grid;
    gap: 14px;
}

.compact-form {
    margin-top: 16px;
}

.form-grid label {
    display: grid;
    gap: 8px;
}

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

input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(11, 18, 32, 0.78);
    color: var(--text);
    font: inherit;
}

select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(11, 18, 32, 0.78);
    color: var(--text);
    font: inherit;
}

button {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #edfdfb;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button.secondary {
    background: linear-gradient(180deg, #243249 0%, #1c2638 100%);
    color: var(--text);
}

button.danger {
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.45) 0%, rgba(94, 24, 24, 0.38) 100%);
    color: var(--danger);
}

.checkbox {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.checkbox input {
    width: auto;
}

.input-row {
    gap: 10px;
}

.suffix {
    white-space: nowrap;
    color: var(--muted);
}

.meta {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.meta div {
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(44, 58, 83, 0.9);
}

.meta dt,
.meta dd {
    margin: 0;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.flash {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
}

.flash.success {
    background: rgba(20, 83, 45, 0.35);
    border-color: rgba(134, 239, 172, 0.4);
    color: var(--success);
}

.flash.error {
    background: rgba(127, 29, 29, 0.28);
    border-color: rgba(253, 164, 175, 0.35);
    color: var(--danger);
}

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

th,
td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid rgba(44, 58, 83, 0.9);
}

.mono {
    font-family: "Courier New", monospace;
}

.meta dd#next-sync-countdown {
    font-weight: 700;
    color: var(--text);
}

.error-text {
    color: var(--danger);
}

input:focus,
select:focus {
    outline: 2px solid rgba(45, 212, 191, 0.25);
    outline-offset: 1px;
    border-color: rgba(45, 212, 191, 0.6);
}

button:hover {
    filter: brightness(1.08);
}

@media (max-width: 760px) {
    .shell {
        width: min(100vw - 20px, 980px);
        margin-top: 16px;
    }

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

    .topbar,
    .section-header,
    .input-row,
    .meta div {
        align-items: flex-start;
        flex-direction: column;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    td {
        padding-left: 0;
        padding-right: 0;
    }
}
