* { box-sizing: border-box; }

:root {
    color-scheme: dark;
    --bg: #101214;
    --panel: #171b1f;
    --panel-2: #1d2329;
    --border: #303943;
    --text: #e6edf3;
    --muted: #94a3b8;
    --accent: #7dd3fc;
    --accent-2: #a7f3d0;
    --danger: #fca5a5;
    --danger-bg: #7f1d1d;
    --success: #a7f3d0;
    --warning: #fde68a;
    --warning-bg: #211d10;
    --code-bg: #0b0d0f;
    --radius: 4px;
    color: var(--text);
    background: var(--bg);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
}

.page-shell {
    display: grid;
    align-content: start;
    gap: 1rem;
    width: min(1200px, calc(100% - 24px));
    margin: 0 auto;
    padding-block: 24px 40px;
}

.build-footer {
    width: min(1200px, calc(100% - 24px));
    margin: -24px auto 20px;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Cascadia Code", monospace;
    font-size: .76rem;
    text-align: left;
}

.stack { display: grid; gap: .75rem; }
.stack-sm { display: grid; gap: .45rem; }
.stack-lg { display: grid; gap: 1.5rem; }
.cluster {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem;
}
.split {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
}

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

h1, h2, h3 {
    color: var(--text);
    letter-spacing: -.025em;
}

h1 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 650;
    line-height: 1;
}

h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
}

p {
    color: var(--muted);
    line-height: 1.45;
}

a { color: var(--accent); }

code, pre, .team-token {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Cascadia Code", monospace;
}

code {
    color: var(--accent-2);
    background: var(--code-bg);
    border: 1px solid #20262d;
    border-radius: 3px;
    overflow-wrap: anywhere;
    padding: 1px 4px;
}

.form-card, .success-panel, .event-card, .room-preview {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .9rem;
}

.form-card { max-width: 700px; }

.form-grid, .filter-form {
    display: grid;
    gap: .65rem;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

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

label {
    display: grid;
    gap: .3rem;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 500;
}

input, select, button { font: inherit; }

input, select {
    width: 100%;
    padding: .5rem .55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #0d1013;
    color: var(--text);
}

input:focus, select:focus {
    outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 1px;
}

button {
    padding: .45rem .65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--panel-2);
    color: var(--text);
    font-weight: 600;
}

button:hover { border-color: var(--accent); }
button[type="submit"] { background: var(--accent); color: #061018; border-color: transparent; }
button.secondary { background: var(--panel-2); color: var(--text); }
button.danger { background: var(--danger); color: #1b0707; border-color: transparent; }
button.compact { padding: .35rem .55rem; font-size: .85rem; }

.inline-form {
    display: flex;
    align-items: end;
    gap: .6rem;
    max-width: 340px;
}

.inline-form button {
    margin-bottom: .05rem;
    white-space: nowrap;
}

.error { color: var(--danger); }
.success { color: var(--success); }
.warning {
    color: var(--warning);
    background: var(--warning-bg);
    border-left: 3px solid var(--warning);
    border-radius: var(--radius);
    padding: .55rem .65rem;
}

.hint {
    color: var(--muted);
    font-size: .86rem;
}

.team-token {
    display: inline-block;
    padding: .5rem .65rem;
    color: var(--accent);
    background: #07151c;
    border: 1px solid #16445c;
    border-radius: var(--radius);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: .1em;
}

.event-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: .75rem;
}

dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .35rem .7rem;
    font-size: .92rem;
}

dt {
    font-weight: 700;
    color: var(--muted);
}

dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.tabs {
    display: flex;
    gap: .25rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
}

.tabs button {
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 0;
    background: var(--panel-2);
    color: var(--muted);
    padding: .45rem .65rem;
}

.tabs button.active {
    background: var(--accent);
    color: #061018;
    border-color: transparent;
}

.room-preview pre, pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin: 0;
    color: #d8dee9;
    background: var(--code-bg);
    border: 1px solid #20262d;
    border-radius: var(--radius);
    padding: .65rem;
    font-size: .86rem;
    line-height: 1.45;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    font-size: .86rem;
}

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

th {
    color: var(--muted);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: #14181d;
}

tr:hover td { background: #151a20; }

.table-scroll { overflow-x: auto; }
.filter-form { align-items: end; }

.validation-message { color: var(--danger); }
.validation-errors,
.validation-summary-errors {
    color: var(--danger);
    border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
    background: color-mix(in srgb, var(--danger-bg) 35%, transparent);
    border-radius: var(--radius);
    list-style: none;
    margin: 0;
    padding: .55rem .65rem;
}
.validation-summary-errors ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.validation-errors li,
.validation-summary-errors li {
    display: block;
    list-style: none;
    margin: 0;
    padding: 0;
}
.validation-errors li + li,
.validation-summary-errors li + li {
    margin-top: .25rem;
}

#blazor-error-ui {
    background: var(--danger-bg);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none;
    left: 0;
    padding: .6rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
}

@media (max-width: 600px) {
    .page-shell { width: min(100% - 18px, 1040px); padding-block: 18px 32px; }
    .inline-form { align-items: stretch; flex-direction: column; }
    .tabs { display: grid; grid-template-columns: 1fr; border-bottom: 0; }
    .tabs button { border-radius: var(--radius); border-bottom: 1px solid var(--border); }
    dl { grid-template-columns: 1fr; }
}
