:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #d8dee9;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #b91c1c;
    --success: #047857;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: var(--primary); text-decoration: none; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 64px;
    padding: 0 28px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; color: var(--text); }
.topbar nav { display: flex; gap: 18px; flex-wrap: wrap; }
.container { width: min(1120px, calc(100% - 32px)); margin: 28px auto; }
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.stack { display: grid; gap: 16px; }
h1, h2, h3 { margin-top: 0; line-height: 1.25; }
.muted { color: var(--muted); }
label { display: grid; gap: 6px; font-weight: 650; }
input, textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
.checkrow { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.checkrow input { width: auto; }
.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}
.button.primary, button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.button.primary:hover, button.primary:hover { background: var(--primary-dark); }
.button.danger { color: var(--danger); border-color: #fecaca; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.alert { padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; background: #eef2ff; }
.alert.success { color: var(--success); background: #ecfdf5; border: 1px solid #a7f3d0; }
.alert.danger { color: var(--danger); background: #fef2f2; border: 1px solid #fecaca; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f9fafb; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #e5e7eb; font-size: 13px; }
.question { padding: 18px 0; border-top: 1px solid var(--line); }
.question:first-of-type { border-top: 0; }
.options { display: grid; gap: 10px; margin-top: 12px; }
.result-bar { height: 14px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.result-fill { height: 100%; background: var(--primary); }
@media (max-width: 640px) {
    .topbar { align-items: flex-start; flex-direction: column; padding: 16px; gap: 10px; }
    .container { width: min(100% - 20px, 1120px); margin-top: 18px; }
    .panel { padding: 18px; }
}

