:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #17202a;
    --muted: #657386;
    --line: #d9e1ec;
    --brand: #136f63;
    --brand-dark: #0f584f;
    --danger: #b42318;
    --warn: #8a5a00;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

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

.topbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 24px;
    min-height: 64px;
    padding: 0 28px;
}

.brand {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}

nav {
    display: flex;
    flex: 1;
    gap: 16px;
}

nav a {
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
}

.credit {
    color: var(--muted);
    font-size: 14px;
}

.clockbar {
    color: var(--muted);
    display: grid;
    font-size: 12px;
    gap: 2px;
    min-width: 260px;
}

.clockbar strong {
    color: var(--text);
    font-weight: 700;
}

.page,
.narrow {
    margin: 0 auto;
    max-width: 1180px;
    padding: 28px;
}

.narrow {
    max-width: 640px;
}

h1,
h2 {
    line-height: 1.15;
    margin: 0 0 18px;
}

.auth-panel,
.form-panel,
.panel,
.bet-card,
.summary {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
}

.auth-panel {
    margin: 40px auto;
    max-width: 460px;
}

.compact {
    margin-bottom: 18px;
}

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

label {
    color: var(--muted);
    display: grid;
    font-size: 14px;
    font-weight: 700;
    gap: 6px;
}

input,
select,
textarea,
button,
.button {
    border-radius: 6px;
    font: inherit;
}

input,
select,
textarea {
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px 12px;
    width: 100%;
}

textarea {
    resize: vertical;
}

button,
.button {
    background: var(--brand);
    border: 0;
    color: #ffffff;
    cursor: pointer;
    display: inline-block;
    font-weight: 700;
    padding: 10px 14px;
    text-align: center;
    text-decoration: none;
}

button:hover,
.button:hover {
    background: var(--brand-dark);
}

.section-head,
.card-top {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.bet-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.bet-card h2 {
    font-size: 20px;
    margin-bottom: 0;
}

.status {
    background: #e7f4f1;
    border-radius: 999px;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 700;
    padding: 4px 9px;
    white-space: nowrap;
}

.meta {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 16px 0 0;
}

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

.meta div {
    min-width: 0;
}

dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

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

.two-col,
.admin-grid,
.bet-detail,
.columns,
.profile-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 1fr 1.2fr;
}

.ratio-row,
.button-row,
.actions,
.inline-form {
    align-items: center;
    display: flex;
    gap: 8px;
}

.check {
    align-items: center;
    display: flex;
    flex-direction: row;
}

.check input {
    width: auto;
}

.evaluation-form {
    border-top: 1px solid var(--line);
    margin-top: 16px;
    padding-top: 16px;
}

.evaluation-form:first-of-type {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.timezone-form {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 18px;
}

.field-note {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.details {
    white-space: pre-wrap;
}

.totals {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 16px;
}

.totals span {
    background: #edf2f7;
    border-radius: 6px;
    padding: 10px;
}

table {
    background: var(--panel);
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.flash,
.notice {
    border-radius: 6px;
    margin: 0 0 16px;
    padding: 12px 14px;
}

.flash.notice,
.notice {
    background: #e7f4f1;
    color: var(--brand-dark);
}

.flash.error {
    background: #fee4e2;
    color: var(--danger);
}

.flash.warning {
    background: #fff4d6;
    color: var(--warn);
}

.eyebrow {
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 8px;
    text-transform: uppercase;
}

@media (max-width: 820px) {
    .topbar,
    nav,
    .section-head,
    .actions,
    .button-row {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar {
        padding: 18px;
    }

    .two-col,
    .three-col,
    .admin-grid,
    .bet-detail,
    .columns,
    .profile-grid,
    .totals {
        grid-template-columns: 1fr;
    }

    .page {
        padding: 18px;
    }
}
