:root {
    --ink: #202124;
    --muted: #65717f;
    --line: #d9e0e8;
    --panel: #ffffff;
    --page: #f4f7fb;
    --brand: #12665f;
    --brand-dark: #0d4b46;
    --accent: #f0b429;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

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

.topbar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 28px;
}

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

nav {
    align-items: center;
    display: flex;
    gap: 18px;
}

.page {
    margin: 0 auto;
    max-width: 1120px;
    padding: 34px 20px 60px;
}

.hero {
    align-items: center;
    background: linear-gradient(115deg, #fff 0%, #eef7f2 52%, #f9edcb 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    min-height: 420px;
    padding: 48px;
}

.hero h1 {
    font-size: 44px;
    line-height: 1.05;
    margin: 0 0 16px;
    max-width: 680px;
}

.hero p {
    color: var(--muted);
    font-size: 19px;
    margin: 0 0 24px;
    max-width: 620px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 24px;
}

.narrow {
    margin-left: auto;
    margin-right: auto;
    max-width: 520px;
}

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

h2 {
    font-size: 20px;
}

.muted {
    color: var(--muted);
}

.survey-instructions {
    color: var(--muted);
    font-size: 18px;
    font-weight: 700;
    margin: -2px 0 22px;
}

.notice,
.errors {
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.notice {
    background: #eaf7ef;
    border: 1px solid #b8dec5;
}

.errors {
    background: #fff1f0;
    border: 1px solid #f0b8b2;
    color: var(--danger);
}

.warning {
    background: #fff8e6;
    border: 1px solid #f2d48a;
    border-radius: 8px;
    color: #6f4b00;
    padding: 12px 14px;
}

.stack {
    display: grid;
    gap: 18px;
}

label {
    color: #334155;
    display: grid;
    font-weight: 700;
    gap: 7px;
}

input,
textarea {
    border: 1px solid #bac5d1;
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    padding: 11px 12px;
    width: 100%;
}

textarea {
    resize: vertical;
}

button,
.button {
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    justify-content: center;
    padding: 10px 16px;
    text-decoration: none;
    width: fit-content;
}

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

.secondary {
    background: #fff;
    color: var(--brand);
}

.secondary:hover {
    background: #eef7f2;
    color: var(--brand);
}

.danger {
    background: #fff;
    border-color: #f0b8b2;
    color: var(--danger);
}

.link-button {
    background: transparent;
    border: 0;
    color: var(--brand);
    font-weight: 400;
    padding: 0;
}

.inline {
    display: inline;
}

.page-head {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.head-actions,
.form-actions,
.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.grid.two {
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr auto;
}

.grid.three {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.check-row {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: flex-end;
}

.check-row input {
    width: auto;
}

.publish-toggle {
    border: 1px solid var(--line);
    border-radius: 8px;
    justify-content: center;
    min-height: 46px;
    padding: 10px 14px;
}

.publish-label::before {
    content: attr(data-unchecked);
}

.publish-toggle input:checked + .publish-label {
    color: #168a43;
}

.publish-toggle input:checked + .publish-label::before {
    content: attr(data-checked);
}

.question-card {
    margin-bottom: 18px;
}

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

.table-wrap {
    overflow-x: auto;
}

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

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

th {
    color: #475569;
    font-size: 14px;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0;
    padding: 18px;
}

legend {
    font-size: 18px;
    font-weight: 800;
    padding: 0 8px;
}

.choice-count {
    color: var(--muted);
    font-weight: 700;
    margin: 0 0 12px;
}

.choice-count.is-complete {
    color: #168a43;
}

.option-list {
    display: grid;
    gap: 10px;
}

.option-list label {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    font-weight: 700;
    gap: 10px;
    padding: 12px;
}

.option-list input {
    width: auto;
}

.results-list {
    display: grid;
    gap: 14px;
}

.result-row {
    display: grid;
    gap: 6px;
}

.result-row span {
    color: var(--muted);
}

.bar {
    background: #e8eef5;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.bar i {
    background: var(--accent);
    display: block;
    height: 100%;
}

.danger-zone {
    margin-top: 16px;
}

.complete {
    text-align: center;
}

@media (max-width: 720px) {
    .topbar,
    .page-head,
    .grid.two {
        align-items: flex-start;
        flex-direction: column;
    }

    .grid.two,
    .grid.three,
    .choice-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 340px;
        padding: 28px;
    }

    .hero h1 {
        font-size: 34px;
    }
}
