/* ============================================================
   StudyPortal Design System
   White-label R&D tax credit study portal
   Built on Bootstrap 5, Plus Jakarta Sans, warm stone neutrals
   ============================================================ */

/* ------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------ */
:root {
    /* Accent: dark charcoal (white-label neutral) */
    --sp-accent: #2D3436;
    --sp-accent-rgb: 45, 52, 54;
    --sp-accent-hover: #1E2628;
    --sp-accent-light: #3D4749;
    --sp-accent-subtle: #EAECEC;
    --sp-accent-subtle-hover: #DDE0E0;

    /* Warm stone neutrals (shared with ecosystem) */
    --sp-neutral-50: #FAFAFA;
    --sp-neutral-100: #F5F5F4;
    --sp-neutral-200: #E7E5E4;
    --sp-neutral-300: #D6D3D1;
    --sp-neutral-400: #A8A29E;
    --sp-neutral-500: #78716C;
    --sp-neutral-600: #57534E;
    --sp-neutral-700: #44403C;
    --sp-neutral-800: #292524;
    --sp-neutral-900: #1C1917;

    /* Semantic */
    --sp-success: #2D6A4F;
    --sp-success-bg: #F0FFF4;
    --sp-danger: #C53030;
    --sp-danger-bg: #FDF2F2;
    --sp-warning: #B7791F;
    --sp-warning-bg: #FFFFF0;
    --sp-info: #2B6CB0;
    --sp-info-bg: #EBF8FF;

    /* Typography */
    --sp-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --sp-body-size: 0.9375rem;
    --sp-body-line-height: 1.6;
    --sp-body-letter-spacing: -0.011em;

    /* Spacing */
    --sp-section-gap: 48px;
    --sp-field-gap: 2.5rem;
    --sp-content-padding-x: 48px;
    --sp-content-padding-y: 40px;

    /* Radius */
    --sp-radius-sm: 6px;
    --sp-radius-md: 8px;
    --sp-radius-lg: 12px;
    --sp-radius-xl: 16px;

    /* Transitions */
    --sp-transition-fast: 150ms ease;
    --sp-transition-normal: 250ms ease;
}

/* ------------------------------------------------------------
   2. BOOTSTRAP VARIABLE OVERRIDES
   ------------------------------------------------------------ */
:root {
    --bs-primary: var(--sp-accent);
    --bs-primary-rgb: var(--sp-accent-rgb);
    --bs-body-font-family: var(--sp-font-family);
    --bs-body-font-size: var(--sp-body-size);
    --bs-body-color: var(--sp-neutral-800);
    --bs-border-color: var(--sp-neutral-200);
    --bs-border-radius: var(--sp-radius-md);
    --bs-border-radius-lg: var(--sp-radius-lg);
    --bs-link-color: var(--sp-accent);
    --bs-link-hover-color: var(--sp-accent-hover);
}

/* ------------------------------------------------------------
   3. BASE RESETS & TYPOGRAPHY
   ------------------------------------------------------------ */
html {
    position: relative;
    min-height: 100%;
    font-size: 16px;
}

body {
    font-family: var(--sp-font-family);
    font-size: var(--sp-body-size);
    line-height: var(--sp-body-line-height);
    letter-spacing: var(--sp-body-letter-spacing);
    color: var(--sp-neutral-800);
    background-color: #fff;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--sp-neutral-900);
    margin-top: 0;
}

h1 {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

h4 {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.35;
}

h5 {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
}

h6 {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--sp-neutral-500);
    line-height: 1.4;
}

a {
    color: var(--sp-accent);
    text-decoration: none;
    transition: color var(--sp-transition-fast);
}

a:hover {
    color: var(--sp-accent-hover);
}

::selection {
    background-color: var(--sp-accent-subtle);
    color: var(--sp-neutral-900);
}

/* ------------------------------------------------------------
   4. UTILITY CLASSES
   ------------------------------------------------------------ */
.text-neutral-400 { color: var(--sp-neutral-400) !important; }
.text-neutral-500 { color: var(--sp-neutral-500) !important; }
.text-neutral-600 { color: var(--sp-neutral-600) !important; }
.text-neutral-700 { color: var(--sp-neutral-700) !important; }
.text-neutral-800 { color: var(--sp-neutral-800) !important; }
.text-neutral-900 { color: var(--sp-neutral-900) !important; }

.bg-neutral-50 { background-color: var(--sp-neutral-50) !important; }
.bg-neutral-100 { background-color: var(--sp-neutral-100) !important; }

.section-gap { margin-bottom: var(--sp-section-gap); }

.text-accent { color: var(--sp-accent) !important; }
.bg-accent-subtle { background-color: var(--sp-accent-subtle) !important; }

/* ------------------------------------------------------------
   5. BUTTONS
   ------------------------------------------------------------ */
.btn {
    font-family: var(--sp-font-family);
    font-weight: 500;
    font-size: var(--sp-body-size);
    border-radius: var(--sp-radius-md);
    padding: 0.5rem 1.25rem;
    transition: all var(--sp-transition-fast);
    border: 1px solid transparent;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--sp-accent);
    border-color: var(--sp-accent);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: var(--sp-accent-hover);
    border-color: var(--sp-accent-hover);
    color: #fff;
}

.btn-primary:active {
    background-color: var(--sp-accent-hover) !important;
    border-color: var(--sp-accent-hover) !important;
}

.btn-primary:disabled,
.btn-primary.disabled {
    background-color: var(--sp-neutral-400);
    background-image: none;
    border-color: var(--sp-neutral-400);
    color: #fff;
    opacity: 1;
    animation: none;
}

/* Locked while a submit is in flight (see initFormSubmitGuard in site.js).
   Signals work-in-progress without shifting layout. */
.btn.is-submitting {
    cursor: progress;
}

.btn-secondary {
    background-color: var(--sp-neutral-100);
    border-color: var(--sp-neutral-200);
    color: var(--sp-neutral-700);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background-color: var(--sp-neutral-200);
    border-color: var(--sp-neutral-300);
    color: var(--sp-neutral-800);
}

.btn-outline-primary {
    border-color: var(--sp-accent);
    color: var(--sp-accent);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
    background-color: var(--sp-accent);
    border-color: var(--sp-accent);
    color: #fff;
}

.btn-link {
    color: var(--sp-accent);
    font-weight: 500;
    text-decoration: none;
}

.btn-link:hover {
    color: var(--sp-accent-hover);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--sp-accent);
}

/* ------------------------------------------------------------
   6. FORMS
   ------------------------------------------------------------ */
.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sp-neutral-700);
    margin-bottom: 0.375rem;
}

.form-control {
    font-family: var(--sp-font-family);
    font-size: var(--sp-body-size);
    border: 1px solid var(--sp-neutral-300);
    border-radius: var(--sp-radius-md);
    padding: 0.5rem 0.75rem;
    color: var(--sp-neutral-800);
    transition: border-color var(--sp-transition-fast), box-shadow var(--sp-transition-fast);
}

.form-control:focus {
    border-color: var(--sp-accent);
    box-shadow: 0 0 0 3px rgba(var(--sp-accent-rgb), 0.12);
}

.form-control::placeholder {
    color: var(--sp-neutral-400);
}

.form-control[readonly] {
    background-color: var(--sp-neutral-50);
}

.form-select {
    font-family: var(--sp-font-family);
    font-size: var(--sp-body-size);
    border: 1px solid var(--sp-neutral-300);
    border-radius: var(--sp-radius-md);
    color: var(--sp-neutral-800);
}

.form-select:focus {
    border-color: var(--sp-accent);
    box-shadow: 0 0 0 3px rgba(var(--sp-accent-rgb), 0.12);
}

.form-check-input:checked {
    background-color: var(--sp-accent);
    border-color: var(--sp-accent);
}

.form-check-input:focus {
    border-color: var(--sp-accent);
    box-shadow: 0 0 0 3px rgba(var(--sp-accent-rgb), 0.12);
}

.form-helper {
    font-size: 0.75rem;
    color: var(--sp-neutral-400);
    margin-top: 0.25rem;
}

textarea.form-control {
    min-height: 80px;
}

/* Validation error text — small inline message rendered by
   <span asp-validation-for="..."> beneath its associated input.
   The .field-validation-valid class (empty state) stays invisible. */
.field-validation-error {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--sp-danger);
    margin-top: 0.375rem;
    line-height: 1.4;
}

.field-validation-valid {
    display: none;
}

/* Validation summary (model-level errors) — rendered as an .alert-danger at the
   top of the form. Hidden when the summary is empty so we don't show an empty
   alert shell. Unobtrusive / the tag helper toggle these classes automatically. */
.validation-summary-valid {
    display: none;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Invalid-field border applied by jQuery Unobtrusive and the asp-for
   server-side tag helper. */
.form-control.input-validation-error,
.form-select.input-validation-error {
    border-color: var(--sp-danger);
}

.form-control.input-validation-error:focus,
.form-select.input-validation-error:focus {
    border-color: var(--sp-danger);
    box-shadow: 0 0 0 0.2rem rgba(197, 48, 48, 0.15);
}

/* ------------------------------------------------------------
   7. ALERTS
   ------------------------------------------------------------ */
.alert {
    border: none;
    border-left: 3px solid;
    border-radius: var(--sp-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-danger {
    background-color: var(--sp-danger-bg);
    border-left-color: var(--sp-danger);
    color: var(--sp-danger);
}

.alert-success {
    background-color: var(--sp-success-bg);
    border-left-color: var(--sp-success);
    color: var(--sp-success);
}

.alert-warning {
    background-color: var(--sp-warning-bg);
    border-left-color: var(--sp-warning);
    color: var(--sp-warning);
}

.alert-info {
    background-color: var(--sp-info-bg);
    border-left-color: var(--sp-info);
    color: var(--sp-info);
}

/* ------------------------------------------------------------
   8. ACCORDION (FAQ)
   ------------------------------------------------------------ */
.accordion {
    --bs-accordion-border-color: var(--sp-neutral-200);
    --bs-accordion-border-radius: var(--sp-radius-lg);
    --bs-accordion-inner-border-radius: var(--sp-radius-lg);
    --bs-accordion-btn-padding-x: 1.25rem;
    --bs-accordion-btn-padding-y: 1rem;
    --bs-accordion-body-padding-x: 1.25rem;
    --bs-accordion-body-padding-y: 1rem;
    --bs-accordion-active-bg: var(--sp-neutral-50);
    --bs-accordion-active-color: var(--sp-neutral-900);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 3px rgba(var(--sp-accent-rgb), 0.12);
}

.accordion-button {
    font-family: var(--sp-font-family);
    font-weight: 600;
    font-size: var(--sp-body-size);
    color: var(--sp-neutral-800);
}

.accordion-button:not(.collapsed) {
    background-color: var(--sp-neutral-50);
    color: var(--sp-neutral-900);
    box-shadow: none;
}

.accordion-button::after {
    transition: transform var(--sp-transition-normal);
}

.accordion-body {
    color: var(--sp-neutral-600);
    font-size: 0.875rem;
    line-height: 1.7;
}

/* ------------------------------------------------------------
   9. AUTH LAYOUT
   ------------------------------------------------------------ */
.auth-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--sp-neutral-50);
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: #fff;
    border-radius: var(--sp-radius-xl);
    padding: 2.5rem;
    border: 1px solid var(--sp-neutral-200);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--sp-neutral-900);
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--sp-neutral-500);
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-footer {
    text-align: center;
    padding: 1.25rem 0;
    font-size: 0.75rem;
    color: var(--sp-neutral-400);
}

.auth-footer a {
    color: var(--sp-neutral-500);
}

/* ------------------------------------------------------------
   10. APP HEADER
   ------------------------------------------------------------ */
.app-header {
    background:
        linear-gradient(134deg, rgba(30, 30, 30, 0) 72%, rgba(20, 20, 20, 1) 92%),
        radial-gradient(circle at 12px 225px, rgba(0, 0, 0, 0) 10px, rgba(0, 0, 0, 0.25) 950px),
        radial-gradient(circle, rgba(50, 50, 50, 1) 0%, rgba(38, 38, 38, 1) 73%, rgba(30, 30, 30, 1) 100%);
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    min-width: 0;
}

.app-header-firm {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header-study {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-header-user {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
}

.app-header-logout {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--sp-radius-sm);
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    transition: all var(--sp-transition-fast);
}

.app-header-logout:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile header */
@media (max-width: 767.98px) {
    .app-header {
        padding: 0 1rem;
        height: 56px;
    }

    .app-header-firm {
        font-size: 0.9375rem;
    }

    .app-header-user {
        display: none;
    }
}

/* ------------------------------------------------------------
   11. INVESTIGATION LAYOUT (70/30 panes)
   ------------------------------------------------------------ */
.investigation-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 0;
    min-height: calc(100vh - 64px);
}

.investigation-main {
    padding: var(--sp-content-padding-y) var(--sp-content-padding-x);
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.investigation-main.is-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
}

.investigation-main.is-centered .intro-progress {
    justify-content: center;
}

.investigation-main.is-centered .intro-step-title {
    text-align: center;
}

.investigation-main.is-centered .intro-nav {
    justify-content: center;
}

.investigation-sidebar {
    border-left: 1px solid var(--sp-neutral-200);
    background-color: var(--sp-neutral-50);
}

.investigation-sidebar-inner {
    position: sticky;
    top: 64px;
    padding: var(--sp-content-padding-y) 2rem;
    max-height: calc(100vh - 64px);
    min-height: calc(100vh - 64px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}


@media (max-width: 991.98px) {
    .investigation-layout {
        grid-template-columns: 1fr;
    }

    .investigation-main {
        padding: 24px 16px;
    }

    .investigation-sidebar {
        display: none;
    }
}

@media (min-width: 1200px) {
    .investigation-layout {
        grid-template-columns: 1fr 510px;
    }

    .investigation-sidebar-inner {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

.no-header .investigation-layout {
    min-height: 100vh;
}

.no-header .investigation-sidebar-inner {
    top: 0;
    max-height: 100vh;
    min-height: 100vh;
}

/* ------------------------------------------------------------
   12. CREDIT ESTIMATE PANE
   ------------------------------------------------------------ */
.credit-estimate-pane {
    text-align: center;
}

.credit-estimate-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--sp-neutral-500);
    margin-bottom: 0.75rem;
}

.credit-estimate-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--sp-neutral-900);
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.credit-estimate-pending {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 0;
}

.credit-estimate-pending-text {
    font-size: 0.875rem;
    color: var(--sp-neutral-500);
    text-align: center;
    line-height: 1.5;
}

.credit-estimate-ongoing {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sp-neutral-500);
}

.credit-estimate-cta {
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(
        110deg,
        var(--sp-accent) 0%,
        var(--sp-accent) 40%,
        #3D4F51 50%,
        var(--sp-accent) 60%,
        var(--sp-accent) 100%
    );
    background-size: 250% 100%;
    animation: cta-shimmer 4s ease-in-out infinite;
}

.credit-estimate-cta:hover {
    background-image: linear-gradient(
        110deg,
        var(--sp-accent-hover) 0%,
        var(--sp-accent-hover) 40%,
        #2F3E40 50%,
        var(--sp-accent-hover) 60%,
        var(--sp-accent-hover) 100%
    );
}

@keyframes cta-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -50% 0; }
}

.credit-estimate-cta-wrap {
    margin-top: 2rem;
    position: relative;
}

.credit-estimate-cta-wrap .credit-estimate-cta {
    margin-top: 0;
}

.credit-estimate-cta-underline {
    display: none;
    width: 108%;
    height: 8px;
    margin: 4px auto 0;
    margin-left: -4%;
    transform: rotate(-1deg);
}

@media (min-width: 992px) {
    .credit-estimate-cta-underline {
        display: block;
    }
}

/* ------------------------------------------------------------
   13. STUDY LAYOUT (header + stepper + 70/30)
   ------------------------------------------------------------ */
.study-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 0;
    min-height: calc(100vh - 64px);
}

.study-main {
    display: flex;
    flex-direction: column;
}

.study-content {
    flex: 1;
    padding: var(--sp-content-padding-y) var(--sp-content-padding-x);
    max-width: 900px;
    margin: 0 auto;
}

.study-sidebar {
    border-left: 1px solid var(--sp-neutral-200);
    background-color: var(--sp-neutral-50);
}

.study-sidebar-inner {
    position: sticky;
    top: 64px;
    padding: var(--sp-content-padding-y) 2rem;
    max-height: calc(100vh - 64px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.study-footer-nav {
    border-top: 1px solid var(--sp-neutral-200);
    padding: 1.25rem 0;
    margin-top: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 991.98px) {
    .study-layout {
        grid-template-columns: 1fr;
    }

    .study-content {
        padding: 24px 16px;
    }

    .study-sidebar {
        display: none;
    }

    .study-footer-nav {
        padding: 1.25rem 0;
    }
}

@media (min-width: 1200px) {
    .study-layout {
        grid-template-columns: 1fr 540px;
    }

    .study-sidebar-inner {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

/* ------------------------------------------------------------
   14. HORIZONTAL STEPPER
   ------------------------------------------------------------ */
.study-stepper {
    padding: 1.25rem var(--sp-content-padding-x);
    border-bottom: 1px solid var(--sp-neutral-200);
    background: #fff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 900px;
    margin: 0 auto;
}

.study-stepper-track {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: max-content;
}

.study-stepper-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: default;
    white-space: nowrap;
}

.study-stepper-step + .study-stepper-step::before {
    content: '';
    display: block;
    width: 32px;
    height: 2px;
    background-color: var(--sp-neutral-200);
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.study-stepper-step.is-completed + .study-stepper-step::before {
    background-color: var(--sp-accent);
}

.study-stepper-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    transition: all var(--sp-transition-fast);
}

.study-stepper-step.is-upcoming .study-stepper-dot {
    background-color: var(--sp-neutral-200);
    color: var(--sp-neutral-500);
}

.study-stepper-step.is-current .study-stepper-dot {
    background-color: var(--sp-accent);
    color: #fff;
}

.study-stepper-step.is-completed .study-stepper-dot {
    background-color: var(--sp-accent);
    color: #fff;
}

.study-stepper-step.is-incomplete .study-stepper-dot {
    background-color: var(--sp-warning);
    color: #fff;
}

.study-stepper-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sp-neutral-500);
    transition: color var(--sp-transition-fast);
}

.study-stepper-step.is-current .study-stepper-label {
    color: var(--sp-neutral-900);
    font-weight: 600;
}

.study-stepper-step.is-completed .study-stepper-label {
    color: var(--sp-neutral-700);
}

.study-stepper-step.is-incomplete .study-stepper-label {
    color: var(--sp-warning);
    font-weight: 600;
}

.study-stepper-step.is-clickable {
    cursor: pointer;
}

.study-stepper-step.is-clickable:hover .study-stepper-label {
    color: var(--sp-accent);
}

@media (max-width: 767.98px) {
    .study-stepper {
        padding: 1rem 16px;
    }
}

/* SVG checkmark inside completed dots */
.study-stepper-check {
    width: 12px;
    height: 12px;
    stroke: #fff;
    stroke-width: 2.5;
    fill: none;
}

/* SVG warning inside incomplete dots */
.study-stepper-warn {
    width: 12px;
    height: 12px;
    fill: #fff;
}

/* ------------------------------------------------------------
   15. HELP PANE
   ------------------------------------------------------------ */
.help-pane-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-shrink: 0;
}

.help-pane-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--sp-neutral-900);
    margin-bottom: 0;
    letter-spacing: -0.015em;
}

/* Toast notification */
.chat-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 300;
    background: #fff;
    border: 1px solid var(--sp-neutral-200);
    border-radius: var(--sp-radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 1rem 1.25rem;
    max-width: 340px;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    cursor: pointer;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.chat-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.chat-toast-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
}

.chat-toast-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-toast-body {
    flex: 1;
    min-width: 0;
}

.chat-toast-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sp-neutral-900);
    margin-bottom: 0.125rem;
}

.chat-toast-text {
    font-size: 0.8125rem;
    color: var(--sp-neutral-600);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.chat-toast-close {
    background: none;
    border: none;
    color: var(--sp-neutral-400);
    cursor: pointer;
    padding: 0;
    font-size: 1.125rem;
    line-height: 1;
    flex-shrink: 0;
}

.chat-toast-close:hover {
    color: var(--sp-neutral-600);
}

.help-experts-card {
    background: #fff;
    border: 1px solid var(--sp-neutral-200);
    border-radius: var(--sp-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.help-experts-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--sp-neutral-900);
    margin-bottom: 0.25rem;
}

.help-experts-subtitle {
    font-size: 0.8125rem;
    color: var(--sp-neutral-500);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.help-experts-avatars {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.help-expert {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}

.help-expert-avatar {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 252, 252, 1) 0%, rgba(206, 215, 224, 1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.help-expert-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.help-expert-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--sp-neutral-600);
}

.help-ask-cta-wrap {
    position: relative;
}

.help-ask-cta-underline {
    display: block;
    width: 108%;
    height: 8px;
    margin: 4px auto 0;
    margin-left: -4%;
    transform: rotate(-1deg);
    animation: help-underline-fade 15s ease-out 30s forwards;
}

@keyframes help-underline-fade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.help-chat {
    background: #fff;
    border: 1px solid var(--sp-neutral-200);
    border-radius: var(--sp-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.help-chat-messages {
    padding: 1rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.help-chat-msg {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    max-width: 88%;
}

.help-chat-msg.is-them {
    align-self: flex-start;
}

.help-chat-msg.is-you {
    align-self: flex-end;
}

.help-chat-msg-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.help-chat-msg-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 252, 252, 1) 0%, rgba(206, 215, 224, 1) 100%);
}

.help-chat-msg-avatar-you {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--sp-accent);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
}

.help-chat-msg-content {
    min-width: 0;
}

.help-chat-msg-name {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--sp-neutral-500);
    margin-bottom: 0.125rem;
    padding-left: 0.75rem;
}

.help-chat-msg.is-you .help-chat-msg-name {
    text-align: right;
    padding-left: 0;
    padding-right: 0.75rem;
}

.help-chat-msg-bubble {
    font-size: 0.8125rem;
    line-height: 1.5;
    padding: 0.5rem 0.75rem;
    border-radius: 16px;
}

.help-chat-msg.is-them .help-chat-msg-bubble {
    background-color: var(--sp-neutral-100);
    color: var(--sp-neutral-800);
    border-bottom-left-radius: 4px;
}

.help-chat-msg.is-new .help-chat-msg-bubble {
    animation: msg-highlight 0.6s ease-in-out 3;
}

@keyframes msg-highlight {
    0%, 100% { background-color: var(--sp-neutral-100); }
    50% { background-color: #E8D9A0; }
}

.help-chat-msg.is-you .help-chat-msg-bubble {
    background-color: var(--sp-accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.help-chat-msg-time {
    font-size: 0.5625rem;
    color: var(--sp-neutral-400);
    margin-top: 0.25rem;
    padding: 0 0.75rem;
}

.help-chat-msg.is-you .help-chat-msg-time {
    text-align: right;
}

.help-chat-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--sp-neutral-100);
    background: var(--sp-neutral-50);
}

textarea.help-chat-field {
    font-size: 0.8125rem;
    resize: none;
    overflow-y: hidden;
    min-height: 0;
    max-height: 5.5rem;
    line-height: 1.5;
    padding: 0.5rem 0.75rem;
}

.help-chat-input-row textarea.form-control {
    height: 38px;
}

.help-chat-send {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--sp-accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color var(--sp-transition-fast);
}

.help-chat-send:hover {
    background-color: var(--sp-accent-hover);
}

.help-chat-send svg {
    width: 14px;
    height: 14px;
}

.help-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    text-align: center;
}

.help-chat-empty-icon {
    margin-bottom: 0.75rem;
}

.help-chat-empty-text {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--sp-neutral-500);
    margin-bottom: 0.25rem;
}

.help-chat-empty-hint {
    font-size: 0.875rem;
    color: var(--sp-neutral-400);
}

.help-chat-experts {
    margin-top: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

@media (max-height: 800px) {
    .help-chat-experts {
        display: none;
    }

    .study-sidebar-inner {
        justify-content: stretch;
    }
}

.help-chat-experts .help-experts-avatars {
    justify-content: center;
}

.help-chat-experts-text {
    font-size: 0.8125rem;
    color: var(--sp-neutral-500);
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* ------------------------------------------------------------
   16. INTRO WALKTHROUGH
   ------------------------------------------------------------ */
.intro-steps {
    position: relative;
    min-height: 300px;
    width: 100%;
    max-width: 560px;
}

.intro-step {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity var(--sp-transition-normal), transform var(--sp-transition-normal);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
}

.intro-step.is-active {
    opacity: 1;
    transform: translateX(0);
    position: relative;
    pointer-events: auto;
    width: 100%;
}

.intro-step.is-exiting {
    opacity: 0;
    transform: translateX(-20px);
}

.intro-highlight {
    position: relative;
    display: inline;
}

.intro-highlight::after {
    content: '';
    position: absolute;
    left: -4px;
    right: -4px;
    bottom: -6px;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6C40 4 80 7 130 5S200 4 258 6' fill='none' stroke='%23E8B931' stroke-width='3.5' stroke-linecap='round'/%3E%3Cpath d='M5 7C50 5 100 8 150 5S220 5 255 7' fill='none' stroke='%23E8B931' stroke-width='2.5' stroke-linecap='round' opacity='0.5'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    pointer-events: none;
}

.intro-step-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sp-neutral-900);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.intro-step-body {
    font-size: 0.9375rem;
    color: var(--sp-neutral-600);
    line-height: 1.7;
    max-width: 560px;
}

.intro-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    height: 28px;
}

.intro-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--sp-neutral-300);
    transition: all var(--sp-transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.intro-progress-num {
    display: none;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    line-height: 1;
}

.intro-progress-dot.is-active {
    width: 28px;
    height: 28px;
    background-color: var(--sp-accent);
}

.intro-progress-dot.is-active .intro-progress-num {
    display: block;
}

.intro-progress-dot.is-completed {
    background-color: var(--sp-accent);
    opacity: 0.4;
}

.intro-billing-check {
    background-color: var(--sp-neutral-50);
    border: 1px solid var(--sp-neutral-200);
    border-radius: var(--sp-radius-lg);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.intro-nav {
    display: flex;
    gap: 0.75rem;
    margin-top: 2.5rem;
}

.intro-nav .btn-primary {
    background-image: linear-gradient(
        110deg,
        var(--sp-accent) 0%,
        var(--sp-accent) 40%,
        #3D4F51 50%,
        var(--sp-accent) 60%,
        var(--sp-accent) 100%
    );
    background-size: 250% 100%;
    animation: cta-shimmer 4s ease-in-out infinite;
}

.intro-nav .btn-primary:hover {
    background-image: linear-gradient(
        110deg,
        var(--sp-accent-hover) 0%,
        var(--sp-accent-hover) 40%,
        #2F3E40 50%,
        var(--sp-accent-hover) 60%,
        var(--sp-accent-hover) 100%
    );
}

.intro-nav .btn-primary:disabled,
.intro-nav .btn-primary.disabled {
    background-color: var(--sp-neutral-400);
    background-image: none;
    border-color: var(--sp-neutral-400);
    animation: none;
}

/* ------------------------------------------------------------
   17. MOBILE DRAWER
   ------------------------------------------------------------ */
.mobile-drawer,
.mobile-drawer-overlay {
    display: none;
}

@media (max-width: 991.98px) {
    .mobile-drawer {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        background: #fff;
        border-top: 1px solid var(--sp-neutral-200);
        border-radius: var(--sp-radius-xl) var(--sp-radius-xl) 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
        transform: translateY(calc(100% - 56px));
        transition: transform 0.3s ease;
    }

    .mobile-drawer.is-expanded {
        transform: translateY(0);
    }

    .mobile-drawer-peek {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 56px;
        cursor: pointer;
        gap: 0.5rem;
        padding: 0 1.5rem;
    }

    .mobile-drawer-handle {
        width: 32px;
        height: 4px;
        border-radius: 2px;
        background-color: var(--sp-neutral-300);
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
    }

    .mobile-drawer-peek-text {
        font-size: 0.8125rem;
        font-weight: 600;
        color: var(--sp-neutral-700);
    }

    .mobile-drawer-peek-value {
        font-size: 0.8125rem;
        font-weight: 700;
        color: var(--sp-neutral-900);
    }

    .mobile-drawer-content {
        padding: 0 1.5rem 1.5rem;
        max-height: 60vh;
        overflow-y: auto;
    }

    .mobile-drawer-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 199;
    }

    .mobile-drawer-overlay.is-visible {
        display: block;
    }

    /* Add padding to body to account for peek bar */
    .has-mobile-drawer {
        padding-bottom: 64px;
    }
}

/* ------------------------------------------------------------
   18. STUDY QUESTION PATTERNS (placeholder)
   ------------------------------------------------------------ */
.question-group {
    margin-bottom: var(--sp-field-gap);
}

.question-group:last-child {
    margin-bottom: 0;
}

/* When a question-group is wrapped in a Bootstrap col (e.g. side-by-side pair),
   it's always :last-child of its col — restore its natural field-gap margin so
   the row still creates space below. */
[class*="col-"] > .question-group:last-child {
    margin-bottom: var(--sp-field-gap);
}

.question-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--sp-neutral-800);
    margin-bottom: 0.5rem;
}

.question-helper {
    font-size: 0.75rem;
    color: var(--sp-neutral-400);
    margin-bottom: 0.625rem;
}

/* Skipped field indicator */
.question-skipped {
    border-left: 3px solid var(--sp-warning);
    padding-left: 1rem;
}

.question-skipped-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--sp-warning);
    background-color: var(--sp-warning-bg);
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    margin-bottom: 0.375rem;
}

/* Editorial section opener — used on long multi-section pages (e.g. Study Setup)
   where the h6 micro-label is too quiet to signal structure. Pairs a thin top
   rule with a numbered accent label and a full-size h2 title. */
.study-section-header {
    border-top: 1px solid var(--sp-neutral-200);
    padding-top: 1.75rem;
    margin-bottom: 1.5rem;
}

.study-section-title {
    margin: 0;
}

.study-section-description {
    font-size: 0.9375rem;
    color: var(--sp-neutral-500);
    line-height: 1.55;
    margin: 0.5rem 0 0;
    max-width: 640px;
}

/* Section intro paragraph — contextual text that leads a section before its fields.
   Slightly warmer than body to distinguish from form labels and field values. */
.section-intro {
    font-size: 0.9375rem;
    color: var(--sp-neutral-600);
    line-height: 1.6;
    max-width: 640px;
    margin-bottom: 1rem;
}

.section-intro:last-child {
    margin-bottom: 0;
}

/* Answer-field pattern — a question whose answer is set via a modal rather than
   typed inline. A label sits above a row that pairs a readonly input with a
   right-aligned action button. An optional header can sit above the label (e.g.
   the starting date for an ownership structure field). */
.question-answer-field {
    margin-bottom: var(--sp-field-gap);
}

.question-answer-field:last-child {
    margin-bottom: 0;
}

.question-answer-field-header {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--sp-neutral-500);
    margin-bottom: 0.5rem;
}

.question-answer-field-row {
    display: flex;
    align-items: stretch;
}

.question-answer-field-row .form-control[readonly] {
    cursor: pointer;
    transition: background-color var(--sp-transition-fast);
}

.question-answer-field-row .form-control[readonly]:hover {
    background-color: var(--sp-neutral-100);
}

.question-answer-field-row .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Desktop: input and button sit flush against each other as a single unit.
   The input loses its right border/radius so the button's accent surface
   takes over cleanly at the seam. */
@media (min-width: 576px) {
    .question-answer-field-row .form-control {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        border-right: 0;
    }

    .question-answer-field-row .btn {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }
}

@media (max-width: 575.98px) {
    .question-answer-field-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .question-answer-field-row .btn {
        align-self: stretch;
    }
}

/* Credit compare — sits beneath scope questions to reflect the current credit
   estimate. Starts with a single value; if the user reduces scope, the original
   value is shown with a strikethrough above the reduced figure. */
.credit-compare {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    background-color: var(--sp-neutral-50);
    border-radius: var(--sp-radius-lg);
    margin-top: 0.5rem;
}

.credit-compare-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sp-neutral-500);
    margin-bottom: 0.375rem;
}

/* The struck "maximum" credit (full study across every offered year). Only
   rendered when the current selection is actually below it — see the
   data-state rule below. */
.credit-compare-struck {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--sp-neutral-400);
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    line-height: 1.15;
}

/* The current (possibly reduced) credit estimate. */
.credit-compare-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sp-neutral-900);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

/* The struck maximum only appears when the widget is in the reduced state. */
.credit-compare:not([data-state="reduced"]) .credit-compare-struck {
    display: none;
}

/* Qualitative fallback line — used in place of dollar figures when the study
   has no estimates yet but the user has reduced scope/depth. */
.credit-compare-message {
    font-size: 1rem;
    font-weight: 500;
    color: var(--sp-neutral-800);
    line-height: 1.3;
}

/* Provisional-estimate caveat shown beneath the value when one or more selected
   years are still being estimated. */
.credit-compare-pending {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--sp-neutral-500);
    letter-spacing: -0.005em;
}

.credit-compare-pending[hidden] {
    display: none;
}

/* `display: inline-flex` on .credit-compare overrides the browser default for
   `[hidden]`, so we restate it. */
.credit-compare[hidden] {
    display: none;
}

/* Modal variant — spans full width and stays consistent with the page version. */
.credit-compare.credit-compare--modal {
    display: flex;
    width: 100%;
    margin-top: 1.25rem;
}

.credit-compare.credit-compare--modal[hidden] {
    display: none;
}

.credit-compare.credit-compare--modal .credit-compare-struck {
    font-size: 1.125rem;
}

.credit-compare.credit-compare--modal .credit-compare-value {
    font-size: 1.5rem;
}

/* Claim period note — soft marginalia that appears below the year-chip group
   when one or more selected chips carry data-assumed="true". Quiet amber tint
   (picking up --sp-warning without adopting its alert register), left rule,
   hand-drawn asterisk glyph. Reveal on data-visible="true". */
.claim-period-note {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 0.75rem;
    border-radius: var(--sp-radius-md);
    border-left: 3px solid var(--sp-warning);
    background: linear-gradient(
        180deg,
        rgba(247, 237, 213, 0.55) 0%,
        rgba(255, 255, 240, 0.70) 100%
    );
    opacity: 0;
    transform: translateY(-3px);
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    padding: 0 1rem 0 0.9375rem;
    transition:
        opacity 220ms ease,
        transform 220ms ease,
        max-height 220ms ease,
        margin-top 220ms ease,
        padding-top 220ms ease,
        padding-bottom 220ms ease;
}

.claim-period-note[data-visible="true"] {
    opacity: 1;
    transform: translateY(0);
    max-height: 220px;
    margin-top: 1.25rem;
    padding-top: 0.875rem;
    padding-bottom: 0.9375rem;
}

.claim-period-note-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: rgba(183, 121, 31, 0.12);
    color: var(--sp-warning);
    margin-top: 1px;
    transform: rotate(-6deg);
    flex-shrink: 0;
}

.claim-period-note-mark svg {
    width: 15px;
    height: 15px;
    display: block;
}

.claim-period-note-body {
    min-width: 0;
}

.claim-period-note-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sp-warning);
    margin-bottom: 0.1875rem;
}

.claim-period-note-text {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--sp-neutral-700);
}

.claim-period-note-text strong {
    color: var(--sp-neutral-900);
    font-weight: 600;
}

/* Role chip group — alternative to inline checkboxes for multi-select role. */
.role-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.role-chip {
    appearance: none;
    border: 1px solid var(--sp-neutral-300);
    background-color: #fff;
    color: var(--sp-neutral-700);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: border-color var(--sp-transition-fast),
                background-color var(--sp-transition-fast),
                color var(--sp-transition-fast);
}

.role-chip:hover {
    border-color: var(--sp-neutral-400);
    background-color: var(--sp-neutral-50);
}

.role-chip[aria-pressed="true"] {
    background-color: var(--sp-accent);
    border-color: var(--sp-accent);
    color: #fff;
}

.role-chip[aria-pressed="true"]:hover {
    background-color: var(--sp-accent-hover);
    border-color: var(--sp-accent-hover);
}

/* Chip indicator — the SVG footprint is always present to keep the chip size
   stable; the inner plus/tick paths cross-fade on toggle. Plus is a quiet
   neutral placeholder; tick inherits the pressed chip's white text color. */
.role-chip-check {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.role-chip-icon-plus {
    stroke: var(--sp-neutral-400);
    transition: opacity var(--sp-transition-fast), stroke var(--sp-transition-fast);
}

.role-chip-icon-tick {
    opacity: 0;
    transition: opacity var(--sp-transition-fast);
}

.role-chip:hover .role-chip-icon-plus {
    stroke: var(--sp-neutral-500);
}

.role-chip[aria-pressed="true"] .role-chip-icon-plus {
    opacity: 0;
}

.role-chip[aria-pressed="true"] .role-chip-icon-tick {
    opacity: 1;
}

/* ============================================================
   R&D Projects — card list + editor modal layout
   Used on the Yearly Questionnaire page. Cards render from JS
   state; the modal is shared between add and edit modes.
   ============================================================ */

/* Empty-state call-to-action. Dashed border signals "nothing
   here yet" without feeling as heavy as a solid panel. */
.rd-projects-empty {
    background-color: var(--sp-neutral-50);
    border: 1px dashed var(--sp-neutral-200);
    border-radius: var(--sp-radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
}

.rd-projects-empty-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--sp-neutral-800);
    margin-bottom: 1.25rem;
}

/* Populated card list. Gap between cards keeps them distinct
   without overpadding. */
.rd-projects-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rd-projects-add-more {
    margin-top: 0.875rem;
}

/* Individual project summary card — clickable. Hover lifts the
   border subtly and shifts the surface to invite the click. */
.rd-project-card {
    background-color: var(--sp-neutral-50);
    border: 1px solid var(--sp-neutral-100);
    border-radius: var(--sp-radius-lg);
    padding: 1.125rem 1.25rem;
    cursor: pointer;
    transition: border-color var(--sp-transition-fast),
                background-color var(--sp-transition-fast);
}

.rd-project-card:hover {
    border-color: var(--sp-neutral-300);
    background-color: var(--sp-neutral-100);
}

.rd-project-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sp-neutral-900);
    line-height: 1.3;
    word-break: break-word;
}

.rd-project-card-meta {
    font-size: 0.8125rem;
    color: var(--sp-neutral-500);
    margin-top: 0.125rem;
    line-height: 1.4;
}

.rd-project-card-description {
    font-size: 0.875rem;
    color: var(--sp-neutral-700);
    margin: 0.625rem 0 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rd-project-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.75rem;
}

/* Small pill tags on the card for contracting flags. */
.rd-project-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--sp-neutral-700);
    background-color: var(--sp-accent-subtle);
    padding: 0.1875rem 0.625rem;
    border-radius: 999px;
    line-height: 1.5;
}

/* Modal intended-outcome sentence: prefix text + inline chip
   group. Flex-wraps cleanly on narrower widths. */
.rd-project-outcome-sentence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem 0.75rem;
    margin-top: 0.5rem;
}

.rd-project-outcome-prefix {
    font-size: 0.9375rem;
    color: var(--sp-neutral-700);
    font-weight: 500;
}

/* Subtle destructive action inside the editor modal footer.
   Neutral by default, turns danger-red on hover so the user
   has to deliberately engage before committing. */
.rd-project-delete-btn {
    color: var(--sp-neutral-500);
    background: transparent;
    border: none;
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
    margin-right: auto;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--sp-transition-fast);
}

.rd-project-delete-btn:hover {
    color: var(--sp-danger);
}

/* ------------------------------------------------------------
   19. DOCUMENT UPLOAD
   ------------------------------------------------------------ */
/* One section per DocumentBatchInput on the Documents page. Always rendered
   with its own header, even when the page has only one section. */
.doc-section {
    margin-bottom: 2.5rem;
}

.doc-section:last-of-type {
    margin-bottom: 0;
}

/* Top-rule divider between sections — same treatment as `.study-section-header`
   on the Questionnaire page so long multi-year doc lists have visible
   section breaks. Adjacent-sibling selector keeps the first section flush. */
.doc-section + .doc-section {
    border-top: 1px solid var(--sp-neutral-200);
    padding-top: 1.75rem;
}

.doc-section-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--sp-neutral-900);
    margin: 0 0 0.375rem;
    letter-spacing: -0.005em;
}

.doc-section-description {
    font-size: 0.875rem;
    color: var(--sp-neutral-500);
    line-height: 1.55;
    margin: 0 0 1rem;
}

.doc-upload-zone {
    border: 2px dashed var(--sp-neutral-300);
    border-radius: var(--sp-radius-md);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--sp-transition-fast), background-color var(--sp-transition-fast);
    /* 402px = 50% of .study-content's 804px inner width (900px max-width − 96px padding). */
    max-width: 402px;
}

.doc-upload-zone:hover {
    border-color: var(--sp-accent);
    background-color: var(--sp-accent-subtle);
}

.doc-upload-icon {
    width: 32px;
    height: 32px;
    color: var(--sp-neutral-400);
    margin-bottom: 0.5rem;
}

.doc-upload-text {
    font-size: 0.8125rem;
    color: var(--sp-neutral-500);
}

.doc-upload-text strong {
    color: var(--sp-accent);
    font-weight: 600;
}

/* Drop-zone visual feedback during a drag operation. */
.doc-upload-zone.is-dragover {
    border-color: var(--sp-accent);
    background-color: var(--sp-accent-subtle);
}

/* Inline error banner shown beneath the upload zone. */
.doc-upload-error {
    margin-top: 0.625rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--sp-radius-md);
    background-color: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: #B91C1C;
    font-size: 0.8125rem;
    line-height: 1.45;
}

/* File list — uploading rows on top, then uploaded rows. */
.doc-file-list {
    max-width: 402px;
}

/* Bottom margin only when there's an actual file row above the drop zone —
   keeps the description-to-drop-zone gap tight on empty sections. */
.doc-file-list:has(.doc-file-row) {
    margin-bottom: 0.875rem;
}

.doc-file-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--sp-neutral-200);
    border-radius: var(--sp-radius-md);
    background-color: #fff;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.doc-file-row:last-child {
    margin-bottom: 0;
}

.doc-file-icon {
    color: var(--sp-neutral-500);
    display: inline-flex;
}

.doc-file-name {
    flex: 1;
    color: var(--sp-neutral-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-file-download {
    background: transparent;
    border: none;
    color: var(--sp-neutral-400);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.doc-file-download:hover {
    color: var(--sp-accent);
    background-color: var(--sp-neutral-100);
}

.doc-file-delete {
    background: transparent;
    border: none;
    color: var(--sp-neutral-400);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--sp-transition-fast), background-color var(--sp-transition-fast);
}

.doc-file-delete:hover {
    color: #B91C1C;
    background-color: #FEF2F2;
}

/* Uploading row: spinner + horizontal progress bar replacing the delete button. */
.doc-file-row.is-uploading {
    background-color: var(--sp-neutral-50);
}

.doc-file-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--sp-neutral-300);
    border-top-color: var(--sp-accent);
    border-radius: 50%;
    animation: doc-file-spinner-spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes doc-file-spinner-spin {
    to { transform: rotate(360deg); }
}

.doc-file-progress-bar {
    flex: 0 0 100px;
    height: 4px;
    background-color: var(--sp-neutral-200);
    border-radius: 2px;
    overflow: hidden;
}

.doc-file-progress-bar-fill {
    height: 100%;
    width: 0%;
    background-color: var(--sp-accent);
    transition: width 100ms linear;
}

/* Per-section status flags (mutually exclusive in JS). Sit immediately under
   the upload zone with a small gap so they read as part of the same batch. */
.doc-section-flags {
    margin-top: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.doc-section-flags .form-check-label {
    font-size: 0.875rem;
    color: var(--sp-neutral-700);
    cursor: pointer;
}

/* Brief "Saved" confirmation next to the checkbox label. Real-time saves
   feel inherently instant; this short fade is just a visible receipt. */
.doc-flag-saved {
    margin-left: 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--sp-success);
    opacity: 0;
    transition: opacity 200ms ease;
}

.doc-flag-saved.is-visible {
    opacity: 1;
}

/* ------------------------------------------------------------
   20. FOOTER
   ------------------------------------------------------------ */
.app-footer {
    text-align: center;
    padding: 1.25rem 0;
    font-size: 0.6875rem;
    color: var(--sp-neutral-400);
    letter-spacing: 0.02em;
}

.app-footer a {
    color: var(--sp-neutral-500);
}

/* ------------------------------------------------------------
   21. STUDY OVERVIEW HUB
   ------------------------------------------------------------ */
.study-overview {
    font-feature-settings: "tnum";
}

.study-overview-header {
    margin-bottom: 32px;
}

.study-overview-eyebrow {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--sp-neutral-500);
    font-weight: 500;
    margin-bottom: 6px;
}

.study-overview-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
    color: var(--sp-neutral-900);
}

.study-overview-progress {
    font-size: 0.875rem;
    color: var(--sp-neutral-500);
}

.study-overview-progress strong {
    color: var(--sp-neutral-900);
    font-weight: 600;
}

/* ---- Resume hero ---- */
.study-overview-resume {
    background: var(--sp-accent);
    color: #fff;
    border-radius: var(--sp-radius-xl);
    padding: 28px 32px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 28px;
    text-decoration: none;
    transition: background-color var(--sp-transition-fast);
}

.study-overview-resume:hover {
    background: var(--sp-accent-hover);
    color: #fff;
}

.study-overview-resume::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -10%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.study-overview-resume-text {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.study-overview-resume-eyebrow {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    opacity: 0.6;
    font-weight: 500;
    margin-bottom: 10px;
}

.study-overview-resume-title {
    font-size: 1.4375rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin-bottom: 6px;
}

.study-overview-resume-sub {
    font-size: 0.9375rem;
    opacity: 0.7;
    line-height: 1.5;
    max-width: 380px;
}

.study-overview-resume-meta {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    opacity: 0.55;
}

.study-overview-resume-meta-dot {
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.7;
}

.study-overview-resume-cta {
    background: #fff;
    color: var(--sp-accent);
    border-radius: 999px;
    padding: 13px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: transform var(--sp-transition-fast);
    position: relative;
    z-index: 1;
}

.study-overview-resume:hover .study-overview-resume-cta {
    transform: translateY(-1px);
}

.study-overview-resume-cta svg {
    transition: transform 200ms ease;
}

.study-overview-resume:hover .study-overview-resume-cta svg {
    transform: translateX(2px);
}

/* ---- Section bands (collapsible groups) ---- */
.study-overview-band {
    background: var(--sp-neutral-50);
    border: 1px solid var(--sp-neutral-200);
    border-radius: var(--sp-radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
    transition: border-color var(--sp-transition-fast);
}

.study-overview-band:hover {
    border-color: var(--sp-neutral-300);
}

.study-overview-band[open] {
    border-color: var(--sp-neutral-300);
}

.study-overview-band-head {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.study-overview-band-head::-webkit-details-marker {
    display: none;
}

.study-overview-band-titles {
    min-width: 0;
}

.study-overview-band-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sp-neutral-900);
    margin: 0 0 2px;
}

.study-overview-band-sub {
    font-size: 0.8125rem;
    color: var(--sp-neutral-500);
}

.study-overview-band-count {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sp-neutral-700);
    white-space: nowrap;
}

.study-overview-band-count strong {
    color: var(--sp-neutral-900);
    font-weight: 600;
}

.study-overview-chev {
    color: var(--sp-neutral-400);
    transition: transform 200ms ease, color var(--sp-transition-fast);
}

.study-overview-band[open] .study-overview-chev {
    transform: rotate(180deg);
    color: var(--sp-neutral-700);
}

.study-overview-band-body {
    border-top: 1px solid var(--sp-neutral-200);
    background: #fff;
    padding: 6px 0;
}

/* ---- Step rows ---- */
.study-overview-row {
    display: grid;
    grid-template-columns: 32px 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    text-decoration: none;
    color: inherit;
    transition: background-color var(--sp-transition-fast);
}

.study-overview-row:hover {
    background: var(--sp-neutral-50);
    color: inherit;
}

.study-overview-row + .study-overview-row {
    border-top: 1px solid var(--sp-neutral-100);
}

.study-overview-row-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.study-overview-row-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.study-overview-row-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--sp-neutral-900);
    margin-bottom: 2px;
}

.study-overview-row-meta {
    font-size: 0.8125rem;
    color: var(--sp-neutral-500);
}

.study-overview-row-state {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--sp-neutral-500);
    white-space: nowrap;
}

.study-overview-row-state.is-progress {
    color: var(--sp-accent);
}

.study-overview-row-state.is-done {
    color: var(--sp-success);
}

.study-overview-row-arrow {
    color: var(--sp-neutral-300);
    transition: color var(--sp-transition-fast), transform var(--sp-transition-fast);
}

.study-overview-row:hover .study-overview-row-arrow {
    color: var(--sp-neutral-700);
    transform: translateX(2px);
}

/* ---- Status icons ---- */
.study-overview-icon-done {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--sp-success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.study-overview-icon-current {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--sp-accent);
    border: 3px solid var(--sp-accent-subtle);
    box-sizing: border-box;
}

.study-overview-icon-not-started {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--sp-neutral-300);
    background: #fff;
    box-sizing: border-box;
}

/* Resume hero stacks on narrow viewports so the CTA never wraps under the title. */
@media (max-width: 575.98px) {
    .study-overview-resume {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .study-overview-resume-cta {
        justify-self: start;
    }

    .study-overview-row {
        grid-template-columns: 24px 1fr auto;
        padding: 14px 18px;
        gap: 12px;
    }

    .study-overview-row-state {
        display: none;
    }
}

/* ---- Footer panel: Save Progress / Submit Study ----
   Sits below the section bands. Quiet stone card while the study is in progress
   (Save Progress); flips to a louder accent treatment when ready to submit. */
.study-overview-footer-panel {
    background: var(--sp-neutral-50);
    border: 1px solid var(--sp-neutral-200);
    border-radius: var(--sp-radius-lg);
    padding: 28px 32px;
    margin-top: 32px;
    text-align: center;
}

.study-overview-footer-panel.is-submit {
    background: var(--sp-accent-subtle);
    border-color: var(--sp-accent);
}

.study-overview-footer-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sp-neutral-900);
    margin: 0 0 16px;
}

.study-overview-footer-panel.is-submit .study-overview-footer-title {
    font-size: 1.125rem;
    color: var(--sp-accent);
}

.study-overview-footer-text {
    font-size: 0.875rem;
    color: var(--sp-neutral-600);
    max-width: 620px;
    margin: -8px auto 16px;
}

/* ---- Study notice ----
   Inline explanation card for derived, non-dismissible messages (e.g. "your
   tax year has closed"). Same stone card as the footer panel with an accent
   rule so it reads as information, not an alert. Dismissible messages use a
   modal instead (see the study-period-updated modal on Overview). */
.study-notice {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    background: var(--sp-neutral-50);
    border: 1px solid var(--sp-neutral-200);
    border-left: 3px solid var(--sp-accent);
    border-radius: var(--sp-radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.study-notice-body {
    flex: 1 1 auto;
    min-width: 0;
}

.study-notice-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sp-neutral-900);
    margin: 0 0 6px;
}

.study-notice-text {
    font-size: 0.875rem;
    color: var(--sp-neutral-600);
    margin: 0;
}

@media (max-width: 575.98px) {
    .study-notice {
        flex-direction: column;
        gap: 12px;
    }
}

/* ---- Current-year study: documents preview ----
   Compact read-only stand-in for the Documents band while the year is open:
   one card, the document names on a single line. Same stone chrome
   as the bands, no rows and nothing clickable. */
.study-overview-preview {
    background: var(--sp-neutral-50);
    border: 1px solid var(--sp-neutral-200);
    border-radius: var(--sp-radius-lg);
    padding: 18px 24px;
    margin-bottom: 16px;
}

.study-overview-preview-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sp-neutral-900);
    margin: 0 0 6px;
}

.study-overview-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sp-neutral-700);
}

.study-overview-preview-sep {
    color: var(--sp-neutral-400);
}

/* ---- Processing status page (post-submit holding state) ----
   Visual parallel to .study-overview-* but quieter — no clickable rows,
   no progress meter. The page is read-only until the user clicks Revise. */
.study-processing {
    max-width: 720px;
}

.study-processing-header {
    margin-bottom: 2.5rem;
}

.study-processing-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sp-neutral-500);
    margin-bottom: 0.5rem;
}

.study-processing-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sp-neutral-900);
    margin: 0 0 1rem;
    letter-spacing: -0.015em;
}

.study-processing-lead {
    font-size: 1rem;
    color: var(--sp-neutral-700);
    line-height: 1.6;
    margin: 0;
}

.study-processing-summary {
    border: 1px solid var(--sp-neutral-200);
    border-radius: var(--sp-radius-md);
    background-color: #fff;
    padding: 1.5rem 1.75rem;
    margin-bottom: 2rem;
}

.study-processing-summary-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--sp-neutral-900);
    margin: 0 0 1.25rem;
}

.study-processing-summary-grid {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.625rem;
}

.study-processing-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.study-processing-summary-row dt {
    color: var(--sp-neutral-500);
    font-size: 0.9375rem;
    font-weight: 400;
}

.study-processing-summary-row dd {
    color: var(--sp-neutral-900);
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0;
    text-align: right;
}

.study-processing-footer-sub {
    color: var(--sp-neutral-600);
    font-size: 0.9375rem;
    line-height: 1.5;
    margin: 0.5rem 0 1.25rem;
}

/* ---- Back-to-overview link (used on Setup, Yearly, Documents sub-pages) ---- */
.study-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sp-neutral-500);
    text-decoration: none;
    padding: 4px 8px 4px 0;
    margin-bottom: 16px;
    transition: color var(--sp-transition-fast);
}

.study-back-link:hover {
    color: var(--sp-neutral-900);
}

.study-back-link svg {
    transition: transform var(--sp-transition-fast);
}

.study-back-link:hover svg {
    transform: translateX(-2px);
}

/* ------------------------------------------------------------
   21a. STUDY COMPLETED (post-Active landing page)
   ------------------------------------------------------------
   Shown on AwaitingElection, PreparingTaxForms, AwaitingFiling,
   and Filed — replaces the Overview hub once the user has no
   further editing to do. Visual order:
     • Charcoal completion hero (announcement + date)
     • Light credit determination card (eyebrow + amount + bullets)
     • Quiet hand-off callout (AwaitingElection only)
   Future: deliverable-documents block lands here on
   AwaitingFiling/Filed. */
.study-completed {
	max-width: 720px;
}

/* ---- Hero — charcoal announcement block ---- */
.study-completed-hero {
	position: relative;
	overflow: hidden;
	background: linear-gradient( 135deg, var(--sp-accent) 0%, var(--sp-accent-light) 100% );
	color: #fff;
	border-radius: var(--sp-radius-lg);
	padding: 2.25rem 2.25rem 2.5rem;
	margin-bottom: 1.75rem;
	box-shadow: 0 1px 0 rgba( 0, 0, 0, 0.04 ), 0 8px 24px rgba( 45, 52, 54, 0.08 );
}

/* Warm spotlight in the upper-right corner — the only place the
   highlighter yellow shows up in this hero, just enough to suggest
   a sun on the page. */
.study-completed-hero-glow {
	position: absolute;
	top: -140px;
	right: -120px;
	width: 360px;
	height: 360px;
	background: radial-gradient( circle, rgba( 232, 185, 49, 0.20 ) 0%, transparent 62% );
	pointer-events: none;
}

.study-completed-hero-top {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.study-completed-hero-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #E8B931;
	color: var(--sp-accent);
	box-shadow: 0 0 0 4px rgba( 232, 185, 49, 0.18 );
}

.study-completed-hero-check svg {
	width: 18px;
	height: 18px;
}

.study-completed-hero-date {
	font-size: 0.6875rem;
	letter-spacing: 0.20em;
	text-transform: uppercase;
	color: rgba( 255, 255, 255, 0.58 );
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.study-completed-hero-title {
	position: relative;
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.025em;
	margin: 0;
	color: #fff;
}

.study-completed-hero-sub {
	position: relative;
	font-size: 1rem;
	color: rgba( 255, 255, 255, 0.72 );
	margin: 0.5rem 0 0;
	line-height: 1.55;
}

/* ---- Final Credit Determination card ---- */
.study-completed-credit {
	background: #fff;
	border: 1px solid var(--sp-neutral-200);
	border-radius: var(--sp-radius-lg);
	padding: 2.25rem 2.25rem 2rem;
	margin-bottom: 1.5rem;
}

.study-completed-credit-eyebrow {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--sp-neutral-500);
	margin-bottom: 1rem;
}

.study-completed-credit-amount {
	position: relative;
	display: inline-block;
	margin-bottom: 1.75rem;
	padding-bottom: 0.35rem;
}

.study-completed-credit-amount-value {
	position: relative;
	z-index: 1;
	display: inline-block;
	font-size: 3.75rem;
	font-weight: 700;
	color: var(--sp-neutral-900);
	letter-spacing: -0.04em;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

/* Hand-drawn highlighter swipe under the dollar amount. Sits behind
   the number (z-index: 0 vs 1). Matches the `.intro-highlight` SVG
   treatment elsewhere — gentle curve, organic stroke. */
.study-completed-credit-highlighter {
	position: absolute;
	left: -2%;
	right: -6%;
	bottom: -0.1rem;
	width: 108%;
	height: 14px;
	z-index: 0;
}

.study-completed-credit-narrative {
	font-size: 1rem;
	line-height: 1.65;
	color: var(--sp-neutral-700);
	margin: 0 0 1.5rem;
	max-width: 36em;
}

.study-completed-credit-narrative strong {
	color: var(--sp-neutral-900);
	font-weight: 600;
}

.study-completed-credit-methods {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 0.5rem;
}

.study-completed-credit-methods li {
	display: flex;
	align-items: flex-start;
	gap: 0.85rem;
	font-size: 0.9375rem;
	color: var(--sp-neutral-800);
	line-height: 1.55;
	padding: 0.3rem 0;
}

.study-completed-credit-methods-mark {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--sp-success-bg);
	color: var(--sp-success);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 1px;
}

.study-completed-credit-methods-mark svg {
	width: 12px;
	height: 12px;
}

/* ---- Hand-off message (AwaitingElection only) ---- */
.study-completed-handoff {
	position: relative;
	background: var(--sp-neutral-50);
	border: 1px solid var(--sp-neutral-200);
	border-left: 3px solid var(--sp-accent);
	border-radius: 0 var(--sp-radius-md) var(--sp-radius-md) 0;
	padding: 1.25rem 1.5rem;
}

.study-completed-handoff-eyebrow {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--sp-neutral-500);
	margin-bottom: 0.5rem;
}

.study-completed-handoff-body {
	font-size: 0.9375rem;
	color: var(--sp-neutral-700);
	line-height: 1.6;
	margin: 0;
}

.study-completed-handoff-body strong {
	color: var(--sp-neutral-900);
	font-weight: 600;
}

/* ---- Staggered reveal on first paint ---- */
.study-completed > * {
	opacity: 0;
	transform: translateY( 10px );
	animation: study-completed-rise 0.55s cubic-bezier( 0.2, 0.7, 0.3, 1 ) forwards;
}

.study-completed > *:nth-child(1) { animation-delay: 0.05s; }
.study-completed > *:nth-child(2) { animation-delay: 0.18s; }
.study-completed > *:nth-child(3) { animation-delay: 0.30s; }
.study-completed > *:nth-child(4) { animation-delay: 0.42s; }

@keyframes study-completed-rise {
	to {
		opacity: 1;
		transform: translateY( 0 );
	}
}

/* Respect users who've asked for reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.study-completed > * {
		animation: none;
		opacity: 1;
		transform: none;
	}
}

/* ---- Deliverable documents (AwaitingFiling / Filed) ---- */
.study-completed-docs {
	margin-top: 2.5rem;
	padding: 2.25rem 2.5rem;
	background: #fff;
	border: 1px solid var(--sp-neutral-200);
	border-radius: var(--sp-radius-xl);
}

.study-completed-docs-eyebrow {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--sp-neutral-500);
	margin-bottom: 0.5rem;
}

.study-completed-docs-intro {
	font-size: 0.95rem;
	color: var(--sp-neutral-600);
	margin-bottom: 1.75rem;
}

.study-completed-docs-group + .study-completed-docs-group {
	margin-top: 2rem;
}

.study-completed-docs-company {
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--sp-neutral-900);
	margin: 0 0 0.875rem;
	padding-bottom: 0.625rem;
	border-bottom: 1px solid var(--sp-neutral-200);
}

.study-completed-docs-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.study-completed-docs-item {
	display: flex;
	align-items: center;
	gap: 0.875rem;
	padding: 0.875rem 0;
	border-bottom: 1px solid var(--sp-neutral-100);
}

.study-completed-docs-item:last-child {
	border-bottom: none;
}

.study-completed-docs-item-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: var(--sp-radius-md);
	background: var(--sp-accent-subtle);
	color: var(--sp-accent);
}

.study-completed-docs-item-icon svg {
	width: 20px;
	height: 20px;
}

.study-completed-docs-item-text {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	flex: 1 1 auto;
	min-width: 0;
}

.study-completed-docs-item-title {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--sp-neutral-900);
}

.study-completed-docs-item-year {
	font-size: 0.8125rem;
	color: var(--sp-neutral-500);
}

.study-completed-docs-item-actions {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	flex-shrink: 0;
}

.study-completed-docs-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: var(--sp-radius-md);
	color: var(--sp-neutral-500);
	transition: background-color 0.15s ease, color 0.15s ease;
}

.study-completed-docs-action:hover {
	background: var(--sp-accent-subtle);
	color: var(--sp-accent);
}

.study-completed-docs-action svg {
	width: 19px;
	height: 19px;
}

@media (max-width: 575.98px) {
	.study-completed-hero,
	.study-completed-credit {
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}
	.study-completed-hero-title {
		font-size: 1.625rem;
	}
	.study-completed-credit-amount-value {
		font-size: 2.625rem;
	}
	.study-completed-docs {
		padding: 1.75rem 1.5rem;
	}
}

/* ------------------------------------------------------------
   22. RESPONSIVE ADJUSTMENTS
   ------------------------------------------------------------ */
@media (max-width: 575.98px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .auth-card {
        padding: 1.75rem;
    }

    .intro-step-title {
        font-size: 1.25rem;
    }

    .credit-estimate-value {
        font-size: 1.75rem;
    }
}
