@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600&display=swap');

:root {
    color-scheme: light;
    /* Brand — primary blue: headers & brand accents */
    --blue: #004080;
    --blue-mid: #1e5a96;
    --blue-pale: #e8f1fb;
    /* Action buttons */
    --action: #0073e6;
    --action-dark: #0056b3;
    /* Accents */
    --accent: #0073e6;
    --danger: #d5745a;
    /* Body text & surfaces */
    --ink: #333333;
    --muted: #5f6b77;
    --paper: #f8f9fa;
    --white: #ffffff;
    --line: #e3e7ec;
    font-family: 'DM Sans', 'Trebuchet MS', sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background-color: var(--paper); background-image: repeating-linear-gradient(135deg, rgba(0, 64, 128, .035) 0, rgba(0, 64, 128, .035) 1px, transparent 1px, transparent 11px); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
.app-shell { min-height: 100vh; }
.topbar { min-height: 76px; padding: 0 clamp(20px, 5vw, 76px); display: flex; align-items: center; gap: 42px; background: var(--blue); color: #fff; border-bottom: 1px solid var(--blue-mid); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; white-space: nowrap; }
.wordmark-logo { width: 40px; height: 40px; display: inline-block; object-fit: contain; border-radius: 50%; }
.topnav { display: flex; align-items: center; gap: 28px; height: 76px; flex: 1; }
.topnav a { height: 100%; display: inline-flex; align-items: center; color: var(--muted); font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; }
.topnav a:hover, .topnav a.active { color: var(--blue-mid); border-color: var(--accent); }
.account-menu { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.account-menu form { margin: 0; }
.account-email { font-size: 12px; color: var(--muted); }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 17px; border: 1px solid transparent; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 700; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--action); color: white; }
.button-primary:hover { background: var(--action-dark); }
.button-quiet { min-height: 34px; padding: 0 10px; background: transparent; color: var(--muted); }
.button-quiet:hover { background: var(--blue-pale); color: var(--blue-mid); }
.button-outline { background: transparent; border-color: var(--line); color: var(--blue-mid); }
.button-outline:hover { border-color: var(--blue); background: white; }
.button-wide { width: 100%; margin-top: 8px; min-height: 48px; }
.page-content { width: min(1160px, calc(100% - 48px)); margin: 0 auto; padding: 58px 0 84px; }
.welcome-row, .page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.welcome-row h1, .page-heading h1, .signed-out h1 { margin: 8px 0 10px; font-family: 'Playfair Display', Georgia, serif; font-size: clamp(32px, 4vw, 46px); font-weight: 500; line-height: 1.13; }
.welcome-row .muted, .page-heading .muted { margin: 0; }
.welcome-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.eyebrow { margin: 0; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: 1.2px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.7; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 36px; }
.stat-block { position: relative; min-height: 132px; padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); overflow: hidden; }
.stat-block::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue); }
.stat-block span, .stat-block small { color: var(--muted); font-size: 11px; }
.stat-block span { font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.stat-block strong { font-family: 'Playfair Display', Georgia, serif; font-size: 35px; line-height: 1.2; font-weight: 500; color: var(--blue); }
.stat-block .role-value { font-size: 25px; }
.workspace-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 24px; }
.feature-panel { min-height: 300px; padding: 30px 34px; background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%); color: white; position: relative; overflow: hidden; border-radius: 12px; }
.feature-panel::after { content: ''; position: absolute; right: -45px; bottom: -70px; width: 210px; height: 210px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 0 24px rgba(255,255,255,.035), 0 0 0 48px rgba(255,255,255,.025); }
.panel-kicker { display: flex; justify-content: space-between; color: #cfe0f7; font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.panel-kicker span { color: #a9cff6; }
.feature-panel h2 { margin: 38px 0 12px; font-family: 'Playfair Display', Georgia, serif; font-size: 30px; font-weight: 500; line-height: 1.2; }
.feature-panel p { max-width: 360px; color: #cfe0f7; font-size: 12px; line-height: 1.7; }
.text-link { display: inline-flex; align-items: center; gap: 10px; color: var(--blue); font-size: 12px; font-weight: 700; }
.feature-panel .text-link { margin-top: 8px; color: white; position: relative; z-index: 1; }
.activity-panel, .admin-section, .report-section { padding: 25px 27px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.panel-heading, .section-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.panel-heading h2, .section-title h2 { margin: 5px 0 0; font-family: 'Playfair Display', Georgia, serif; font-size: 23px; font-weight: 500; }
.activity-list { margin: 21px 0 0; padding: 0; list-style: none; }
.activity-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid #eceff3; }
.activity-dot { flex: 0 0 8px; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--accent); }
.activity-list strong { display: block; font-size: 12px; }
.activity-list small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.empty-state { padding: 18px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.signed-out { padding-top: 15vh; }
.signed-out h1 { margin: 16px 0; font-size: 56px; }
.signed-out .button { margin-top: 18px; }
.narrow-content { max-width: 780px; }
.back-link { display: inline-block; margin-bottom: 30px; color: var(--muted); font-size: 12px; }
.back-link:hover { color: var(--blue); }
.page-heading { align-items: center; }
.page-heading h1 { margin-bottom: 8px; }
.survey-form { margin-top: 34px; }
.question-field { min-width: 0; margin: 0 0 18px; padding: 23px 26px 25px; border: 1px solid var(--line); background: var(--white); }
.question-field legend { width: 100%; padding: 0; display: flex; gap: 16px; align-items: flex-start; font-family: 'Playfair Display', Georgia, serif; font-size: 20px; line-height: 1.4; }
.question-index { flex: 0 0 27px; color: var(--accent); font-family: 'DM Sans', 'Trebuchet MS', sans-serif; font-size: 11px; font-weight: 700; padding-top: 5px; }
textarea, input, select { width: 100%; border: 1px solid #d4d9e0; border-radius: 3px; background: #fff; color: var(--ink); outline: none; }
textarea:focus, input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 64, 128, .12); }
.question-field textarea { display: block; margin: 17px 0 0 43px; width: calc(100% - 43px); min-height: 94px; padding: 12px 14px; resize: vertical; font-size: 12px; line-height: 1.6; }
textarea::placeholder, input::placeholder { color: #9aa3ae; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 8px; }
.form-actions .muted { font-size: 11px; }
.notice { margin: 14px 0; padding: 12px 14px; border-left: 3px solid; font-size: 12px; }
.notice-success { border-color: var(--blue); background: var(--blue-pale); color: var(--blue-mid); }
.notice-error { border-color: var(--danger); background: #f8eae5; color: #823f2f; }
.admin-heading { margin-bottom: 28px; }
.admin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.admin-section { padding: 22px; }
.count-badge { padding: 6px 9px; border-radius: 3px; color: var(--blue-mid); background: var(--blue-pale); font-size: 10px; font-weight: 700; white-space: nowrap; }
.inline-create { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0 22px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.inline-create label, .question-create label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.inline-create input, .inline-create select { height: 38px; padding: 0 10px; font-size: 11px; }
.inline-create .button { align-self: end; min-height: 38px; }
.question-create { display: grid; gap: 9px; margin: 20px 0; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.question-create textarea { min-height: 74px; padding: 10px; font-size: 11px; resize: vertical; }
.question-create .button { justify-self: start; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 11px; }
th { padding: 10px 8px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; border-bottom: 1px solid var(--line); }
td { padding: 11px 8px; border-bottom: 1px solid #eceff3; vertical-align: top; line-height: 1.5; }
tbody tr:last-child td { border-bottom: 0; }
.role-tag { color: var(--blue-mid); font-size: 9px; font-weight: 700; }
.question-list { margin: 0; padding: 0; list-style: none; }
.question-list li { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eceff3; font-size: 11px; line-height: 1.6; }
.question-list li:last-child { border-bottom: 0; }
.report-section { margin-top: 22px; }
.report-intro { margin: 12px 0 18px; }
.report-section .table-wrap { margin-top: 17px; }
.table-empty { padding: 18px 8px; color: var(--muted); }
.login-page { background: #f8f9fa; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, .9fr) 1.1fr; }
.login-brand { display: flex; flex-direction: column; justify-content: space-between; padding: 38px clamp(28px, 6vw, 82px); color: white; background-color: var(--blue); background-image: repeating-linear-gradient(145deg, rgba(255,255,255,.045) 0, rgba(255,255,255,.045) 1px, transparent 1px, transparent 13px); }
.login-brand .wordmark { align-self: flex-start; }
.login-brand .wordmark-logo { width: 48px; height: 48px; padding: 4px; background: var(--white); }
.brand-copy { max-width: 460px; padding: 40px 0; }
.brand-copy .eyebrow { color: #a9cff6; }
.brand-copy h1 { margin: 18px 0; font-family: 'Playfair Display', Georgia, serif; font-size: clamp(37px, 5vw, 58px); font-weight: 500; line-height: 1.12; }
.brand-copy > p:last-child { max-width: 350px; color: #cfe0f7; font-size: 13px; line-height: 1.7; }
.brand-foot { color: #b9cfec; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.brand-foot span { padding: 0 7px; color: #a9cff6; }
.login-panel { display: grid; place-items: center; padding: 42px 24px; background: var(--white); }
.login-form-wrap { width: min(390px, 100%); }
.login-form-wrap h2 { margin: 9px 0 6px; font-family: 'Playfair Display', Georgia, serif; font-size: 32px; font-weight: 500; }
.login-form-wrap > .muted { margin: 0 0 26px; }
.stack-form { display: grid; gap: 9px; }
.stack-form label { margin-top: 7px; color: var(--ink); font-size: 11px; font-weight: 700; }
.stack-form input { height: 46px; padding: 0 12px; font-size: 12px; }
.login-note { margin-top: 23px; color: var(--muted); font-size: 10px; text-align: center; }

@media (max-width: 800px) {
    .topbar { min-height: 66px; gap: 18px; padding: 0 20px; flex-wrap: wrap; }
    .topnav { order: 3; width: 100%; height: 42px; gap: 22px; overflow-x: auto; }
    .topnav a { white-space: nowrap; }
    .account-menu { margin-left: auto; }
    .account-email { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
    .page-content { width: min(100% - 36px, 680px); padding-top: 38px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .workspace-grid, .admin-columns { grid-template-columns: 1fr; }
    .login-layout { grid-template-columns: 1fr; }
    .login-brand { min-height: 280px; padding: 26px 28px; }
    .brand-copy { padding: 30px 0 20px; }
    .brand-copy h1 { font-size: 40px; }
    .brand-foot { display: none; }
    .login-panel { min-height: 460px; }
}

@media (max-width: 520px) {
    .topbar { padding: 0 16px; gap: 12px; }
    .wordmark { font-size: 16px; }
    .wordmark-logo { width: 33px; height: 33px; }
    .account-menu { gap: 3px; }
    .account-email { display: none; }
    .page-content { width: calc(100% - 32px); padding-top: 30px; }
    .welcome-row, .page-heading { align-items: flex-start; flex-direction: column; }
    .welcome-row .button, .admin-heading .button { align-self: stretch; }
    .welcome-row h1, .page-heading h1 { font-size: 35px; }
    .stat-block { min-height: 112px; padding: 18px 15px; }
    .stat-block strong { font-size: 30px; }
    .feature-panel { min-height: 285px; padding: 25px; }
    .activity-panel, .admin-section, .report-section { padding: 19px 16px; }
    .question-field { padding: 18px 15px; }
    .question-field legend { gap: 9px; font-size: 18px; }
    .question-field textarea { margin-left: 36px; width: calc(100% - 36px); }
    .form-actions { align-items: stretch; flex-direction: column; }
    .form-actions .button { width: 100%; }
    .inline-create { grid-template-columns: 1fr; }
    .inline-create .button { width: 100%; }
    .signed-out h1 { font-size: 46px; }
}

.workspace-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 76px); transition: grid-template-columns .3s ease; }
.sidebar { position: sticky; top: 0; align-self: start; min-width: 0; min-height: calc(100vh - 76px); padding: 34px 14px 20px; display: flex; flex-direction: column; background: var(--blue); border-right: 1px solid var(--blue-mid); overflow: hidden; transition: opacity .18s ease, padding .3s ease, border-color .3s ease, visibility 0s linear 0s; }
/* Closed side navigation — the main content slides over as the grid column collapses */
html.nav-collapsed .workspace-layout { grid-template-columns: 0 minmax(0, 1fr); }
html.nav-collapsed .sidebar { padding-left: 0; padding-right: 0; border-right-color: transparent; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s ease, padding .3s ease, border-color .3s ease, visibility 0s linear .3s; }
.nav-toggle { width: 44px; height: 44px; display: inline-grid; place-items: center; flex-shrink: 0; padding: 0; background: transparent; border: 1px solid var(--line); border-radius: 8px; color: var(--blue); cursor: pointer; transition: background .16s ease, border-color .16s ease; }
.nav-toggle:hover { background: var(--blue-pale); border-color: var(--blue-mid); }
.nav-toggle-bars { position: relative; display: block; width: 18px; height: 2px; background: transparent; border-radius: 2px; transition: background .2s ease; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ''; position: absolute; left: 0; top: 0; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s ease; }
.nav-toggle-bars::before { transform: translateY(-6px) rotate(45deg); }
.nav-toggle-bars::after { transform: translateY(6px) rotate(-45deg); }
html.nav-collapsed .nav-toggle-bars { background: currentColor; }
html.nav-collapsed .nav-toggle-bars::before { transform: translateY(-6px); }
html.nav-collapsed .nav-toggle-bars::after { transform: translateY(6px); }
/* Topbar sits on brand blue — keep its controls legible */
.topbar .account-email { color: #cfe0f7; }
.topbar .button-quiet { color: #cfe0f7; }
.topbar .button-quiet:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.topbar .nav-toggle { color: #fff; border-color: rgba(255, 255, 255, .45); }
.topbar .nav-toggle:hover { background: rgba(255, 255, 255, .14); border-color: #fff; }
.sidebar-label { margin: 0 14px 14px; color: rgba(255, 255, 255, .55); font-size: 9px; font-weight: 700; letter-spacing: 1.1px; }
.side-nav { display: grid; gap: 4px; }
.side-link { min-height: 44px; padding: 0 13px; display: flex; align-items: center; gap: 12px; border-left: 2px solid transparent; color: #cfe0f7; font-size: 14px; font-weight: 600; transition: color .15s ease, background .15s ease, border-color .15s ease; }
.side-link:hover { color: #fff; background: rgba(255, 255, 255, .10); }
.side-link.active { color: #fff; background: var(--blue-mid); border-left-color: var(--blue-pale); }
.nav-mark { min-width: 24px; color: rgba(255, 255, 255, .5); font-size: 13px; font-weight: 700; }
.side-link.active .nav-mark { color: var(--blue-pale); }
.sidebar-footer { margin: auto 12px 8px; padding-top: 20px; display: flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .55); font-size: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #e8f1fb; box-shadow: 0 0 0 3px rgba(255, 255, 255, .16); }
.page-content.workspace-main { width: auto; max-width: none; min-width: 0; margin: 0; padding: 52px clamp(24px, 4vw, 60px) 78px; }
.page-content.workspace-main.narrow-content { max-width: 900px; }

@media (max-width: 800px) {
    .workspace-layout { grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - 108px); }
    .sidebar { position: static; min-height: auto; padding: 10px 18px 0; border-right: 0; border-bottom: 1px solid var(--blue-mid); overflow: hidden; }
    html.nav-collapsed .workspace-layout { grid-template-columns: minmax(0, 1fr); }
    html.nav-collapsed .sidebar { display: none; }
    .sidebar-label, .sidebar-footer { display: none; }
    .side-nav { display: flex; gap: 4px; width: 100%; overflow-x: auto; scrollbar-width: thin; }
    .side-link { flex: 0 0 auto; min-height: 42px; padding: 0 11px; border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
    .side-link.active { border-bottom-color: var(--blue-pale); }
    .page-content.workspace-main { width: min(100% - 36px, 680px); margin: 0 auto; padding: 38px 0 64px; }
    .page-content.workspace-main.narrow-content { max-width: 680px; }
}

@media (max-width: 520px) {
    .sidebar { padding: 7px 10px 0; }
    .nav-toggle { width: 38px; height: 38px; }
    .side-link { min-height: 39px; padding: 0 9px; font-size: 13px; }
    .nav-mark { min-width: 20px; }
    .page-content.workspace-main { width: calc(100% - 32px); padding-top: 30px; }
}

.survey-catalog { display: grid; gap: 12px; }
.survey-entry { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 22px 24px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.survey-entry-index { color: var(--accent); font-family: 'Playfair Display', Georgia, serif; font-size: 24px; }
.survey-entry-copy h2 { margin: 4px 0; font-family: 'Playfair Display', Georgia, serif; font-size: 21px; font-weight: 500; }
.survey-entry-copy p.muted { margin: 0; }
.respondent-field { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: baseline; margin-bottom: 18px; padding: 19px 22px; background: var(--blue-pale); color: var(--ink); font-size: 12px; font-weight: 700; }
.respondent-field .muted { justify-self: end; font-size: 10px; }
.respondent-field input { grid-column: 1 / -1; height: 42px; padding: 0 12px; font-size: 12px; font-weight: 400; }
.question-type-label { display: block; margin: 10px 0 0 43px; color: #8a93a0; font-size: 9px; font-weight: 700; letter-spacing: .7px; }
.question-field > input:not([type=radio]):not([type=checkbox]), .question-field > select { display: block; width: calc(100% - 43px); height: 44px; margin: 8px 0 0 43px; padding: 0 12px; font-size: 12px; }
.question-field > textarea { margin-top: 8px; }
.choice-list { display: grid; gap: 7px; margin: 12px 0 0 43px; }
.choice-list label { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 7px 10px; background: #f6f8f5; color: var(--ink); font-size: 12px; cursor: pointer; }
.choice-list input { width: 15px; height: 15px; accent-color: var(--blue); }
.survey-builder { display: grid; gap: 16px; }
.survey-create-section { margin-bottom: 4px; }
.survey-create-form { display: grid; grid-template-columns: 1fr 1.3fr auto; align-items: end; gap: 12px; margin-top: 18px; }
.survey-create-form label, .typed-question-form label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.survey-create-form input, .survey-create-form textarea, .typed-question-form input, .typed-question-form select, .typed-question-form textarea { min-height: 40px; padding: 9px 11px; font-size: 11px; font-weight: 400; }
.survey-create-form textarea, .typed-question-form textarea { resize: vertical; }
.builder-subheading { margin: 5px 0 -5px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.survey-definition { padding: 22px 24px; background: rgba(255,255,255,.84); border: 1px solid var(--line); }
.survey-definition h3 { margin: 5px 0; font-family: 'Playfair Display', Georgia, serif; font-size: 20px; font-weight: 500; }
.survey-definition .section-title .muted { margin: 5px 0 0; }
.typed-question-form { grid-template-columns: minmax(180px, 1.4fr) minmax(150px, .8fr); align-items: end; margin: 18px 0 10px; padding: 17px; background: #f8f9fa; border: 1px solid var(--line); }
.typed-question-form .option-input { grid-column: 1 / -1; }
.typed-question-form .option-input .muted { font-weight: 400; }
.typed-question-form .button { justify-self: start; }
.question-summary { display: grid; gap: 4px; }
.question-summary strong { font-size: 11px; font-weight: 600; }
.question-summary small { color: var(--muted); font-size: 9px; }
.question-summary .option-summary { color: var(--blue); }
.answer-detail-list { min-width: 230px; margin: 10px 0 2px; font-size: 10px; }
.answer-detail-list div { padding: 7px 0; border-top: 1px solid var(--line); }
.answer-detail-list dt { color: var(--muted); font-weight: 700; }
.answer-detail-list dd { margin: 3px 0 0; white-space: pre-wrap; }
details summary { color: var(--blue); cursor: pointer; font-weight: 700; }

@media (max-width: 800px) {
    .survey-create-form { grid-template-columns: 1fr 1fr; }
    .survey-create-form .button { justify-self: start; }
}

@media (max-width: 520px) {
    .survey-entry { grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 18px 15px; }
    .survey-entry .button { grid-column: 1 / -1; width: 100%; }
    .survey-create-form, .typed-question-form { grid-template-columns: 1fr; }
    .typed-question-form .option-input { grid-column: auto; }
    .survey-definition { padding: 18px 15px; }
    .respondent-field { grid-template-columns: 1fr; }
    .respondent-field .muted { justify-self: start; }
    .question-type-label, .choice-list { margin-left: 36px; }
    .question-field > input:not([type=radio]):not([type=checkbox]), .question-field > select { width: calc(100% - 36px); margin-left: 36px; }
}

/* Survey dialog */
.survey-dialog { width: min(720px, 95vw); max-height: 90vh; padding: 0; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.18); overflow: hidden; }
.survey-dialog::backdrop { background: rgba(0,0,0,.45); }
.survey-dialog-form { display: flex; flex-direction: column; max-height: 90vh; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; padding: 28px 32px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.dialog-heading h2 { margin: 6px 0 0; font-family: 'Playfair Display', Georgia, serif; font-size: 24px; font-weight: 500; }
.icon-close { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: transparent; cursor: pointer; font-size: 18px; color: var(--muted); flex-shrink: 0; }
.icon-close:hover { background: var(--blue-pale); color: var(--blue-mid); }
.survey-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 24px 32px 0; flex-shrink: 0; }
.survey-fields .description-field { grid-column: 1 / -1; }
.survey-fields label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.survey-fields input, .survey-fields select, .survey-fields textarea { min-height: 40px; padding: 9px 11px; font-size: 12px; }
.survey-fields textarea { resize: vertical; min-height: 64px; }
.dialog-questions-heading { display: flex; justify-content: space-between; align-items: center; padding: 20px 32px 12px; flex-shrink: 0; }
.dialog-questions-heading h3 { margin: 0; font-size: 14px; font-weight: 700; }
.dialog-question-list { flex: 1; overflow-y: auto; padding: 0 32px 8px; display: grid; gap: 12px; }
.dialog-question { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; background: #f8f9fa; border: 1px solid var(--line); border-radius: 6px; }
.dialog-question label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.dialog-question input, .dialog-question select { min-height: 38px; padding: 8px 10px; font-size: 11px; }
.dialog-question .choice-options { grid-column: 1 / -1; }
.choice-option-input { min-height: 34px; margin-top: 6px; padding: 6px 10px; font-size: 11px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 32px 24px; border-top: 1px solid var(--line); flex-shrink: 0; }

/* Actions dropdown */
.actions-dropdown { position: relative; display: inline-block; }
.actions-toggle { min-width: 100px; }
.actions-menu { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.1); min-width: 120px; z-index: 100; }
.actions-item { display: block; padding: 8px 16px; font-size: .875rem; color: #333333; text-decoration: none; white-space: nowrap; }
/* ============================================================
   Readability refresh — larger base type scale across the app
   ============================================================ */
:root { font-size: 16px; }
body { font-size: 16px; line-height: 1.55; }
.muted { font-size: 15px; line-height: 1.65; }
.eyebrow { font-size: 12px; letter-spacing: 1.3px; }
.account-email { font-size: 14px; }
.nav-mark { font-size: 13px; }
.sidebar-label { font-size: 11px; letter-spacing: 1.3px; }
.sidebar-footer { font-size: 13px; }
.button { min-height: 44px; padding: 0 20px; font-size: 14px; border-radius: 6px; }
.button-quiet { min-height: 36px; padding: 0 12px; font-size: 13px; }
.count-badge { font-size: 13px; padding: 7px 12px; border-radius: 4px; }
.role-tag { font-size: 12px; }
.question-index { font-size: 13px; flex-basis: 30px; }
.question-type-label { font-size: 12px; letter-spacing: .6px; }
.activity-list strong { font-size: 14px; }
.activity-list small { font-size: 12px; }
.text-link { font-size: 14px; }
.empty-state { font-size: 14px; }
.back-link { font-size: 14px; }
.question-field { padding: 26px 30px 28px; margin-bottom: 22px; }
.question-field legend { font-size: 22px; }
.question-field textarea { font-size: 14px; }
.question-field > input:not([type=radio]):not([type=checkbox]), .question-field > select { height: 46px; font-size: 14px; }
.choice-list { gap: 9px; }
.choice-list label { min-height: 42px; padding: 9px 12px; font-size: 14px; }
.form-actions .muted { font-size: 13px; }
.notice { font-size: 14px; padding: 14px 16px; }
.stat-block span, .stat-block small { font-size: 13px; }
.feature-panel p { font-size: 14px; }
.panel-kicker { font-size: 12px; }
.login-form-wrap > .muted { font-size: 15px; }
.stack-form label { font-size: 13px; }
.stack-form input { font-size: 14px; }
.login-note { font-size: 12px; }
.brand-copy > p:last-child { font-size: 15px; }
.brand-foot { font-size: 11px; }
.inline-create label, .question-create label { font-size: 13px; gap: 8px; }
.inline-create input, .inline-create select, .question-create textarea { font-size: 14px; }
.question-create textarea { font-size: 13px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13.5px; }
th { padding: 13px 12px; font-size: 12px; letter-spacing: .6px; }
td { padding: 13px 12px; line-height: 1.55; }
.question-list li { font-size: 13px; }
.question-summary strong { font-size: 13px; }
.question-summary small { font-size: 11px; }
.answer-detail-list { font-size: 12px; }
details summary { font-size: 13px; }
.actions-item { font-size: 14px; }
.actions-menu { min-width: 160px; }
.actions-toggle { min-width: 112px; }
.survey-entry-copy p.muted { font-size: 14px; }
.respondent-field { font-size: 14px; }
.respondent-field input { font-size: 14px; }
.survey-create-form label, .typed-question-form label, .survey-fields label, .dialog-question label { font-size: 12.5px; gap: 8px; }
.survey-create-form input, .survey-create-form textarea, .typed-question-form input,
.typed-question-form select, .typed-question-form textarea,
.survey-fields input, .survey-fields select, .survey-fields textarea { min-height: 44px; font-size: 14px; }
.dialog-question input, .dialog-question select { min-height: 42px; font-size: 13.5px; }
.choice-option-input { min-height: 38px; font-size: 13.5px; }
.builder-subheading { font-size: 12px; }
.section-intro { margin: 10px 0 18px; }

.actions-item:hover { background: #f8f9fa; }

/* Section intro, search and sub-site management */
.table-search { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 18px 0 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.table-search label { display: flex; flex-direction: column; gap: 7px; min-width: 260px; flex: 1; color: var(--muted); font-size: 13px; font-weight: 700; }
.table-search input { height: 42px; padding: 0 12px; font-size: 14px; font-weight: 400; }
.subsite-section { margin: 8px 0 26px; padding: 22px 24px 24px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.subsite-section .section-title h3 { margin: 4px 0 0; font-family: 'Playfair Display', Georgia, serif; font-size: 21px; font-weight: 500; }
.subsite-create { display: grid; grid-template-columns: 1fr 1.4fr auto; align-items: end; gap: 12px; margin: 16px 0 20px; }
.subsite-create label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.subsite-create input, .subsite-create select { height: 42px; padding: 0 12px; font-size: 14px; font-weight: 400; }
.subsite-group { margin-top: 16px; }
.subsite-group-label { margin: 0 0 8px; color: var(--blue-mid); font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.subsite-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.subsite-empty { margin: 0; }
.subsite-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.subsite-card-copy { display: grid; gap: 2px; }
.subsite-card-copy strong { font-size: 14px; }
.subsite-card-copy small { color: var(--muted); font-size: 12px; }
.subsite-remove .button { min-height: 30px; font-size: 12px; }
.row-subsite { display: flex; align-items: center; gap: 8px; }
.row-subsite select { min-width: 150px; height: 36px; font-size: 13px; font-weight: 400; }
.row-subsite .button { min-height: 36px; }

/* Pagination */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.pager-summary { margin: 0; color: var(--muted); font-size: 13px; }
.pager-summary strong { color: var(--blue-mid); }
.pager-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--blue-mid); font-size: 13px; font-weight: 600; }
.page-link:hover { border-color: var(--blue); background: var(--blue-pale); }
.page-link.current { border-color: var(--blue); background: var(--blue); color: #fff; }
.page-link.disabled { pointer-events: none; color: #aab2bd; background: #f3f5f8; }
.pager-size { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.pager-size label { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.pager-size label.current { border-color: var(--blue); background: var(--blue-pale); color: var(--blue-mid); }
.pager-size input { position: absolute; opacity: 0; pointer-events: none; }

/* Small screens: stack the pager so the summary, page links and page-size
   control stay readable instead of fighting for one crowded row. */
@media (max-width: 800px) {
    .pager { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 12px; }
    .pager-summary { text-align: center; }
    .pager-links { width: 100%; justify-content: center; }
    .pager-size { align-self: center; }
}
@media (max-width: 520px) {
    .pager-size label { min-width: 44px; justify-content: center; }
}

/* Interview context banner */
.interview-context { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 14px 28px; margin: 6px 0 26px; padding: 18px 24px; background: var(--blue-pale); border: 1px solid #ccdef5; border-radius: 8px; }
.interview-context > div { display: grid; gap: 2px; }
.interview-context span { color: var(--muted); font-size: 12.5px; }
.interview-context strong { color: var(--blue-mid); font-size: 17px; }
.interview-context .interview-context-note { justify-self: end; max-width: 320px; text-align: right; }

/* Responsive tweaks for the refresh */
@media (max-width: 800px) {
    .subsite-create { grid-template-columns: 1fr; }
    .interview-context { grid-template-columns: 1fr; }
    .interview-context .interview-context-note { justify-self: start; text-align: left; }
}
@media (max-width: 520px) {
    .table-search label { min-width: 100%; }
    .row-subsite { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   Create-a-survey dialog (Form Design) — larger, centered, taller
   ============================================================ */
.survey-dialog {
    width: min(1100px, 94vw);
    height: min(92vh, 1000px);
    max-width: 94vw;
    max-height: 92vh;
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 30px 90px rgba(0,0,0,.28);
    overflow: hidden;
    background: #fff;
}
.survey-dialog::backdrop { background: rgba(15, 32, 27, .55); }
.survey-dialog-form { display: flex; flex-direction: column; height: 100%; max-height: 92vh; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 28px 34px 22px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.dialog-heading > div { text-align: left; }
.dialog-heading .eyebrow { text-align: left; }
.dialog-heading h2 { margin: 6px 0 6px; font-family: 'Playfair Display', Georgia, serif; font-size: 30px; font-weight: 500; line-height: 1.15; }
.dialog-heading .muted { margin: 0; font-size: 14px; }
.icon-close { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; font-size: 22px; line-height: 1; color: var(--muted); flex-shrink: 0; }
.icon-close:hover { background: var(--blue-pale); color: var(--blue-mid); }
.dialog-body { flex: 1 1 auto; overflow-y: auto; padding: 24px 34px 8px; }
.survey-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.survey-fields .description-field { grid-column: 1 / -1; }
.survey-fields label { display: grid; gap: 8px; color: var(--blue-mid); font-size: 13.5px; font-weight: 700; text-align: left; }
.survey-fields .field-hint { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.survey-fields input, .survey-fields select, .survey-fields textarea { min-height: 48px; padding: 11px 14px; font-size: 15px; border-radius: 6px; }
.survey-fields textarea { resize: vertical; min-height: 82px; line-height: 1.5; }
.dialog-questions-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 28px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.dialog-questions-heading h3 { margin: 0; font-family: 'Playfair Display', Georgia, serif; font-size: 21px; font-weight: 500; }
.dialog-questions-heading .muted { font-size: 13px; }
.dialog-question-list { display: grid; gap: 16px; }
.dialog-question { display: grid; gap: 14px; padding: 20px 22px 22px; background: #f8f9fa; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; }
.dialog-question-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-question-index { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 26px; padding: 0 8px; border-radius: 4px; background: var(--blue-pale); color: var(--blue-mid); font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.remove-question { color: var(--danger); }
.remove-question:hover { background: #f8eae5; color: #823f2f; }
.dialog-question-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.dialog-question-grid label { display: grid; gap: 8px; color: var(--blue-mid); font-size: 13.5px; font-weight: 700; text-align: left; }
.dialog-question input, .dialog-question select { min-height: 46px; padding: 10px 13px; font-size: 15px; border-radius: 6px; }
.choice-options { display: grid; gap: 10px; }
.choice-options[hidden] { display: none; }
.choice-options > .muted { font-size: 13px; }
.choice-option-list { display: grid; gap: 8px; }
.choice-option-input { min-height: 42px; padding: 9px 13px; font-size: 14.5px; border-radius: 6px; }
.add-question-bar { width: 100%; margin: 20px 0 24px; min-height: 54px; border-style: dashed; font-size: 15px; }
.add-question-bar:hover { border-color: var(--blue); border-style: solid; background: var(--blue-pale); }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 20px 34px 26px; border-top: 1px solid var(--line); background: #fbfcfa; flex-shrink: 0; }
.dialog-actions .button { min-height: 48px; padding: 0 26px; font-size: 15px; }

@media (max-width: 700px) {
    .survey-dialog { width: 96vw; height: 96vh; max-height: 96vh; border-radius: 10px; }
    .dialog-heading, .dialog-body, .dialog-actions { padding-left: 20px; padding-right: 20px; }
    .survey-fields, .dialog-question-grid { grid-template-columns: 1fr; }
    .dialog-actions { flex-direction: column-reverse; }
    .dialog-actions .button { width: 100%; }
}


/* ============================================================
   Survey edit page + full-page preview
   ============================================================ */
.preview-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0 0 24px; padding: 16px 22px; background: #fff7ed; border: 1px solid #f3d9b5; border-left: 4px solid var(--danger); border-radius: 8px; }
.preview-banner strong { color: #8a4b26; font-size: 15px; text-transform: uppercase; letter-spacing: .6px; }
.preview-banner span { flex: 1; min-width: 220px; color: #6f5a44; font-size: 14.5px; }
.preview-banner .button { min-height: 40px; }
.survey-details-form, .edit-question-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.survey-details-form label, .edit-question-form label { display: grid; gap: 8px; color: var(--blue-mid); font-size: 13.5px; font-weight: 700; text-align: left; }
.survey-details-form .description-field, .edit-question-form .description-field,
.survey-details-form .form-row-actions, .edit-question-form .form-row-actions { grid-column: 1 / -1; }
.survey-details-form input, .survey-details-form select, .survey-details-form textarea,
.edit-question-form input, .edit-question-form select, .edit-question-form textarea { min-height: 46px; padding: 10px 13px; font-size: 15px; font-weight: 400; border-radius: 6px; }
.survey-details-form textarea, .edit-question-form textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.form-row-actions { display: flex; justify-content: flex-end; }
.edit-question-list { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.edit-question-card { padding: 18px 20px 20px; background: #f8f9fa; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; }
.edit-question-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.question-type-pill { padding: 5px 11px; border-radius: 999px; background: var(--blue-pale); color: var(--blue-mid); font-size: 12px; font-weight: 700; }
.edit-question-tools { display: flex; gap: 6px; margin-left: auto; }
.edit-question-tools form { margin: 0; }
.edit-question-tools .button { min-height: 34px; padding: 0 12px; font-size: 14px; }
.edit-question-tools .button.danger { color: var(--danger); }
.edit-question-tools .button.danger:hover { background: #f8eae5; color: #823f2f; }
.edit-question-tools .button[disabled] { pointer-events: none; color: #aab2bd; }
.add-question-panel { margin-top: 26px; padding: 22px 24px 24px; background: rgba(255,255,255,.75); border: 1px dashed var(--line); border-radius: 10px; }
.add-question-panel .section-title h3 { margin: 4px 0 16px; font-family: 'Playfair Display', Georgia, serif; font-size: 21px; font-weight: 500; }
@media (max-width: 700px) {
    .survey-details-form, .edit-question-form { grid-template-columns: 1fr; }
    .preview-banner { flex-direction: column; align-items: flex-start; }
}


/* ============================================================
   Form polish — one-by-one option rows + sectioned dialog
   ============================================================ */
.choice-options { margin-top: 4px; padding: 14px 16px 16px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.choice-options[hidden] { display: none; }
.choice-options-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.choice-options-head .muted { font-size: 12.5px; }
.field-label-mini { color: var(--blue-mid); font-size: 11px; font-weight: 700; letter-spacing: 1px; }
.choice-option-list { display: grid; gap: 8px; }
.choice-option-row { display: grid; grid-template-columns: 30px 1fr 34px; align-items: center; gap: 8px; }
.option-order { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--blue-pale); color: var(--blue-mid); font-size: 12.5px; font-weight: 700; }
.choice-option-row input { height: 42px; padding: 0 12px; font-size: 14.5px; font-weight: 400; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.choice-option-row input:focus { border-color: var(--blue); outline: 2px solid rgba(0, 64, 128, .15); }
.option-remove { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #9aa3ae; font-size: 19px; line-height: 1; cursor: pointer; }
.option-remove:hover { background: #f8eae5; border-color: #f0d2c9; color: var(--danger); }
.add-choice { margin-top: 12px; min-height: 38px; font-size: 13.5px; }

/* Numbered sections inside the create dialog */
.dialog-section { padding: 22px 0 6px; }
.dialog-section + .dialog-section { border-top: 1px solid var(--line); margin-top: 10px; }
.dialog-section-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.dialog-section-head > div { flex: 1; }
.dialog-section-head h3 { margin: 2px 0 3px; font-size: 16.5px; font-weight: 700; }
.dialog-section-head .muted { font-size: 13px; line-height: 1.5; }
.dialog-section-head .count-badge { margin-left: auto; }
.section-step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 13.5px; font-weight: 700; flex-shrink: 0; }
.dialog-hint { flex: 1; min-width: 200px; text-align: left; font-size: 12.5px; }
.field-wide { grid-column: 1 / -1; }
.survey-fields .field-wide input { font-size: 16px; min-height: 50px; }


/* Edit-page question forms */
.edit-question-list { gap: 18px; }
.edit-question-card { padding: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.edit-question-head { display: flex; align-items: center; gap: 12px; margin: 0; padding: 13px 18px; background: #f8f9fa; border-bottom: 1px solid var(--line); }
.edit-question-tools { display: flex; gap: 6px; margin-left: auto; }
.edit-question-tools form { margin: 0; }
.edit-question-tools .button { min-height: 32px; min-width: 36px; padding: 0 10px; font-size: 14px; }
.edit-question-tools .button.danger { color: var(--danger); }
.edit-question-tools .button.danger:hover { background: #f8eae5; color: #823f2f; }
.edit-question-tools .button[disabled] { pointer-events: none; color: #c2cac5; }
.edit-question-form { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 18px 20px 18px; }
.edit-question-form .qf-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; }
.edit-question-form .qf-grid label { display: grid; gap: 8px; color: var(--blue-mid); font-size: 13.5px; font-weight: 700; text-align: left; }
.edit-question-form .qf-grid input, .edit-question-form .qf-grid select { height: 46px; min-height: 46px; padding: 0 13px; font-size: 15px; font-weight: 400; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.edit-question-form .qf-grid input:focus, .edit-question-form .qf-grid select:focus { border-color: var(--blue); outline: 2px solid rgba(0, 64, 128, .15); }
.qf-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.qf-foot .muted { font-size: 12.5px; }
.qf-foot .button { min-height: 42px; }
.add-question-panel { background: #fff; border: 1px dashed #ccd6e2; border-radius: 10px; }
.add-question-panel .section-title { padding: 16px 20px 0; margin-bottom: 0; }
.add-question-panel .edit-question-form { padding-top: 6px; }
.add-question-panel .section-title h3 { margin: 4px 0 0; }
@media (max-width: 700px) {
    .edit-question-form .qf-grid { grid-template-columns: 1fr; }
    .qf-foot { flex-direction: column; align-items: stretch; }
    .qf-foot .button { width: 100%; }
}


/* ============================================================
   Create dialog — authoritative overrides
   Resets properties leaked by the legacy dialog rules (lines
   ~269-289) that the redesign never unset: extra padding on the
   fields/list and the leftover two-column question grid.
   ============================================================ */
.survey-fields { padding: 0; flex-shrink: unset; grid-template-columns: 2fr 1fr; }
.dialog-question-list { padding: 0; flex: none; overflow: visible; }
.dialog-question { grid-template-columns: 1fr; }
.dialog-question .choice-options { grid-column: auto; }
.dialog-questions-heading { display: none; } /* legacy element, no longer rendered */
.add-question-panel { padding: 0; margin-top: 26px; }
.add-question-panel .section-title { margin-bottom: 0; }

@media (max-width: 900px) {
    .survey-fields { grid-template-columns: 1fr; }
}

/* Floating popup notifications (pop-up toasts) */
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 999; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border-left: 3px solid; background: var(--white); box-shadow: 0 12px 32px rgba(15, 30, 50, .18); border-radius: 3px; font-size: 13px; line-height: 1.5; opacity: 0; transform: translateY(-10px); transition: opacity .25s ease, transform .25s ease; }
.toast-visible { opacity: 1; transform: translateY(0); }
.toast-success { border-color: var(--blue); background: var(--blue-pale); color: var(--blue-mid); }
.toast-error { border-color: var(--danger); background: #f8eae5; color: #823f2f; }
.toast-info { border-color: var(--action); background: var(--blue-pale); color: var(--ink); }
.toast-message { flex: 1; }
.toast-close { flex-shrink: 0; border: 0; background: none; color: inherit; font-size: 18px; line-height: 1; padding: 0 2px; cursor: pointer; opacity: .65; }
.toast-close:hover { opacity: 1; }
@media (max-width: 640px) { .toast-stack { top: 12px; left: 12px; right: 12px; width: auto; } }

/* Friendly error page */
.error-code { margin: 4px 0 6px; font-size: 62px; font-weight: 700; letter-spacing: .04em; color: var(--blue); line-height: 1; }

