:root {
    --ink: #19323c;
    --muted: #60747b;
    --teal: #0f91aa;
    --teal-dark: #087386;
    --paper: #f7faf8;
    --line: #d9e5e1;
    --white: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: "DM Sans", sans-serif;
    line-height: 1.5;
}

.site-header {
    background: var(--ink);
    border-bottom: 4px solid var(--teal);
}

.header-inner,
.page-shell,
.footer-inner {
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
}

.header-inner {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand { display: flex; align-items: center; height: 68px; }
.brand img { display: block; width: auto; height: 58px; }
.header-label { padding-left: 24px; color: #b8d4d6; border-left: 1px solid rgba(184, 212, 214, 0.45); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }

.page-shell { padding: 62px 0 86px; }
.intro { max-width: 920px; }
.eyebrow, .section-kicker { color: var(--teal-dark); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.eyebrow { margin: 0 0 18px; }
h1, h2 { font-family: "Space Grotesk", sans-serif; margin: 0; letter-spacing: 0; line-height: 1.08; }
h1 { max-width: 820px; font-size: clamp(2.1rem, 4vw, 3.45rem); }
.intro-copy { max-width: 820px; margin: 28px 0 0; color: var(--muted); font-size: 1.08rem; }

.form-section { margin-top: 72px; padding: 34px; background: var(--white); border: 1px solid var(--line); border-top: 5px solid var(--teal); box-shadow: 0 18px 45px rgba(25, 50, 60, 0.08); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-kicker { margin: 0 0 8px; }
h2 { font-size: clamp(1.55rem, 3vw, 2.25rem); }
.status-pill { flex: 0 0 auto; padding: 8px 12px; color: var(--teal-dark); background: #e6f4f2; border: 1px solid #c5e5e1; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }

#surveyContainer { width: 100%; border-top: 1px solid var(--line); padding-top: 24px; text-align: left; }
#surveyContainer .sd-root-modern, #surveyContainer .sd-container-modern { width: 100% !important; max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; text-align: left; }
#surveyContainer .sd-root-modern .sd-container-modern { padding-left: 0 !important; padding-right: 0 !important; }
#surveyContainer .sd-page, #surveyContainer .sd-body { text-align: left; }
#surveyContainer .sd-question--paneldynamic,
#surveyContainer .sd-paneldynamic,
#surveyContainer .sd-paneldynamic__panel,
#surveyContainer .sd-paneldynamic__panel-content,
#surveyContainer .sd-paneldynamic__content { width: 100% !important; max-width: none !important; }
#surveyContainer .sd-paneldynamic__panel { margin-left: 0 !important; margin-right: 0 !important; }
#surveyContainer .sd-paneldynamic__panel-content { padding-left: 0 !important; padding-right: 0 !important; }
.survey-error { color: #a4382d; font-weight: 600; }
.site-footer { background: #eaf1ef; border-top: 1px solid var(--line); }
.footer-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 0.85rem; }
.footer-inner a { color: var(--teal-dark); font-weight: 700; text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }

.attempts-page { padding: 56px 0 80px; }
.attempts-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.attempts-header h1 { max-width: 700px; font-size: clamp(2rem, 4vw, 3.2rem); }
.back-link { color: var(--teal-dark); font-weight: 700; text-decoration: none; }
.attempts-table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); box-shadow: 0 18px 45px rgba(25, 50, 60, 0.08); }
.attempts-table { width: 100%; border-collapse: collapse; text-align: left; }
.attempts-table th, .attempts-table td { padding: 16px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.attempts-table th { color: var(--muted); background: #eef5f2; font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; }
.attempts-table tr:last-child td { border-bottom: 0; }
.attempt-code { color: var(--teal-dark); font-weight: 700; white-space: nowrap; }
.attempt-status { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.attempt-status.pending { color: #8a5a00; background: #fff2cc; }
.attempt-status.finished { color: #176443; background: #dcf4e5; }
.attempt-action { display: inline-block; padding: 8px 12px; color: var(--white); background: var(--teal-dark); border-radius: 4px; font-size: 0.82rem; font-weight: 700; text-decoration: none; }
.attempt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.attempt-view-action { color: var(--teal-dark); background: #e3f1ef; }
.attempt-action-disabled { color: #87979a; background: #e9eeee; cursor: not-allowed; }
.attempts-empty, .attempts-error { padding: 24px; color: var(--muted); }
.step-examples { margin: 0 0 20px; padding: 14px 16px; color: #4c6469; background: #eef7f4; border-left: 4px solid var(--teal); font-size: 0.92rem; }
.thanks-message, .completion-message { padding: 24px; text-align: left; background: #eef7f4; border-left: 4px solid var(--teal); }
.thanks-message h3, .completion-message h2 { margin-top: 0; }
.new-attempt-button { display: inline-block; padding: 10px 14px; color: var(--white); background: var(--teal-dark); border-radius: 4px; font-weight: 700; text-decoration: none; }
.save-later { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-left: auto; padding-left: 12px; }
.save-later-button { padding: 10px 14px; color: var(--white); background: var(--teal-dark); border: 0; border-radius: 4px; cursor: pointer; font: inherit; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.03em; }
.save-later-button:disabled { opacity: 0.65; cursor: wait; }
.save-later-result { position: absolute; z-index: 2; top: calc(100% + 10px); right: 0; width: min(420px, 80vw); padding: 10px 12px; color: var(--muted); background: var(--white); border: 1px solid var(--line); box-shadow: 0 8px 22px rgba(25, 50, 60, 0.12); font-size: 0.88rem; }
.save-later-result a { display: block; margin-top: 4px; color: var(--teal-dark); overflow-wrap: anywhere; font-weight: 700; }
.document-page { max-width: 980px; }
.document-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.print-button { padding: 10px 14px; color: var(--white); background: var(--teal-dark); border: 0; border-radius: 4px; cursor: pointer; font: inherit; font-weight: 700; }
.attempt-document { padding: 44px 52px; background: var(--white); box-shadow: 0 18px 45px rgba(25, 50, 60, 0.08); }
.document-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; padding-bottom: 28px; border-bottom: 3px solid var(--teal); }
.document-header h1 { max-width: 650px; font-size: clamp(2rem, 4vw, 3.3rem); }
.document-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; white-space: nowrap; }
.document-section { padding: 26px 0; border-bottom: 1px solid var(--line); }
.document-section h2 { margin-bottom: 18px; font-size: 1.5rem; }
.document-section h3 { margin: 0 0 5px; color: var(--muted); font-size: 0.82rem; text-transform: uppercase; }
.document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 30px; }
.document-grid dt { color: var(--muted); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
.document-grid dd { margin: 3px 0 0; }
.document-block { margin-top: 18px; }
.document-block p { margin: 0; white-space: pre-line; }
.document-list { margin: 0; padding-left: 22px; }
.document-list li { margin: 9px 0; }
.document-file { display: inline-block; margin-left: 12px; color: var(--teal-dark); font-weight: 700; }
.document-data-table { width: 100%; border-collapse: collapse; }
.document-data-table th, .document-data-table td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.document-data-table th { background: #eef5f2; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; }

@media print {
    body { background: #fff; }
    .no-print { display: none !important; }
    .page-shell.document-page { width: 100%; max-width: none; padding: 0; }
    .attempt-document { padding: 0; box-shadow: none; }
    .document-section { break-inside: avoid; }
}

@media (max-width: 700px) {
    .header-inner, .page-shell, .footer-inner { width: min(100% - 32px, 1120px); }
    .header-inner { min-height: 76px; }
    .brand { height: 56px; }
    .brand img { height: 46px; }
    .header-label { display: none; }
    .page-shell { padding: 48px 0 64px; }
    .intro-copy { font-size: 1rem; }
    .form-section { margin-top: 48px; padding: 22px 18px; }
    .section-heading, .footer-inner { align-items: flex-start; flex-direction: column; }
    .footer-inner { justify-content: center; padding: 22px 0; }
    .attempts-header { align-items: flex-start; flex-direction: column; }
    .document-toolbar, .document-header { align-items: flex-start; flex-direction: column; }
    .attempt-document { padding: 26px 20px; }
    .document-meta { align-items: flex-start; }
    .document-grid { grid-template-columns: 1fr; }
    #surveyContainer .sd-paneldynamic__panel-content .sd-row { display: block; }
}