html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ============================================================
   STAR RATING - hover scale
   ============================================================ */
.star-rating .btn-link:hover {
    transform: scale(1.2);
    transition: transform 0.1s ease;
}

/* ============================================================
   IMAGE CHOICE CARD HOVER
   ============================================================ */
.card[style*="cursor: pointer"]:hover {
    box-shadow: 0 0 0 2px #0d6efd;
    transition: box-shadow 0.15s ease;
}

/* ============================================================
   SIGNATURE CANVAS - responsive
   ============================================================ */
canvas[id^="sig_"] {
    max-width: 100%;
    touch-action: none;
}

/* ============================================================
   DRAG HANDLE for QuestionEditor
   ============================================================ */
[data-draggable="true"] {
    position: relative;
}
[data-draggable="true"]::before {
    content: "\2630";
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 1.2rem;
    cursor: grab;
}

/* ============================================================
   GLOBAL: Prevent iOS auto-zoom on form inputs (< 16px triggers zoom)
   ============================================================ */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
select,
textarea,
.form-control,
.form-select {
    font-size: 1rem; /* 16px -- prevents iOS auto-zoom */
}

/* ============================================================
   GLOBAL: Better touch targets for form-check inputs
   ============================================================ */
.form-check-input {
    width: 1.25em;
    height: 1.25em;
    margin-top: 0.1em;
}
.form-check {
    min-height: 2.75rem; /* 44px touch target */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0;
}
.form-check .form-check-input {
    margin-left: 0;
    margin-right: 0.5rem;
    flex-shrink: 0;
}
.form-check-label {
    padding-top: 0.125rem;
    line-height: 1.4;
    cursor: pointer;
}

/* ============================================================
   SURVEY NAVIGATION BUTTONS - common styling
   ============================================================ */
.survey-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}
.survey-nav .btn {
    min-height: 48px;
    padding: 0.625rem 1.5rem;
    font-size: 1rem;
}

/* ============================================================
   NPS BUTTONS - responsive wrap
   ============================================================ */
.nps-scale {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: flex-end;
}
.nps-scale .nps-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0.375rem 0.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 0.375rem;
    flex: 0 0 auto;
}
.nps-container {
    display: inline-block;
}
.nps-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.375rem;
}

/* ============================================================
   STAR RATING - touch-friendly
   ============================================================ */
.star-rating .star-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    padding: 0;
    line-height: 1;
    cursor: pointer;
}

/* ============================================================
   SLIDER - touch-friendly thumb
   ============================================================ */
.form-range::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
}
.form-range::-moz-range-thumb {
    width: 28px;
    height: 28px;
}

/* ============================================================
   REVIEW PAGE BUTTONS
   ============================================================ */
.review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}
.review-actions .btn {
    min-height: 48px;
    padding: 0.625rem 1.5rem;
    font-size: 1rem;
}

/* ============================================================
   VALIDATION ALERT - sticky on mobile so user always sees it
   ============================================================ */
.survey-validation-alert {
    position: sticky;
    top: 0;
    z-index: 50;
}

/* ============================================================
   PROGRESS BAR - ensure readability
   ============================================================ */
.survey-progress .progress {
    height: 10px;
    border-radius: 5px;
}

/* ============================================================
   QUESTION CARD - clear visual separation on mobile
   ============================================================ */
.survey-question-card {
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0.5rem;
}
.survey-question-card:last-child {
    border-bottom: none;
}

/* ============================================================
   EDIT PAGE - sticky save bar
   ============================================================ */
.sticky-save-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 0.75rem 0;
    border-top: 1px solid #dee2e6;
    z-index: 40;
}

/* ============================================================
   ADMIN TOOLBAR - wraps on mobile
   ============================================================ */
.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* ============================================================
   MOBILE BREAKPOINT (<= 768px)
   ============================================================ */
@media (max-width: 768px) {
    /* -- Admin tables: card-style stacking -- */
    .table-responsive table {
        font-size: 0.85rem;
    }
    .table-responsive th,
    .table-responsive td {
        padding: 0.35rem;
    }
    /* Only stack non-grid tables (grids need their table structure) */
    .table-responsive:not(.grid-table) table thead { display: none; }
    .table-responsive:not(.grid-table) table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        padding: 0.5rem;
    }
    .table-responsive:not(.grid-table) table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.25rem 0.5rem;
        border: none;
        white-space: normal;
        word-break: break-word;
    }
    .table-responsive:not(.grid-table) table tbody td:first-child {
        font-weight: bold;
        background: #f8f9fa;
        border-radius: 0.25rem;
    }

    /* -- Buttons: full-width and touch-friendly -- */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* -- Survey nav buttons: full width on mobile -- */
    .survey-nav {
        flex-direction: column;
    }
    .survey-nav .btn {
        width: 100%;
        min-height: 48px;
    }

    /* -- Review page buttons -- */
    .review-actions {
        flex-direction: column;
    }
    .review-actions .btn {
        width: 100%;
    }

    /* -- Form check: larger touch targets -- */
    .form-check-input {
        width: 1.5em;
        height: 1.5em;
    }
    .form-check {
        min-height: 3rem; /* ~48px */
        padding: 0.25rem 0;
    }

    /* -- NPS: allow wrapping, 5+6 layout -- */
    .nps-scale {
        gap: 0.25rem;
    }
    .nps-scale .nps-btn {
        min-width: calc((100% - 1.25rem) / 6); /* 6 per row */
        flex: 0 0 auto;
    }

    /* -- Star rating: bigger stars -- */
    .star-rating .star-btn {
        min-width: 48px;
        min-height: 48px;
        font-size: 2.25rem;
    }

    /* -- Image choice: 2 columns max on mobile -- */
    .image-choice-grid .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .image-choice-grid .col-md-4,
    .image-choice-grid .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* -- Grid/matrix questions: horizontal scroll with hint -- */
    .grid-table {
        -webkit-overflow-scrolling: touch;
    }
    .grid-table table {
        min-width: 500px;
    }

    /* -- Signature canvas -- */
    .signature-container {
        max-width: 100%;
    }
    .signature-container canvas {
        width: 100% !important;
    }

    /* -- Slider -- */
    .slider-container {
        max-width: 100%;
    }

    /* -- Constant sum inputs -- */
    .constant-sum-input {
        width: 80px !important;
    }

    /* -- Dashboard summary cards: 2 per row -- */
    .dashboard-stats .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* -- Dashboard toolbar: stack -- */
    .dashboard-toolbar {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .dashboard-toolbar .d-flex {
        flex-wrap: wrap;
    }

    /* -- Edit page: header links wrap -- */
    .admin-toolbar {
        flex-wrap: wrap;
        gap: 0.375rem;
    }
    .admin-toolbar .btn {
        font-size: 0.8rem;
        padding: 0.375rem 0.625rem;
    }

    /* -- QuestionEditor cards: reduce padding -- */
    .card-body {
        padding: 0.75rem;
    }
    .card-header {
        padding: 0.5rem 0.75rem;
    }

    /* -- Survey title on mobile -- */
    .survey-title {
        font-size: 1.375rem;
    }

    /* -- File upload: full-width -- */
    .file-upload-container {
        max-width: 100%;
    }

    /* -- Timer badge: smaller on mobile -- */
    .timer-badge {
        font-size: 0.85rem !important;
    }

    /* -- Progress info text -- */
    .survey-progress small {
        font-size: 0.8rem;
    }

    /* -- Sticky save bar on edit page -- */
    .sticky-save-bar {
        padding: 0.5rem 0;
    }
    .sticky-save-bar .btn {
        width: 100%;
    }

    /* -- Settings cards in Edit -- */
    .settings-grid .col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* -- Conditional thank-you rules -- */
    .conditional-rules .col-md-3,
    .conditional-rules .col-md-5 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* -- QuestionEditor: core fields stack -- */
    .question-core-fields .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ============================================================
   SMALL MOBILE BREAKPOINT (<= 480px)
   ============================================================ */
@media (max-width: 480px) {
    /* NPS: even tighter packing */
    .nps-scale .nps-btn {
        min-width: 40px;
        min-height: 40px;
        font-size: 0.85rem;
        padding: 0.25rem 0.125rem;
    }

    /* Star rating: ensure they fit */
    .star-rating .star-btn {
        min-width: 40px;
        min-height: 40px;
        font-size: 1.75rem;
    }

    /* Dashboard stats: single column */
    .dashboard-stats .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Image choice: still 2 columns */
    .image-choice-grid .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Page padding */
    .content {
        padding-top: 0.5rem;
    }
    article.content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Respondent pages: the survey alone, centered */
.respondent-page {
    min-height: 100vh;
    padding: 2rem 1rem;
}
.respondent-body {
    max-width: 760px;
    margin: 0 auto;
}

/* Shown by Blazor only when something fails; both layouts use it. */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* Docs (/docs): sidebar, page and "on this page", in the manner of Furo and the Python docs. */
.docs {
    --docs-text: #1f2328;
    --docs-muted: #59636e;
    --docs-border: #e4e7eb;
    --docs-side: #f7f8fa;
    --docs-accent: #1b6ec2;
    --docs-code: #f3f4f6;
    min-height: 100vh;
    background: #fff;
    color: var(--docs-text);
    font-size: 1rem;
    line-height: 1.65;
}
.docs-top {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    height: 56px; padding: 0 24px; border-bottom: 1px solid var(--docs-border);
    position: sticky; top: 0; background: #fff; z-index: 10;
}
.docs-brand { font-weight: 600; color: var(--docs-text); text-decoration: none; }
.docs-brand span { color: var(--docs-muted); font-weight: 400; margin-left: 4px; }
.docs-app-link { font-size: .9rem; color: var(--docs-accent); text-decoration: none; }
.docs-shell { display: flex; }
.docs-side {
    width: 272px; flex-shrink: 0; background: var(--docs-side); border-right: 1px solid var(--docs-border);
    padding: 20px 16px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
}
.docs-search input {
    width: 100%; padding: 7px 10px; border: 1px solid var(--docs-border); border-radius: 6px; background: #fff; font-size: .9rem;
}
.docs-search input:focus { outline: 2px solid var(--docs-accent); outline-offset: -1px; }
.docs-menu-toggle, .docs-menu-label { display: none; }
.docs-group {
    margin: 22px 8px 6px; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--docs-muted);
}
.docs-nav ul { list-style: none; padding: 0; margin: 0; }
.docs-nav a {
    display: block; padding: 5px 8px; border-radius: 6px; color: var(--docs-text); text-decoration: none; font-size: .925rem;
}
.docs-nav a:hover { background: #eceef1; }
.docs-nav a.active { background: #e3edf8; color: var(--docs-accent); font-weight: 600; }
.docs-main { flex: 1; min-width: 0; padding: 32px 40px 64px; }
.docs-content { display: flex; gap: 48px; max-width: 1080px; }
.docs-article { flex: 1; min-width: 0; max-width: 760px; }
.docs-article h1 { font-size: 2rem; font-weight: 700; margin: 0 0 16px; }
.docs-article h2 { font-size: 1.35rem; font-weight: 600; margin: 40px 0 12px; padding-top: 8px; scroll-margin-top: 72px; }
.docs-article h3 { font-size: 1.1rem; font-weight: 600; margin: 28px 0 10px; scroll-margin-top: 72px; }
.docs-article p, .docs-article ul, .docs-article ol { margin: 0 0 14px; }
.docs-article a { color: var(--docs-accent); }
.docs-article code { background: var(--docs-code); padding: 1px 5px; border-radius: 4px; font-size: .87em; color: inherit; }
.docs-article pre {
    background: var(--docs-code); border: 1px solid var(--docs-border); border-radius: 6px; padding: 12px 14px; overflow-x: auto; font-size: .85rem;
}
.docs-article pre code { background: none; padding: 0; }
.docs-article table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: .925rem; }
.docs-article td code { white-space: nowrap; }
.docs-article th, .docs-article td { border-bottom: 1px solid var(--docs-border); padding: 8px 12px 8px 0; vertical-align: top; text-align: left; }
.docs-article th { font-weight: 600; border-bottom-width: 2px; white-space: nowrap; }
.docs-article td:first-child { font-weight: 500; min-width: 140px; }
.docs-muted { color: var(--docs-muted); }
.docs-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--docs-border); }
.docs-pager a {
    display: flex; flex-direction: column; padding: 10px 14px; border: 1px solid var(--docs-border); border-radius: 8px;
    text-decoration: none; color: var(--docs-accent); font-weight: 500; max-width: 48%;
}
.docs-pager a small { color: var(--docs-muted); font-weight: 400; }
.docs-pager .next { margin-left: auto; text-align: right; }
.docs-toc { width: 200px; flex-shrink: 0; position: sticky; top: 88px; align-self: flex-start; font-size: .85rem; }
.docs-toc p { font-weight: 600; margin-bottom: 8px; }
.docs-toc ul { list-style: none; padding: 0; border-left: 1px solid var(--docs-border); }
.docs-toc a { display: block; padding: 3px 12px; color: var(--docs-muted); text-decoration: none; }
.docs-toc a:hover { color: var(--docs-accent); }
.docs-hits { padding-left: 0; list-style: none; }
.docs-hits li { padding: 12px 0; border-bottom: 1px solid var(--docs-border); }
.docs-hits a { font-weight: 600; margin-right: 8px; }
.docs-hits p { margin: 4px 0 0; color: var(--docs-muted); font-size: .925rem; }
@media (max-width: 1100px) { .docs-toc { display: none; } }
@media (max-width: 860px) {
    .docs-shell { flex-direction: column; }
    .docs-side { width: auto; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--docs-border); padding: 12px 16px; }
    .docs-menu-label { display: inline-block; margin-top: 10px; font-weight: 600; font-size: .9rem; cursor: pointer; }
    .docs-menu-label::after { content: " \25BE"; }
    .docs-nav { display: none; }
    .docs-menu-toggle:checked ~ .docs-nav { display: block; }
    .docs-main { padding: 24px 16px 48px; }
    .docs-article table { display: block; overflow-x: auto; }
    .docs-top { padding: 0 16px; }
    .docs-article h1 { font-size: 1.6rem; }
}

/* The survey page's spam trap: off screen, out of the tab order, hidden from screen readers. */
.survey-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
