:root {
    color-scheme: light;
    font-family: Georgia, 'Times New Roman', serif;
}

* {
    box-sizing: border-box;
}

.rules-page {
    margin: 0;
    background: #f1efe8;
    color: #1e2723;
}

.rules-page main {
    width: min(1120px, calc(100% - 48px));
    margin: 48px auto;
}

.rules-page a {
    color: #8c2f1d;
    font-weight: 700;
    text-underline-offset: 3px;
}

.rules-page a:focus-visible,
.rules-page input:focus-visible,
.rules-page textarea:focus-visible,
.rules-page button:focus-visible {
    outline: 3px solid #e8a31a;
    outline-offset: 3px;
}

.rules-page h1 {
    letter-spacing: -.045em;
}

.rules-page .eyebrow {
    font: 700 .75rem/1.2 ui-monospace, monospace;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #a33a25;
}

.rules-page table {
    width: 100%;
    border-collapse: collapse;
    background: #fffdf7;
}

.rules-page th,
.rules-page td {
    border-bottom: 1px solid #c9c2b3;
    text-align: left;
    vertical-align: top;
}

.rules-page th {
    font: 700 .72rem/1.2 ui-monospace, monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: #26342e;
    color: #fffdf7;
}

.rules-page .notice {
    padding: 14px 16px;
    border-left: 5px solid #176342;
    background: #e6f2e9;
}

.rules-index main > header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 3px solid #1e2723;
}

.rules-index h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 4rem);
}

.rules-index .eyebrow {
    margin: 0 0 8px;
}

.rules-index table {
    margin-top: 32px;
    box-shadow: 8px 8px 0 #d7d1c2;
}

.rules-index th,
.rules-index td {
    padding: 16px;
}

.rules-index .status {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid currentColor;
    font: 700 .72rem/1 ui-monospace, monospace;
    text-transform: uppercase;
}

.rules-index .active {
    color: #176342;
}

.rules-index .inactive {
    color: #7a4a3d;
}

.rules-index .notice {
    margin: 24px 0;
}

.rules-edit main {
    width: min(1180px, calc(100% - 48px));
    margin: 36px auto 72px;
}

.rules-edit main > header {
    padding: 18px 0;
    border-bottom: 3px solid #1e2723;
}

.rules-edit h1 {
    margin: 8px 0;
    font-size: clamp(2rem, 5vw, 3.75rem);
    letter-spacing: -.04em;
}

.rules-edit .eyebrow,
.rules-edit legend {
    font: 700 .75rem/1.2 ui-monospace, monospace;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.rules-edit .meta,
.rules-edit .notice,
.rules-edit .errors {
    padding: 14px 16px;
    border-left: 5px solid #26342e;
    background: #fffdf7;
}

.rules-edit .notice {
    border-color: #176342;
}

.rules-edit .errors {
    border-color: #a33a25;
}

.rules-edit form.editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 26px;
}

.rules-edit fieldset {
    min-width: 0;
    padding: 22px;
    border: 1px solid #9d9585;
    background: #fffdf7;
}

.rules-edit fieldset.full {
    grid-column: 1 / -1;
}

.rules-edit legend {
    padding: 0 8px;
    color: #8c2f1d;
}

.rules-edit label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 700;
}

.rules-edit input[type='number'],
.rules-edit textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #736c60;
    background: #fff;
    font: inherit;
}

.rules-edit textarea {
    min-height: 90px;
    resize: vertical;
}

.rules-edit .checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
}

.rules-edit .checks label {
    margin: 0;
    font-weight: 400;
}

.rules-edit .campaigns {
    max-height: 320px;
    overflow: auto;
    border: 1px solid #c9c2b3;
}

.rules-edit th,
.rules-edit td {
    padding: 10px 12px;
    border-bottom-color: #d8d2c6;
}

.rules-edit th {
    position: sticky;
    top: 0;
}

.rules-edit .actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 14px;
}

.rules-edit button {
    padding: 12px 18px;
    border: 0;
    background: #26342e;
    color: #fff;
    font: 700 .85rem/1 ui-monospace, monospace;
    cursor: pointer;
}

.rules-edit button.publish {
    background: #a33a25;
}

.rules-edit .preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 32px;
}

.rules-edit .preview section {
    padding: 20px;
    border-top: 5px solid #176342;
    background: #fffdf7;
}

.rules-edit .preview section:last-child {
    border-color: #a33a25;
}

.rules-edit .preview ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.rules-edit small {
    color: #5d625f;
}

@media (max-width: 760px) {
    .rules-page main {
        width: min(100% - 28px, 1180px);
    }

    .rules-index main > header,
    .rules-edit form.editor,
    .rules-edit .preview {
        display: block;
    }

    .rules-edit fieldset + fieldset,
    .rules-edit .preview section + section {
        margin-top: 22px;
    }

    .rules-page table {
        display: block;
        overflow-x: auto;
    }
}
