:root {
    color-scheme: light;
    --ink: #17211d;
    --muted: #5f6f68;
    --line: #d9e1dc;
    --paper: #fbfcfa;
    --panel: #ffffff;
    --accent: #0f7b63;
    --accent-strong: #095746;
    --soft: #eef6f3;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Tahoma, Arial, sans-serif;
    background:
        linear-gradient(135deg, rgba(15, 123, 99, 0.11), transparent 42%),
        linear-gradient(315deg, rgba(196, 90, 56, 0.12), transparent 38%),
        var(--paper);
    color: var(--ink);
}

.shell {
    width: min(1120px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 22px;
    align-items: start;
    padding: 32px 0;
}

.survey-panel,
.stats {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 45px rgba(23, 33, 29, 0.08);
}

.survey-panel {
    padding: 30px;
}

.intro {
    border-bottom: 1px solid var(--line);
    padding-bottom: 22px;
    margin-bottom: 24px;
}

.kicker {
    display: inline-flex;
    color: var(--accent-strong);
    background: var(--soft);
    border: 1px solid #cfe5dd;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 34px;
    line-height: 1.45;
    margin-top: 12px;
}

.intro p {
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.9;
}

.survey-form {
    display: grid;
    gap: 20px;
}

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

label,
fieldset {
    min-width: 0;
}

label span,
legend {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
}

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

legend {
    padding: 0 8px;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px 14px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: 3px solid rgba(15, 123, 99, 0.18);
    border-color: var(--accent);
}

.mode-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.mode-switch a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--accent-strong);
    background: #fff;
    text-decoration: none;
    font-weight: 700;
}

.mode-switch a.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.rating,
.choices,
.nps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rating label,
.choices label,
.nps label {
    position: relative;
}

.rating input,
.choices input,
.nps input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rating span,
.choices span,
.nps span {
    display: grid;
    place-items: center;
    min-height: 42px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    transition: 140ms ease;
}

.rating span,
.nps span {
    width: 46px;
    padding: 0;
}

.rating input:checked + span,
.choices input:checked + span,
.nps input:checked + span {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 8px 22px rgba(15, 123, 99, 0.22);
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    padding: 0 20px;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    text-decoration: none;
    cursor: pointer;
}

.button.primary {
    width: min(220px, 100%);
}

.button:hover {
    background: var(--accent-strong);
}

.button.ghost {
    background: #fff;
    color: var(--accent-strong);
    border: 1px solid var(--line);
}

.button.ghost:hover {
    background: var(--soft);
}

.notice {
    border-radius: 8px;
    padding: 18px;
    line-height: 1.8;
}

.notice.success {
    background: var(--soft);
    border: 1px solid #cfe5dd;
}

.notice.success p {
    color: var(--muted);
    margin: 8px 0 16px;
}

.notice.error {
    background: #fff1f0;
    border: 1px solid #ffd0cc;
    color: var(--danger);
}

.stats {
    position: sticky;
    top: 24px;
    padding: 18px;
    display: grid;
    gap: 14px;
}

.stats div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #fff;
}

.stats span {
    color: var(--muted);
    font-size: 13px;
}

.stats strong {
    display: block;
    margin-top: 8px;
    font-size: 26px;
}

.results-shell {
    grid-template-columns: minmax(0, 1fr) 240px;
}

.intro.compact {
    margin-bottom: 18px;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    text-align: right;
    border-bottom: 1px solid var(--line);
    padding: 13px 12px;
    vertical-align: top;
    line-height: 1.7;
}

th {
    color: var(--accent-strong);
    background: var(--soft);
    font-size: 13px;
}

tr:last-child td {
    border-bottom: 0;
}

.section-title {
    font-size: 20px;
    margin: 24px 0 12px;
}

@media (max-width: 820px) {
    .shell {
        grid-template-columns: 1fr;
        padding: 18px 0;
    }

    .survey-panel {
        padding: 20px;
    }

    .stats {
        position: static;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .field-grid,
    .stats {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 28px;
    }

    .nps span {
        width: 40px;
    }
}
