:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #172033;
  --muted: #687385;
  --primary: #1b365d;
  --accent: #1f8a70;
  --danger: #b42318;
  --border: #d9dee8;
  --shadow: 0 18px 40px rgba(23, 32, 51, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.5; }
a { color: var(--primary); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px clamp(16px, 4vw, 48px); background: rgba(255, 255, 255, 0.94); border-bottom: 1px solid var(--border); }
.brand { color: var(--text); font-weight: 800; text-decoration: none; }
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.nav a, .link-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; text-decoration: none; }
.page { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 64px; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h1, h2 { margin: 0; line-height: 1.15; }
h1 { font-size: clamp(24px, 3.4vw, 38px); }
h2 { margin-bottom: 14px; font-size: 18px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.page-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 16px; font-weight: 700; }
.panel, .auth-panel, .response-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.panel { margin-bottom: 24px; padding: 20px; }
.auth-panel { width: min(460px, 100%); margin: 56px auto; padding: 28px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.metrics div { padding: 18px; background: var(--primary); color: #fff; border-radius: 8px; }
.metrics strong { display: block; font-size: 26px; }
.metrics span { color: rgba(255, 255, 255, 0.8); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.project-card { display: grid; gap: 16px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.project-card p, .muted { margin: 0; color: var(--muted); }
.mini-metrics { display: grid; gap: 8px; color: var(--muted); }
.mini-metrics strong { color: var(--text); }
.subnav { display: flex; flex-wrap: wrap; gap: 10px; margin: -8px 0 24px; }
.subnav a { padding: 9px 12px; background: #fff; border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-weight: 700; text-decoration: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-stack, .survey-form { display: grid; gap: 18px; }
.span-full { grid-column: 1 / -1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
label { display: grid; gap: 8px; font-weight: 700; }
input, textarea, select { width: 100%; min-height: 40px; padding: 9px 11px; background: #fff; border: 1px solid var(--border); border-radius: 6px; color: var(--text); font: inherit; }
textarea { resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; background: var(--primary); border: 0; border-radius: 6px; color: #fff; cursor: pointer; font: inherit; font-weight: 800; text-decoration: none; }
.secondary { background: var(--accent); }
.danger { background: var(--danger); }
button:disabled { cursor: not-allowed; opacity: 0.45; }
.checkbox-row, .choice-row { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.checkbox-row input, .choice-row input { width: auto; min-height: auto; }
.notice { margin-bottom: 16px; padding: 12px 14px; border-radius: 6px; font-weight: 700; }
.notice.success { background: #e8f7f1; color: #0f5f4a; }
.field-error { margin: 0 0 10px; padding: 8px 10px; border-radius: 6px; background: #fff0ef; color: var(--danger); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.question-editor-list { display: grid; gap: 10px; }
.question-row { position: relative; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.question-summary, .question-main, .question-actions { display: flex; align-items: center; gap: 10px; }
.question-summary { justify-content: space-between; }
.question-main { min-width: 0; }
.question-main strong { display: block; overflow-wrap: anywhere; }
.question-main p { margin: 2px 0 0; color: var(--muted); }
.question-number { display: grid; flex: 0 0 auto; place-items: center; width: 28px; height: 28px; background: #eef6ff; border: 1px solid #cfe2ff; border-radius: 999px; color: var(--primary); font-weight: 800; }
.question-actions { flex-wrap: wrap; justify-content: flex-end; }
.small-button { min-height: 32px; padding: 6px 10px; font-size: 13px; }
.question-edit-panel { display: none; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.question-edit-panel:target { display: block; }
.action-row { display: flex; gap: 10px; }
.delete-inline { margin-top: 10px; }
.survey-shell { width: min(760px, 100%); margin: 0 auto; }
.survey-header { margin-bottom: 18px; padding: 24px; background: var(--primary); border-radius: 8px; color: #fff; }
.survey-header p { max-width: 62ch; }
.survey-form { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.identity { padding: 12px 14px; background: #eef6ff; border: 1px solid #cfe2ff; border-radius: 6px; }
.question-block { margin: 0; padding: 0 0 18px; border: 0; border-bottom: 1px solid var(--border); }
.question-block legend { margin-bottom: 12px; font-weight: 800; }
.question-block legend span { color: var(--danger); }
.rating-row { display: flex; flex-wrap: wrap; gap: 10px; }
.rating-row label { display: block; }
.rating-row input { position: absolute; opacity: 0; }
.rating-row span { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.rating-row input:checked + span { background: var(--primary); color: #fff; }
.response-list { display: grid; gap: 16px; }
.response-card { padding: 16px; }
.response-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 14px; color: var(--muted); }
.answer-row { padding: 12px 0; border-top: 1px solid var(--border); }
.answer-row span { display: block; font-weight: 800; }
.answer-row p { margin: 4px 0 0; color: var(--muted); }
@media (max-width: 720px) {
  .topbar, .page-title, .question-summary, .response-head { align-items: flex-start; flex-direction: column; }
  .metrics, .project-grid, .form-grid { grid-template-columns: 1fr; }
  .question-actions { justify-content: flex-start; }
  .survey-header, .survey-form, .panel { padding: 20px; }
}
