* {
    box-sizing: border-box;
}

:root {
    --bg: #0b0f16;
    --panel: #121923;
    --panelAlt: #0f141d;
    --border: #2b3647;
    --borderSoft: #334155;
    --text: #e6edf7;
    --textSoft: #b6c2d1;
    --heading: #f5f7fb;
    --accent: #6ca3ff;
    --accentDeep: #2852d1;
    --goodBg: rgba(102, 187, 106, 0.12);
    --goodBorder: #66bb6a;
    --warnBg: rgba(209, 125, 41, 0.12);
    --warnBorder: #d17d29;
    --dangerBg: rgba(201, 65, 65, 0.12);
    --dangerBorder: #c94141;
    --infoBg: rgba(108, 163, 255, 0.12);
    --infoBorder: #6ca3ff;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    --fontBody: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --fontWeightStrong: 600;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--fontBody);
    font-size: 17px;
    font-weight: 400;
    background:
        radial-gradient(circle at top right, rgba(40, 82, 209, 0.16), transparent 28%),
        radial-gradient(circle at top left, rgba(108, 163, 255, 0.09), transparent 24%),
        linear-gradient(180deg, #0b0f16 0%, #0a0f15 100%);
    color: var(--text);
    line-height: 1.76;
}

.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 26px 20px 56px;
}

.hero {
    width: 100%;
    margin: 0;
    padding: 0;
    background:
        linear-gradient(90deg, rgba(108, 163, 255, 0.065), transparent 42%),
        linear-gradient(to bottom, rgba(19, 28, 40, 0.99), rgba(13, 20, 30, 0.98));
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    position: relative;
    overflow: hidden;
}

.heroInner {
    width: 100%;
    max-width: 1180px;
    min-height: 142px;
    margin: 0 auto;
    padding: 24px 20px;
    display: grid;
    grid-template-columns: minmax(120px, 190px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(24px, 4vw, 54px);
}

.heroLogoWrap {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.heroLogo {
    display: block;
    width: 100%;
    max-width: 180px;
    max-height: 92px;
    object-fit: contain;
    object-position: left center;
}

.heroTitleWrap {
    min-width: 0;
}

h1 {
    margin: 0;
    font-size: clamp(30px, 3.2vw, 42px);
    font-weight: 650;
    line-height: 1.18;
    letter-spacing: -0.018em;
    color: var(--heading);
    text-wrap: balance;
}

.panel {
    --panelPad: 22px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: var(--panelPad);
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.markdownSection {
    scroll-margin-top: 18px;
}

.sectionHeader {
    display: block;
    margin-bottom: 14px;
}

.stepBadge {
    display: inline-block;
    vertical-align: baseline;
    margin-left: calc(var(--panelPad) * -1);
    margin-right: 12px;
    margin-bottom: 4px;
    min-width: 96px;
    padding: 8px 15px;
    text-align: center;
    border: 1px solid var(--infoBorder);
    border-left: 0;
    border-radius: 0 5px 5px 0;
    background: linear-gradient(90deg, rgba(40, 82, 209, 0.42), rgba(108, 163, 255, 0.14));
    box-shadow: 3px 0 10px rgba(40, 82, 209, 0.12);
    color: #e2edff;
    font-size: 15px;
    font-weight: var(--fontWeightStrong);
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 650;
    line-height: 1.3;
    color: var(--heading);
}

.sectionHeader h2 {
    display: inline;
}

h3 {
    margin: 24px 0 11px 0;
    font-size: 18px;
    font-weight: 650;
    line-height: 1.4;
    color: var(--heading);
}

.markdownSection > h3:not(.metricHeading) {
    padding-left: 12px;
    border-left: 3px solid var(--accent);
}

h4 {
    color: var(--heading);
}

p {
    margin: 0 0 16px 0;
}

.muted {
    color: var(--textSoft);
}

.cardGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.miniCard {
    background: var(--panelAlt);
    border: 1px solid var(--borderSoft);
    border-radius: 12px;
    padding: 16px;
}

.miniCard h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #f4f7fc;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ruleBox,
.infoBox,
.warningBox,
.successBox,
.dangerBox {
    margin: 14px 0;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid;
}

.ruleBox,
.infoBox {
    background: var(--infoBg);
    border-color: var(--infoBorder);
}

.warningBox {
    background: var(--warnBg);
    border-color: var(--warnBorder);
}

.successBox {
    background: var(--goodBg);
    border-color: var(--goodBorder);
}

.dangerBox {
    background: var(--dangerBg);
    border-color: var(--dangerBorder);
}

.markdownCallout {
    color: var(--text);
}

.markdownCallout > :last-child {
    margin-bottom: 0;
}

ul,
ol {
    margin: 10px 0 12px 22px;
    padding: 0;
}

li {
    margin-bottom: 10px;
}

li::marker {
    color: #9cc3ff;
}

.twoCol {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.allowed,
.notAllowed {
    border-radius: 12px;
    padding: 16px;
    min-width: 0;
}

.allowed {
    background: rgba(102, 187, 106, 0.08);
    border: 1px solid rgba(102, 187, 106, 0.45);
}

.notAllowed {
    background: rgba(201, 65, 65, 0.08);
    border: 1px solid rgba(201, 65, 65, 0.45);
}

.allowed h4,
.notAllowed h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.allowed h4 {
    color: #c8f5ca;
}

.notAllowed h4 {
    color: #ffb1b1;
}

.exampleTableWrap {
    overflow-x: auto;
    margin: 14px 0 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
}

.exampleTableWrap:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

th,
td {
    border: 1px solid #2a3545;
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

thead th {
    background: #161f2c;
    color: #f4f7fc;
    font-weight: var(--fontWeightStrong);
}

tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.025);
}

.checklistPanel {
    background: linear-gradient(to bottom, rgba(19, 28, 40, 0.96), rgba(13, 20, 30, 0.96));
    border: 1px solid var(--borderSoft);
}

.checklistGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.checklistCard {
    background: #0f141d;
    border: 1px solid var(--borderSoft);
    border-radius: 12px;
    padding: 16px;
}

.checklistCard h3 {
    margin-top: 0;
    font-size: 16px;
}

.checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.checklist li {
    position: relative;
    margin: 0 0 10px 0;
    padding-left: 28px;
    color: #dbe4ef;
}

.checklist li::before {
    content: " ";
    position: absolute;
    left: 0;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid #7aa8ff;
    background: rgba(108, 163, 255, 0.1);
    box-shadow: inset 0 0 0 2px rgba(10, 15, 22, 0.95);
}

.imageCompareGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 16px;
    align-items: start;
}

.imageCompareCard {
    background: var(--panelAlt);
    border: 1px solid var(--borderSoft);
    border-radius: 12px;
    padding: 14px;
    overflow: hidden;
}

.imageCompareCard img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0b1118;
}

.footerNote {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid var(--borderSoft);
    border-radius: 12px;
    background: rgba(17, 24, 37, 0.88);
    color: var(--textSoft);
    font-size: 14px;
}

.accent {
    color: #9cc3ff;
    font-weight: var(--fontWeightStrong);
}

strong {
    color: #f5f7fb;
    font-weight: var(--fontWeightStrong);
}

a {
    color: #9cc3ff;
    text-underline-offset: 3px;
}

a:hover {
    color: #c5ddff;
}

.keyStatement {
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid var(--borderSoft);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    background: rgba(108, 163, 255, 0.07);
    font-size: 1.02em;
}

.metricHeading {
    display: inline-block;
    margin: 12px 0 16px;
    padding: 11px 14px;
    border: 1px solid var(--infoBorder);
    border-radius: 10px;
    background: var(--infoBg);
    color: #d6e6ff;
}

code {
    padding: 0.12em 0.35em;
    border: 1px solid var(--borderSoft);
    border-radius: 5px;
    background: #0b1118;
    color: #dce9ff;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.92em;
}

.codeBlockWrap {
    overflow-x: auto;
    margin: 14px 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0b1118;
}

pre {
    margin: 0;
    padding: 16px;
}

pre code {
    padding: 0;
    border: 0;
    background: transparent;
}

.loadingPanel {
    color: var(--textSoft);
}

.loadingPulse {
    width: 44px;
    height: 4px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: var(--accent);
    animation: loadingPulse 1.1s ease-in-out infinite alternate;
}

@keyframes loadingPulse {
    from {
        opacity: 0.3;
        transform: scaleX(0.65);
        transform-origin: left center;
    }
    to {
        opacity: 1;
        transform: scaleX(1);
        transform-origin: left center;
    }
}

.errorBadge {
    border-color: var(--dangerBorder);
    background: var(--dangerBg);
    color: #ffd3d3;
}


/* Persistent left-side document index */
.srOnly {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sectionsToggle {
    position: fixed;
    left: 18px;
    top: 50%;
    z-index: 1200;
    width: 58px;
    height: 58px;
    margin: 0;
    padding: 0;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(108, 163, 255, 0.72);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(27, 43, 66, 0.98), rgba(12, 20, 31, 0.98));
    color: #dceaff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(108, 163, 255, 0.08) inset;
    cursor: pointer;
    transition: left 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.sectionsToggle[hidden] {
    display: none !important;
}

.sectionsToggle:hover,
.sectionsToggle:focus-visible {
    border-color: var(--accent);
    transform: translateY(-50%) scale(1.04);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(108, 163, 255, 0.14);
    outline: none;
}

.sectionsToggleIcon {
    width: 31px;
    height: 31px;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

.sectionsBackdrop {
    position: fixed;
    inset: 0;
    z-index: 1250;
    background: rgba(3, 7, 12, 0.68);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.24s ease;
}

.sectionsBackdrop.isVisible {
    opacity: 1;
}

.sectionsDrawer {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1300;
    width: min(390px, 88vw);
    display: flex;
    flex-direction: column;
    padding: 22px;
    background:
        radial-gradient(circle at top left, rgba(108, 163, 255, 0.12), transparent 28%),
        linear-gradient(180deg, #121b27 0%, #0d141e 100%);
    border-right: 1px solid var(--borderSoft);
    box-shadow: 18px 0 46px rgba(0, 0, 0, 0.48);
    transform: translateX(-104%);
    visibility: hidden;
    transition: transform 0.26s ease, visibility 0s linear 0.26s;
}

body.sectionsOpen {
    overflow: hidden;
}

body.sectionsOpen .sectionsDrawer {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.26s ease, visibility 0s;
}

body.sectionsOpen .sectionsToggle {
    opacity: 0;
    pointer-events: none;
}

.sectionsDrawerHeader {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--borderSoft);
}

.sectionsDrawerEyebrow {
    margin-bottom: 3px;
    color: #9db7da;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sectionsDrawerTitle {
    margin: 0;
    font-size: 25px;
}

.sectionsClose {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--borderSoft);
    border-radius: 12px;
    background: #0b1118;
    color: #dbe8fa;
    cursor: pointer;
}

.sectionsClose:hover,
.sectionsClose:focus-visible {
    border-color: var(--accent);
    outline: none;
}

.sectionsClose svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.sectionsCurrent {
    min-height: 38px;
    margin: 14px 0 10px;
    padding: 9px 11px;
    border: 1px solid rgba(108, 163, 255, 0.24);
    border-radius: 10px;
    background: rgba(108, 163, 255, 0.07);
    color: #b8c9df;
    font-size: 12px;
    line-height: 1.45;
}

.sectionsNav {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 2px 4px 18px 0;
    scrollbar-width: thin;
    scrollbar-color: #40516a transparent;
}

.sectionsNavLink {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    margin: 5px 0;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #dce5f1;
    text-decoration: none;
    line-height: 1.35;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.sectionsNavLink:hover,
.sectionsNavLink:focus-visible {
    border-color: var(--borderSoft);
    background: rgba(255, 255, 255, 0.035);
    transform: translateX(2px);
    outline: none;
}

.sectionsNavLink.isActive {
    border-color: rgba(108, 163, 255, 0.48);
    background: rgba(108, 163, 255, 0.11);
}

.sectionsNavNumber {
    color: #7faaf1;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.06em;
    padding-top: 2px;
}

.sectionsNavLabel {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
    font-weight: 600;
}

.printOnlyLogo {
    display: none;
}


@media (max-width: 699px) {
    /* Keep the control in the existing left gutter. The page padding is not changed. */
    .sectionsToggle {
        left: -28px;
        width: 58px;
        height: 58px;
        border-radius: 0 16px 16px 0;
        border-left: 0;
    }

    .sectionsToggle:hover,
    .sectionsToggle:focus-visible,
    .sectionsToggle:active {
        left: -18px;
    }

    .sectionsDrawer {
        width: min(360px, 92vw);
        padding: 18px 16px;
    }
}

@media (max-width: 420px) {
    /* 26px remains visible: 10px page gutter + 16px panel inner padding. */
    .sectionsToggle {
        left: -32px;
    }

    .sectionsToggle:hover,
    .sectionsToggle:focus-visible,
    .sectionsToggle:active {
        left: -22px;
    }
}

@media (max-width: 600px) {
    .imageCompareGrid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 699px) {
    .page {
        padding: 20px 14px 40px;
    }

    .panel {
        --panelPad: 18px;
        padding: var(--panelPad);
    }

    body {
        font-size: 16.5px;
        line-height: 1.74;
    }

    .heroInner {
        min-height: 112px;
        padding: 18px 14px;
        grid-template-columns: minmax(0, 25%) minmax(0, 75%);
        gap: 14px;
    }

    .heroLogo {
        max-width: 118px;
        max-height: 74px;
    }

    h1 {
        font-size: clamp(24px, 7vw, 31px);
        line-height: 1.2;
    }

    h2 {
        font-size: 21px;
    }


    th,
    td {
        padding: 10px 12px;
    }
}

@media (max-width: 420px) {
    .page {
        padding-left: 10px;
        padding-right: 10px;
    }

    .panel {
        --panelPad: 16px;
        padding: var(--panelPad);
        border-radius: 12px;
    }

    .heroInner {
        padding-left: 10px;
        padding-right: 10px;
        gap: 12px;
    }

    h1 {
        font-size: clamp(22px, 7.2vw, 28px);
    }

    h2 {
        font-size: 20px;
    }

    .stepBadge {
        min-width: 0;
    }
}

@media print {
    @page {
        margin: 18mm;
    }

    html,
    body {
        min-height: 0 !important;
        background: #ffffff !important;
    }

    body > :not(#printOnlyLogo) {
        display: none !important;
        visibility: hidden !important;
    }

    #printOnlyLogo {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: center !important;
    }

    #printOnlyLogo img {
        display: block !important;
        visibility: visible !important;
        width: auto !important;
        max-width: 240px !important;
        max-height: 90px !important;
        margin: 0 auto !important;
    }
}

/* Markdown-driven questionnaire */
.questionnaireForm {
    display: grid;
    gap: 22px;
}

.questionnaireForm > p {
    margin: 0;
}

.questionGroup {
    min-width: 0;
    margin: 0;
    padding: 18px 0 2px 18px;
    border: 0;
    border-left: 3px solid var(--accent);
}

.questionGroup legend {
    max-width: 100%;
    margin: 0 0 8px;
    padding: 0 10px 0 0;
    color: var(--heading);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
}

.questionGroupNote {
    color: var(--textSoft);
}

.questionBlock,
.questionField {
    min-width: 0;
}

.questionField {
    padding: 14px 0;
    border-bottom: 1px solid var(--borderSoft);
}

.questionGroup > .questionField:last-child,
.questionGroup > .questionBlock:last-child .questionField:last-child {
    border-bottom: 0;
}

.questionBlockNested {
    padding-top: 12px;
}

.questionBlockNested > .questionLabel {
    margin-bottom: 4px;
}

.questionBlockNested .questionField {
    padding-left: 14px;
}

.questionLabel {
    margin-bottom: 9px;
    color: var(--heading);
    line-height: 1.55;
}

.questionInput {
    width: min(100%, 720px);
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--borderSoft);
    border-radius: 9px;
    background: rgba(8, 13, 22, 0.72);
    color: var(--heading);
    font: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.questionInput:focus {
    border-color: rgba(108, 163, 255, 0.72);
    background: rgba(8, 13, 22, 0.92);
    box-shadow: 0 0 0 3px rgba(108, 163, 255, 0.11);
}

.questionTextarea {
    min-height: 94px;
    resize: vertical;
}

.questionChoices {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
}

.questionChoice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--borderSoft);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
}

.questionChoice:hover {
    border-color: rgba(108, 163, 255, 0.42);
}

.questionChoice input {
    margin: 0;
    accent-color: var(--accent);
}

.questionDetailsInput {
    flex: 1 1 260px;
    width: auto;
    max-width: 520px;
}

@media (max-width: 699px) {
    .questionGroup {
        padding-left: 14px;
    }

    .questionBlockNested .questionField {
        padding-left: 8px;
    }

    .questionChoicesMulti .questionChoice {
        flex: 1 1 calc(50% - 9px);
    }
}

@media (max-width: 420px) {
    .questionChoices,
    .questionChoicesMulti {
        align-items: stretch;
        flex-direction: column;
    }

    .questionChoice,
    .questionChoicesMulti .questionChoice,
    .questionDetailsInput {
        width: 100%;
        max-width: none;
        flex-basis: auto;
    }
}

/* Questionnaire submission */
.questionnaireIdentityField {
    padding: 4px 0 18px;
    border-bottom: 1px solid var(--borderSoft);
}

.questionnaireIdentityField .questionInput {
    width: min(100%, 520px);
}

.questionnaireSubmit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding-top: 6px;
}

.questionnaireSubmitButton {
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid rgba(108, 163, 255, 0.55);
    border-radius: 9px;
    background: rgba(108, 163, 255, 0.14);
    color: var(--heading);
    font: inherit;
    cursor: pointer;
}

.questionnaireSubmitButton:hover:not(:disabled) {
    background: rgba(108, 163, 255, 0.22);
}

.questionnaireSubmitButton:disabled {
    opacity: 0.6;
    cursor: wait;
}

.questionnaireStatus {
    min-height: 1.5em;
    color: var(--textSoft);
}

.questionnaireStatus[data-state="success"] {
    color: #8ed6a4;
}

.questionnaireStatus[data-state="error"] {
    color: #f0a1a1;
}

/* Questionnaire submissions viewer */
.submissionsViewerPage {
    min-height: 100vh;
}

.viewerHeroInner {
    min-height: 126px;
}

.viewerEyebrow {
    margin-bottom: 5px;
    color: #9cc3ff;
    font-size: 12px;
    font-weight: var(--fontWeightStrong);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.viewerHeroMeta {
    margin: 7px 0 0;
    color: var(--textSoft);
    font-size: 14px;
}

.viewerShell {
    width: min(1600px, calc(100% - 40px));
    margin: 0 auto;
    padding: 26px 0 56px;
    display: grid;
    grid-template-columns: minmax(230px, 20%) minmax(0, 80%);
    gap: 18px;
    align-items: start;
}

.viewerSidebar,
.viewerReport {
    margin-bottom: 0;
}

.viewerSidebar {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    padding: 0;
    overflow: hidden;
}

.viewerSidebarHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 15px;
    border-bottom: 1px solid var(--borderSoft);
}

.viewerSidebarHeader h2 {
    font-size: 20px;
}

.viewerCount {
    min-width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    padding: 0 8px;
    border: 1px solid rgba(108, 163, 255, 0.35);
    border-radius: 999px;
    background: rgba(108, 163, 255, 0.1);
    color: #cfe0ff;
    font-size: 13px;
    font-weight: var(--fontWeightStrong);
}

.submissionList {
    max-height: calc(100vh - 128px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.submissionListItem {
    width: 100%;
    display: block;
    padding: 15px 18px;
    border: 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.78);
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.submissionListItem:last-child {
    border-bottom: 0;
}

.submissionListItem:hover {
    background: rgba(108, 163, 255, 0.07);
}

.submissionListItem.isActive {
    background: linear-gradient(90deg, rgba(40, 82, 209, 0.24), rgba(108, 163, 255, 0.07));
    box-shadow: inset 3px 0 0 var(--accent);
}

.submissionListItem:focus-visible {
    outline: 2px solid rgba(108, 163, 255, 0.75);
    outline-offset: -2px;
}

.submissionListClan,
.submissionListDate,
.submissionListMeta {
    display: block;
}

.submissionListClan {
    color: var(--heading);
    font-size: 15px;
    font-weight: var(--fontWeightStrong);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.submissionListDate {
    margin-top: 5px;
    color: var(--textSoft);
    font-size: 12px;
    line-height: 1.4;
}

.submissionListMeta {
    margin-top: 2px;
    color: #7f91a8;
    font-size: 11px;
    line-height: 1.4;
}

.viewerReport {
    min-width: 0;
    min-height: 520px;
    padding: 0;
    overflow: hidden;
}

.viewerEmpty,
.viewerLoading {
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 42px;
    text-align: center;
}

.viewerEmpty h2 {
    margin-bottom: 8px;
}

.viewerEmpty p,
.viewerLoadingText {
    max-width: 520px;
    margin: 0;
    color: var(--textSoft);
}

.viewerEmptyIcon {
    width: 54px;
    height: 54px;
    margin-bottom: 18px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(108, 163, 255, 0.28);
    border-radius: 14px;
    background: rgba(108, 163, 255, 0.08);
    color: #b9d3ff;
    font-size: 24px;
}

.viewerLoading .loadingPulse {
    margin-bottom: 20px;
}

.reportHeader {
    padding: 24px 26px;
    border-bottom: 1px solid var(--borderSoft);
    background: linear-gradient(90deg, rgba(108, 163, 255, 0.055), transparent 55%);
}

.reportTitle {
    font-size: clamp(25px, 2.6vw, 34px);
    overflow-wrap: anywhere;
}

.reportMetadata {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin-top: 18px;
}

.reportMetadataItem {
    min-width: 130px;
}

.reportMetadataLabel,
.reportMetadataValue {
    display: block;
}

.reportMetadataLabel {
    margin-bottom: 2px;
    color: #8291a5;
    font-size: 11px;
    font-weight: var(--fontWeightStrong);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.reportMetadataValue {
    color: var(--textSoft);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.reportBody {
    padding: 22px 26px 30px;
}

.reportGroup {
    margin-bottom: 24px;
    border: 1px solid var(--borderSoft);
    border-radius: 12px;
    background: var(--panelAlt);
    overflow: hidden;
}

.reportGroup:last-child {
    margin-bottom: 0;
}

.reportGroupHeader {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--borderSoft);
    background: rgba(108, 163, 255, 0.055);
}

.reportGroupTitle {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 17px;
}

.reportGroupCount {
    flex: 0 0 auto;
    color: #8291a5;
    font-size: 11px;
    white-space: nowrap;
}

.reportAnswer {
    display: grid;
    grid-template-columns: minmax(260px, 42%) minmax(0, 58%);
    gap: 10px 24px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.72);
}

.reportAnswer:last-child {
    border-bottom: 0;
}

.reportQuestion {
    color: var(--textSoft);
    font-size: 14px;
    line-height: 1.5;
}

.reportResponse {
    min-width: 0;
    color: var(--heading);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.reportValue {
    white-space: pre-wrap;
}

.reportEmptyValue {
    color: #6f7f93;
    font-style: italic;
    font-weight: 400;
}

.reportBoolean {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 10px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 12px;
    font-weight: var(--fontWeightStrong);
}

.reportBoolean.isYes {
    border-color: rgba(102, 187, 106, 0.5);
    background: var(--goodBg);
    color: #a6deb0;
}

.reportBoolean.isNo {
    border-color: rgba(201, 65, 65, 0.5);
    background: var(--dangerBg);
    color: #efaaaa;
}

.reportChips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.reportChip {
    display: inline-flex;
    min-height: 27px;
    align-items: center;
    padding: 3px 9px;
    border: 1px solid rgba(108, 163, 255, 0.33);
    border-radius: 999px;
    background: rgba(108, 163, 255, 0.08);
    color: #cfe0ff;
    font-size: 12px;
    font-weight: 500;
}

.reportDetails {
    grid-column: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding-top: 2px;
    color: var(--textSoft);
    font-size: 13px;
}

.reportDetailsLabel {
    color: #8291a5;
    font-size: 10px;
    font-weight: var(--fontWeightStrong);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.reportDetailsValue {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.viewerInlineEmpty,
.viewerError {
    margin: 24px;
}

.viewerInlineEmpty {
    padding: 20px;
    border: 1px dashed var(--borderSoft);
    border-radius: 12px;
}

.viewerInlineEmpty h3 {
    margin-top: 0;
}

@media (max-width: 900px) {
    .viewerShell {
        width: min(100% - 24px, 1180px);
        grid-template-columns: 1fr;
    }

    .viewerSidebar {
        position: static;
        max-height: none;
    }

    .submissionList {
        max-height: 280px;
    }

    .viewerReport {
        min-height: 420px;
    }

    .reportAnswer {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .reportDetails {
        grid-column: 1;
    }
}

@media (max-width: 520px) {
    .viewerShell {
        width: calc(100% - 20px);
        padding-top: 10px;
        gap: 10px;
    }

    .viewerHeroInner {
        min-height: 108px;
    }

    .viewerSidebarHeader,
    .reportHeader,
    .reportBody {
        padding-left: 16px;
        padding-right: 16px;
    }

    .reportMetadata {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .reportMetadataItem:first-child {
        grid-column: 1 / -1;
    }

    .reportGroupHeader,
    .reportAnswer {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* Submission viewer readability + mobile drawer refinements */
.reportQuestion {
    color: var(--heading);
    font-size: clamp(17px, 1.25vw, 20px);
    font-weight: var(--fontWeightStrong);
    line-height: 1.5;
}

.reportResponse {
    font-size: clamp(18px, 1.35vw, 22px);
    font-weight: 600;
    line-height: 1.55;
}

.reportBoolean,
.reportChip {
    font-size: 14px;
}

.reportDetails {
    font-size: 15px;
}

.viewerDrawerToggle,
.viewerDrawerBackdrop {
    display: none;
}

@media (max-width: 900px) {
    .viewerShell {
        display: block;
    }

    .viewerSidebar {
        position: fixed;
        z-index: 1202;
        top: 0;
        left: 0;
        width: min(84vw, 360px);
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0 14px 14px 0;
        border-left: 0;
        transform: translateX(calc(-100% - 16px));
        transition: transform 180ms ease;
        box-shadow: 20px 0 55px rgba(0, 0, 0, 0.38);
    }

    .viewerSidebar.isOpen {
        transform: translateX(0);
    }

    .viewerSidebarHeader {
        padding-top: max(18px, env(safe-area-inset-top));
    }

    .submissionList {
        max-height: calc(100dvh - 86px);
    }

    .viewerDrawerToggle {
        position: fixed;
        z-index: 1203;
        top: 50%;
        left: 0;
        width: 10px;
        height: 180px;
        display: block;
        padding: 0;
        border: 0;
        border-radius: 0 8px 8px 0;
        background: linear-gradient(180deg, rgba(108, 163, 255, 0.58), var(--accent), rgba(108, 163, 255, 0.58));
        box-shadow: 0 0 16px rgba(108, 163, 255, 0.42);
        cursor: pointer;
        transform: translateY(-50%);
        transition: left 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
        touch-action: manipulation;
    }

    .viewerDrawerToggle:hover,
    .viewerDrawerToggle:focus-visible {
        box-shadow: 0 0 24px rgba(108, 163, 255, 0.72);
        outline: none;
    }

    .viewerDrawerToggle.isOpen {
        left: min(84vw, 360px);
        opacity: 0.88;
    }

    .viewerDrawerBackdrop {
        position: fixed;
        z-index: 1201;
        inset: 0;
        display: block;
        border: 0;
        background: rgba(3, 7, 14, 0.68);
        opacity: 0;
        transition: opacity 180ms ease;
    }

    .viewerDrawerBackdrop.isVisible {
        opacity: 1;
    }

    .viewerDrawerOpen {
        overflow: hidden;
    }

    .viewerReport {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .viewerDrawerToggle {
        height: 150px;
    }

    .viewerSidebar {
        width: min(88vw, 340px);
    }

    .viewerDrawerToggle.isOpen {
        left: min(88vw, 340px);
    }

    .reportQuestion {
        font-size: 18px;
    }

    .reportResponse {
        font-size: 19px;
    }
}


/* Questionnaire roster subsections */
.questionSubsectionHeading {
    margin: 18px 0 2px;
    padding: 8px 12px;
    border-left: 2px solid rgba(108, 163, 255, 0.55);
    background: rgba(108, 163, 255, 0.055);
    color: #cfe0ff;
    font-size: 14px;
    font-weight: var(--fontWeightStrong);
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.questionGroup legend + .questionSubsectionHeading {
    margin-top: 8px;
}

/* Submission report summary scaffold */
.reportSummary {
    margin: 22px 26px 0;
    border: 1px solid var(--borderSoft);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(108, 163, 255, 0.075), rgba(10, 17, 29, 0.72));
    overflow: hidden;
}

.reportSummaryHeader {
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--borderSoft);
}

.reportSummaryTitle {
    margin: 2px 0 0;
    padding: 0;
    border: 0;
    font-size: 22px;
}

.reportSummaryGrid {
    padding: 18px;
}

.reportSummaryEmpty {
    color: var(--textSoft);
    font-size: 14px;
    line-height: 1.55;
}

/* Viewer requested refinements */
.reportQuestion {
    font-weight: 400;
}

@media (max-width: 900px) {
    .viewerDrawerToggle {
        width: 30px;
        display: grid;
        place-items: center;
    }

    .viewerDrawerToggleText {
        display: block;
        color: #f4f8ff;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.16em;
        line-height: 1;
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        user-select: none;
    }

    .reportSummary {
        margin-left: 16px;
        margin-right: 16px;
    }
}


.reportSubsectionTitle {
    padding: 10px 18px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.72);
    background: rgba(108, 163, 255, 0.035);
    color: #a9c8ff;
    font-size: 12px;
    font-weight: var(--fontWeightStrong);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Submission viewer report header + calculated summary */
.reportHeader {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, auto);
    align-items: start;
    gap: 24px 36px;
}

.reportMetadata {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, auto));
    justify-content: end;
    gap: 10px 22px;
    margin-top: 0;
    text-align: right;
}

.reportSummary {
    margin: 0;
    border: 0;
    border-left: 4px solid var(--goodBorder);
    border-radius: 0;
    background: linear-gradient(90deg, rgba(102, 187, 106, 0.075), rgba(10, 17, 29, 0.72) 44%, rgba(10, 17, 29, 0.72));
    overflow: hidden;
}

.reportSummaryHeader {
    padding: 20px 26px 12px;
}

.reportSummaryGrid {
    display: grid;
    gap: 22px;
    padding: 8px 26px 24px;
}

.reportSummaryBlockTitle {
    margin: 0 0 10px;
    color: var(--heading);
    font-size: 14px;
    letter-spacing: 0.035em;
}

.reportSummaryTableWrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--borderSoft);
    border-radius: 10px;
}

.reportSummaryTable {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    background: rgba(8, 14, 24, 0.44);
}

.reportSummaryTable th,
.reportSummaryTable td {
    padding: 11px 13px;
    border-right: 1px solid var(--borderSoft);
    border-bottom: 1px solid var(--borderSoft);
    text-align: center;
    white-space: nowrap;
}

.reportSummaryTable tr > :last-child {
    border-right: 0;
}

.reportSummaryTable tbody tr:last-child > * {
    border-bottom: 0;
}

.reportSummaryTable thead th {
    background: rgba(108, 163, 255, 0.07);
    color: #cfe0ff;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.reportSummaryTable .reportSummaryRowLabel {
    text-align: left;
    color: var(--textSoft);
    font-weight: 500;
}

.reportSummaryTotalRow {
    background: rgba(102, 187, 106, 0.07);
}

.reportSummaryTotalRow .reportSummaryRowLabel,
.reportSummaryTotalValue {
    color: #bce7c3;
    font-weight: 700;
}

.reportSummaryTotalValue {
    text-align: right !important;
    font-size: 17px;
}

.reportFeasibilityTable {
    min-width: 620px;
}

.reportFeasibilityStatus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    min-height: 26px;
    padding: 2px 9px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.reportFeasibilityStatus.isAchievable {
    border-color: rgba(102, 187, 106, 0.55);
    background: var(--goodBg);
    color: #a6deb0;
}

.reportFeasibilityStatus.isNotAchievable {
    border-color: rgba(201, 65, 65, 0.5);
    background: var(--dangerBg);
    color: #efaaaa;
}

.reportPointsExtra {
    color: #a6deb0;
    font-weight: 600;
}

.reportPointsMissing {
    color: #efaaaa;
    font-weight: 600;
}

@media (min-width: 901px) {
    .reportResponse {
        display: flex;
        justify-content: flex-end;
        text-align: right;
    }

    .reportChips {
        justify-content: flex-end;
    }

    .reportDetails {
        text-align: right;
    }
}

@media (max-width: 900px) {
    .reportHeader {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .reportMetadata {
        justify-content: start;
        text-align: left;
    }

    .reportSummary {
        margin: 0;
    }
}

@media (max-width: 520px) {
    .reportMetadata {
        grid-template-columns: 1fr 1fr;
    }

    .reportSummaryHeader,
    .reportSummaryGrid {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* TinMan feasibility config details */
.reportFeasibilityTable .reportConfigCell {
    white-space: normal;
    min-width: 250px;
}

.reportConfigName {
    color: var(--heading);
    font-weight: 650;
    line-height: 1.25;
}

.reportConfigDetails {
    margin-top: 4px;
    color: var(--textSoft);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
}
