/* ── Self-hosted Inter Variable Font (D-23, D-24, D-25) ── */
@font-face {
    font-family: 'Inter';
    src: url("../fonts/InterVariable.2bf3d951bf9d.woff2") format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: optional;
}

@font-face {
    font-family: 'Inter';
    src: url("../fonts/InterVariable-Italic.8d1dc86da258.woff2") format('woff2-variations');
    font-weight: 100 900;
    font-style: italic;
    font-display: optional;
}

/* =========================================================
   Easy Wills & Trusts — Custom Design System
   Modern minimal palette: slate/charcoal + indigo accents
   ========================================================= */

/* ── CSS Custom Properties ─────────────────────────────── */
:root {
    /* Primary palette */
    --ewt-primary: #4f46e5;
    --ewt-primary-hover: #4338ca;
    --ewt-primary-dark: #3730a3;
    --ewt-primary-light: #e0e7ff;
    --ewt-primary-rgb: 79, 70, 229;

    /* Accent / CTA */
    --ewt-accent: #059669;
    --ewt-accent-hover: #047857;
    --ewt-accent-light: #d1fae5;

    /* Neutrals */
    --ewt-heading: #0f172a;
    --ewt-body: #334155;
    /* slate-500 (was slate-400 #94a3b8 — failed WCAG AA at 2.45:1 on #f8fafc per Lighthouse audit) */
    --ewt-muted: #64748b;
    /* slate-400 — paired with #0f172a footer/hero bg gives 6.7:1 (WCAG AA). --ewt-muted itself
       is calibrated for light bg and only hits 3.75:1 on dark surfaces. */
    --ewt-muted-on-dark: #94a3b8;
    --ewt-border: #e2e8f0;
    --ewt-bg: #f8fafc;
    --ewt-card-bg: #ffffff;

    /* Navbar */
    --ewt-nav-bg: #0f172a;
    --ewt-nav-text: #cbd5e1;
    --ewt-nav-hover: #ffffff;

    /* Shared */
    --ewt-radius: 12px;
    --ewt-radius-sm: 8px;
    --ewt-radius-pill: 50rem;
    --ewt-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --ewt-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .07), 0 2px 4px -2px rgba(0, 0, 0, .05);
    --ewt-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .08), 0 4px 6px -4px rgba(0, 0, 0, .04);
    --ewt-transition: 150ms ease;

    /* Font */
    --ewt-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Phase 7.2 D-04 / D-05 — scope token system: 3 scopes x base+light */
    --ewt-scope-will: #4f46e5;          /* alias to --ewt-primary */
    --ewt-scope-will-light: #e0e7ff;    /* alias to --ewt-primary-light */
    --ewt-scope-trust: #d97706;         /* amber-600 */
    --ewt-scope-trust-light: #fef3c7;   /* amber-100 (already used at line ~1168) */
    --ewt-scope-package: #9333ea;       /* purple-600 */
    --ewt-scope-package-light: #f3e8ff; /* purple-100 */
}

/* ── Dark-mode overrides ───────────────────────────────── */
[data-bs-theme="dark"] {
    --ewt-heading: #f1f5f9;
    --ewt-body: #cbd5e1;
    --ewt-muted: #64748b;
    --ewt-border: #334155;
    --ewt-bg: #0f172a;
    --ewt-card-bg: #1e293b;
    --ewt-nav-bg: #020617;
    --ewt-shadow: 0 1px 3px rgba(0, 0, 0, .2), 0 1px 2px rgba(0, 0, 0, .15);
    --ewt-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .25), 0 2px 4px -2px rgba(0, 0, 0, .15);

    /* Phase 7.2 D-04 — hand-picked dark-mode scope tokens */
    --ewt-scope-will: #818cf8;          /* indigo-400 */
    --ewt-scope-will-light: #312e81;    /* indigo-900 */
    --ewt-scope-trust: #f59e0b;         /* amber-500 */
    --ewt-scope-trust-light: #78350f;   /* amber-900 (mirrors .ewt-upl-banner dark) */
    --ewt-scope-package: #c084fc;       /* purple-400 */
    --ewt-scope-package-light: #581c87; /* purple-900 */
}

/* ── Global resets ─────────────────────────────────────── */
body {
    font-family: var(--ewt-font);
    color: var(--ewt-body);
    background-color: var(--ewt-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--ewt-heading);
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
    border: 1px solid var(--ewt-border);
    border-radius: var(--ewt-radius);
    box-shadow: var(--ewt-shadow);
    background-color: var(--ewt-card-bg);
    transition: box-shadow var(--ewt-transition), transform var(--ewt-transition);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--ewt-border);
    padding: 1rem 1.25rem;
}

.card-hover:hover {
    box-shadow: var(--ewt-shadow-md);
    transform: translateY(-2px);
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    border-radius: var(--ewt-radius-sm);
    font-weight: 500;
    padding: .5rem 1.25rem;
    transition: all var(--ewt-transition);
}

.btn-primary {
    background-color: var(--ewt-primary);
    border-color: var(--ewt-primary);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--ewt-primary-hover);
    border-color: var(--ewt-primary-hover);
}

.btn-success {
    background-color: var(--ewt-accent);
    border-color: var(--ewt-accent);
}
.btn-success:hover, .btn-success:focus {
    background-color: var(--ewt-accent-hover);
    border-color: var(--ewt-accent-hover);
}

.btn-outline-primary {
    color: var(--ewt-primary);
    border-color: var(--ewt-primary);
}
.btn-outline-primary:hover {
    background-color: var(--ewt-primary);
    border-color: var(--ewt-primary);
    color: #fff;
}

.btn-pill {
    border-radius: var(--ewt-radius-pill);
    padding: .5rem 1.75rem;
}

.btn-cta {
    background: linear-gradient(135deg, var(--ewt-primary) 0%, var(--ewt-primary-dark) 100%);
    border: none;
    color: #fff;
    border-radius: var(--ewt-radius-pill);
    padding: .625rem 2rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(var(--ewt-primary-rgb), .35);
}
.btn-cta:hover {
    background: linear-gradient(135deg, var(--ewt-primary-hover) 0%, var(--ewt-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(var(--ewt-primary-rgb), .45);
    transform: translateY(-1px);
}

/* ── Form inputs ───────────────────────────────────────── */
.form-control,
.form-select {
    border-radius: var(--ewt-radius-sm);
    border-color: var(--ewt-border);
    padding: .625rem .875rem;
    min-height: 44px;
    transition: border-color var(--ewt-transition), box-shadow var(--ewt-transition);
}
.form-control:focus,
.form-select:focus {
    border-color: var(--ewt-primary);
    box-shadow: 0 0 0 3px rgba(var(--ewt-primary-rgb), .15);
}

/* ── Badges ────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    letter-spacing: .02em;
}
.badge.rounded-pill {
    padding: .35em .75em;
}

/* ── Navbar ────────────────────────────────────────────── */
.ewt-navbar {
    background-color: var(--ewt-nav-bg);
    padding-top: .75rem;
    padding-bottom: .75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.ewt-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.ewt-navbar .navbar-brand:hover {
    color: #fff;
}

.ewt-navbar .nav-link {
    color: var(--ewt-nav-text);
    font-weight: 500;
    font-size: .9rem;
    padding: .5rem .875rem;
    border-radius: var(--ewt-radius-sm);
    transition: color var(--ewt-transition), background-color var(--ewt-transition);
}
.ewt-navbar .nav-link:hover,
.ewt-navbar .nav-link:focus {
    color: var(--ewt-nav-hover);
    background-color: rgba(255, 255, 255, .08);
}

.ewt-navbar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, .12);
}

.ewt-navbar .btn-nav-cta {
    background-color: var(--ewt-primary);
    color: #fff;
    border-radius: var(--ewt-radius-pill);
    padding: .4rem 1.25rem;
    font-weight: 600;
    font-size: .875rem;
    border: none;
    transition: all var(--ewt-transition);
}
.ewt-navbar .btn-nav-cta:hover {
    background-color: var(--ewt-primary-hover);
    color: #fff;
    transform: translateY(-1px);
}

/* User avatar circle */
.ewt-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ewt-primary) 0%, var(--ewt-primary-dark) 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
    flex-shrink: 0;
}

/* Admin badge in nav */
.ewt-admin-link {
    color: #fbbf24 !important;
    font-size: .85rem;
}
.ewt-admin-link:hover {
    color: #fcd34d !important;
    background-color: rgba(251, 191, 36, .1) !important;
}

/* ── Footer ────────────────────────────────────────────── */
.ewt-footer {
    background-color: var(--ewt-nav-bg);
    color: var(--ewt-nav-text);
    padding: 3rem 0 0;
    margin-top: 4rem;
}

.ewt-footer h6,
.ewt-footer .ewt-footer-heading {
    color: #fff;
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 1rem;
}

.ewt-footer a {
    color: var(--ewt-nav-text);
    text-decoration: none;
    font-size: .875rem;
    transition: color var(--ewt-transition);
}
.ewt-footer a:hover {
    color: #fff;
}

.ewt-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding: 1.25rem 0;
    margin-top: 2rem;
    font-size: .8rem;
    color: var(--ewt-muted-on-dark);
}

/* Disclaimer/UPL block when rendered inside the dark footer needs the
   on-dark muted token to clear WCAG AA (4.5:1) on #0f172a. */
.ewt-footer .ewt-disclaimer-text,
.ewt-footer .ewt-upl-footer {
    color: var(--ewt-muted-on-dark);
}
.ewt-footer .ewt-disclaimer-link {
    color: var(--ewt-muted-on-dark);
}

.ewt-footer .footer-brand {
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
}

/* ── Hero section ──────────────────────────────────────── */
.ewt-hero {
    background: linear-gradient(135deg, var(--ewt-nav-bg) 0%, #1e293b 50%, var(--ewt-primary-dark) 100%);
    color: #fff;
    padding: 5rem 0 4rem;
    margin: -1.5rem calc(-1 * (50vw - 50%)) 0;
    width: 100vw;
    position: relative;
}

.ewt-hero h1 {
    color: #fff;
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.ewt-hero .lead {
    color: #cbd5e1;
    font-size: 1.2rem;
    max-width: 540px;
}

@media (max-width: 767.98px) {
    .ewt-hero {
        padding: 3rem 0 2.5rem;
    }
    .ewt-hero h1 {
        font-size: 2rem;
    }
}

/* ── Section styles ────────────────────────────────────── */
.ewt-section {
    padding: 4rem 0;
}

.ewt-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: .5rem;
}

.ewt-section-subtitle {
    text-align: center;
    color: var(--ewt-muted);
    max-width: 560px;
    margin: 0 auto 2.5rem;
}

/* Feature / value-prop cards */
.ewt-feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border: 1px solid var(--ewt-border);
    border-radius: var(--ewt-radius);
    background: var(--ewt-card-bg);
    transition: all var(--ewt-transition);
}
.ewt-feature-card:hover {
    box-shadow: var(--ewt-shadow-md);
    transform: translateY(-4px);
}

.ewt-feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.ewt-feature-icon.indigo {
    background-color: var(--ewt-primary-light);
    color: var(--ewt-primary);
}
.ewt-feature-icon.emerald {
    background-color: var(--ewt-accent-light);
    color: var(--ewt-accent);
}
.ewt-feature-icon.amber {
    background-color: #fef3c7;
    color: #d97706;
}
.ewt-feature-icon.rose {
    background-color: #ffe4e6;
    color: #e11d48;
}

/* How it works steps */
.ewt-step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ewt-primary) 0%, var(--ewt-primary-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 14px rgba(var(--ewt-primary-rgb), .3);
}

/* Connecting line between steps */
.ewt-step-connector {
    position: relative;
}
.ewt-step-connector::after {
    content: '';
    position: absolute;
    top: 24px;
    left: calc(50% + 32px);
    width: calc(100% - 64px);
    height: 2px;
    background: linear-gradient(90deg, var(--ewt-primary), var(--ewt-border));
    z-index: 0;
}
@media (max-width: 767.98px) {
    .ewt-step-connector::after {
        display: none;
    }
}

/* Trust/security badges strip — appears on dark hero/footer AND light auth cards */
.ewt-trust-badge {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--ewt-muted);
    font-size: .85rem;
    font-weight: 500;
}
.ewt-hero .ewt-trust-badge,
.ewt-footer .ewt-trust-badge {
    color: var(--ewt-muted-on-dark);
}
.ewt-trust-badge i {
    color: var(--ewt-accent);
    font-size: 1rem;
}

/* ── Auth pages ────────────────────────────────────────── */
.ewt-auth-wrapper {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.ewt-auth-card {
    width: 100%;
    max-width: 440px;
    border-radius: var(--ewt-radius);
    box-shadow: var(--ewt-shadow-lg);
    background: var(--ewt-card-bg);
    border: 1px solid var(--ewt-border);
    padding: 2.5rem 2rem;
}

.ewt-auth-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.ewt-auth-brand .brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ewt-primary) 0%, var(--ewt-primary-dark) 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: .75rem;
}

.ewt-auth-brand h2 {
    font-size: 1.4rem;
    margin-bottom: .25rem;
}

.ewt-auth-brand p {
    color: var(--ewt-muted);
    font-size: .9rem;
    margin-bottom: 0;
}

/* ── Profile page ──────────────────────────────────────── */
.ewt-profile-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-right: .5rem;
    flex-shrink: 0;
}

/* ── Trust cards (list page) ───────────────────────────── */
.ewt-trust-card {
    border-radius: var(--ewt-radius);
    border: 1px solid var(--ewt-border);
    background: var(--ewt-card-bg);
    padding: 1.5rem;
    transition: all var(--ewt-transition);
    height: 100%;
}
.ewt-trust-card:hover {
    box-shadow: var(--ewt-shadow-md);
    transform: translateY(-2px);
}

.ewt-trust-card.in-progress {
    border: 2px dashed #f59e0b;
    background: rgba(245, 158, 11, .03);
}

/* ── Empty state ───────────────────────────────────────── */
.ewt-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--ewt-muted);
}
.ewt-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: .5;
}

/* ── Alert refinements ─────────────────────────────────── */
.alert {
    border-radius: var(--ewt-radius-sm);
}

/* Pending questionnaire banner */
.ewt-pending-banner {
    border-left: 4px solid var(--ewt-primary);
    border-radius: var(--ewt-radius-sm);
    background-color: var(--ewt-primary-light);
    padding: 1rem 1.25rem;
}
[data-bs-theme="dark"] .ewt-pending-banner {
    background-color: rgba(var(--ewt-primary-rgb), .12);
}

/* ── Progress bar ──────────────────────────────────────── */
.progress {
    border-radius: var(--ewt-radius-pill);
    overflow: hidden;
}
.progress-bar {
    background: linear-gradient(90deg, var(--ewt-primary) 0%, var(--ewt-primary-dark) 100%);
}

/* ── Utility classes ───────────────────────────────────── */
.text-ewt-primary { color: var(--ewt-primary) !important; }
.text-ewt-accent  { color: var(--ewt-accent) !important; }
.text-ewt-muted   { color: var(--ewt-muted) !important; }
.bg-ewt-primary   { background-color: var(--ewt-primary) !important; }
.bg-ewt-light     { background-color: var(--ewt-primary-light) !important; }
.border-ewt       { border-color: var(--ewt-border) !important; }

/* Gradient text */
.ewt-gradient-text {
    background: linear-gradient(135deg, var(--ewt-primary) 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Section gradient bg */
.ewt-section-gradient {
    background: linear-gradient(180deg, var(--ewt-bg) 0%, #fff 100%);
}
[data-bs-theme="dark"] .ewt-section-gradient {
    background: linear-gradient(180deg, var(--ewt-bg) 0%, var(--ewt-card-bg) 100%);
}

/* ── Extracted inline styles (DEBT-05) ───────────────── */

/* Profile icon color variants */
.ewt-profile-icon.emerald { background-color: var(--ewt-accent-light); }
.ewt-profile-icon.emerald i { color: var(--ewt-accent); }
.ewt-profile-icon.amber { background-color: #fef3c7; }
.ewt-profile-icon.amber i { color: #d97706; }
.ewt-profile-icon.slate { background-color: #e2e8f0; }
.ewt-profile-icon.slate i { color: #64748b; }
[data-bs-theme="dark"] .ewt-profile-icon.slate { background-color: #334155; }
[data-bs-theme="dark"] .ewt-profile-icon.slate i { color: #94a3b8; }
.ewt-profile-icon.rose { background-color: #ffe4e6; }
.ewt-profile-icon.rose i { color: #e11d48; }
.ewt-profile-icon.indigo { background-color: var(--ewt-primary-light); }
.ewt-profile-icon.indigo i { color: var(--ewt-primary); }

/* Feature icon size variants */
.ewt-feature-icon-lg { width: 64px; height: 64px; font-size: 1.75rem; }
.ewt-feature-icon-sm { width: 40px; height: 40px; font-size: 1rem; }
.ewt-avatar-lg { width: 56px; height: 56px; font-size: 1.25rem; }

/* Hero section overrides */
.ewt-hero-compact { padding: 3.5rem 0 3rem; }
.ewt-hero-title-md { font-size: 2.5rem; }
.ewt-hero-subtitle { max-width: 580px; color: #cbd5e1; }
.ewt-hero-illustration {
    background: rgba(255,255,255,.05);
    border-radius: var(--ewt-radius);
    padding: 3rem 2rem;
    border: 1px solid rgba(255,255,255,.08);
}
.ewt-hero-shield-icon { font-size: 5rem; color: var(--ewt-primary); opacity: .9; }
.ewt-hero-caption { color: var(--ewt-muted); font-size: .9rem; }
[data-bs-theme="dark"] .ewt-hero-caption { color: #94a3b8; }

/* Max-width utilities */
.ewt-max-w-prose { max-width: 560px; margin: 0 auto; }
.ewt-max-w-auth-split { max-width: 860px; width: 100%; }
.ewt-max-w-footer-desc { max-width: 280px; }

/* Auth sidebar */
.ewt-auth-sidebar { background: var(--ewt-nav-bg); color: #fff; }
.ewt-auth-sidebar h3 { color: #fff; }
.ewt-auth-card-split {
    max-width: 100%;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Password strength meter */
.ewt-pw-meter { display: none; }
.ewt-pw-meter-track {
    flex: 1;
    height: 6px;
    border-radius: 50rem;
    background: var(--ewt-border, #e2e8f0);
    overflow: hidden;
}
.ewt-pw-meter-fill {
    height: 100%;
    width: 0%;
    border-radius: 50rem;
    transition: width 300ms ease, background-color 300ms ease;
}
.ewt-pw-meter-label { min-width: 50px; }

/* Footer disclaimer */
.ewt-disclaimer-text { color: var(--ewt-muted); font-size: .75rem; }
.ewt-disclaimer-link { color: var(--ewt-muted); }

/* Wizard progress bar */
.ewt-nav-progress { height: 5px; }

/* Child form minor indicator */
.ewt-minor-indicator { display: none; }

/* ==========================================================================
   Phase 5-01: Focus mode + step summary (D-04, D-08, D-09, D-14)
   ========================================================================== */
.ewt-focus-screen {
    padding: 2rem 1.5rem;
    animation-duration: 280ms;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
}
.ewt-slide-in-right { animation-name: ewtSlideInRight; }
.ewt-slide-in-left  { animation-name: ewtSlideInLeft; }
@keyframes ewtSlideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes ewtSlideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .ewt-focus-screen,
    .ewt-slide-in-right,
    .ewt-slide-in-left {
        animation-name: ewtFadeIn;
        animation-duration: 150ms;
        transform: none !important;
    }
    @keyframes ewtFadeIn { from { opacity: 0; } to { opacity: 1; } }
}
.ewt-focus-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}
.ewt-focus-nav .btn { min-width: 140px; }
/* Phase 6.1 D-04: Section-mode nav rhythm mirrors .ewt-focus-nav.
   Three-child horizontal row: Previous (order-1) | Save-and-Exit (order-2) | Next (order-3).
   Desktop-only — the mobile hide rule at custom.css (~line 833) keeps this hidden
   below md because .ewt-mobile-nav sticky bar owns mobile navigation. */
@media (min-width: 768px) {
    .ewt-section-nav {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        margin-top: 2rem;
        gap: 1rem;
    }
    .ewt-section-nav > .order-1,
    .ewt-section-nav > .order-2,
    .ewt-section-nav > .order-3 {
        display: flex;
        align-items: center;
    }
    .ewt-section-nav .btn-primary,
    .ewt-section-nav .btn-outline-secondary,
    .ewt-section-nav .btn-success {
        min-width: 140px;
    }
}
.ewt-focus-toggle {
    color: var(--ewt-muted, #6b7280);
    font-size: 0.875rem;
    font-weight: 400;
    text-decoration: none;
}
.ewt-focus-toggle:hover {
    color: var(--ewt-primary);
    text-decoration: underline;
}
.ewt-step-summary { padding: 2rem 1.5rem; }
.ewt-summary-group { margin-bottom: 1rem; }
.ewt-summary-group-heading {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ewt-primary);
    border-bottom: 1px solid var(--ewt-border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}
.ewt-summary-row {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--ewt-border);
}
.ewt-summary-row:last-child { border-bottom: none; }
.ewt-summary-label { width: 40%; }
.ewt-summary-value { flex: 1; }
.ewt-summary-edit {
    color: var(--ewt-primary);
    text-decoration: none;
    font-size: 0.875rem;
}
.ewt-summary-edit:hover { text-decoration: underline; }
@media (max-width: 767.98px) {
    .ewt-focus-screen { padding: 1rem 1rem; }
    .ewt-focus-toggle { display: none !important; }  /* D-14 */
}

/* =====================================================================
   Phase 5-02: Mobile responsiveness chrome (QUX-04, D-13..D-20)
   ===================================================================== */
@media (max-width: 767.98px) {
    /* Touch targets (D-15) */
    .form-control, .form-select, .btn { min-height: 48px; }
    .btn-sm { min-height: 44px; }
    input, select, textarea { font-size: 16px; }  /* prevent iOS auto-zoom */

    /* Hide desktop inline focus nav on mobile — sticky bar takes over (D-20) */
    .ewt-focus-nav { display: none !important; }

    /* Sticky bottom navigation (D-20, Pitfall 8) */
    .ewt-mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
        background: var(--ewt-card-bg, #fff);
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
    }
    .ewt-mobile-nav .btn { min-height: 48px; }
    .ewt-mobile-saved-slot {
        flex: 1;
        text-align: center;
        font-size: 0.875rem;
        color: var(--ewt-accent, #059669);
    }
    /* Content padding-bottom so the fixed nav never covers errors / submit (Pitfall 8) */
    .questionnaire-main {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    /* Hamburger trigger — compact fixed FAB (top-left, below navbar).
       Always visible while scrolling; left side avoids colliding with the
       Step N of M badge in the card header. */
    .ewt-sidebar-toggle {
        position: fixed;
        top: 68px;               /* below the sticky navbar */
        left: 0.75rem;
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--ewt-card-bg, #fff);
        border: 1px solid var(--ewt-border, rgba(0, 0, 0, 0.12));
        color: var(--ewt-body, #334155);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
        z-index: 1029;
    }
    .ewt-sidebar-toggle:hover,
    .ewt-sidebar-toggle:focus {
        background: var(--ewt-bg, #f1f5f9);
    }
    .ewt-sidebar-toggle i { font-size: 1.25rem; }

    /* Hide the desktop fixed sidebar on mobile — offcanvas takes over */
    .questionnaire-sidebar { display: none !important; }

    /* Hide the legacy pre-Phase-5 floating nav toggle + overlay — Phase 5's
       .ewt-sidebar-toggle hamburger + Bootstrap offcanvas replace them on mobile.
       Leaving the legacy button visible overlaps the sticky bottom nav's Back button. */
    .nav-toggle-btn { display: none !important; }
    .nav-overlay { display: none !important; }

    /* Mobile section-nav visibility keys off the pre-paint data-focus-mode
       attribute (wizard.html:586-605):
       - focus-mode steps (data-focus-mode="on"): the sticky bottom bar
         (.ewt-mobile-nav) owns Back/Next, so the in-flow nav stays hidden
         (handled by the html[data-focus-mode="on"] rule just below this block).
       - section-mode steps (data-focus-mode="off"): there is no sticky bar, so
         show the in-flow section nav as the real submit, stacked full-width for
         touch (48px min-height inherited from the .btn rule above). */
    html[data-focus-mode="off"] .ewt-section-nav {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        margin-top: 2rem;
    }
    html[data-focus-mode="off"] .ewt-section-nav > .order-1,
    html[data-focus-mode="off"] .ewt-section-nav > .order-2,
    html[data-focus-mode="off"] .ewt-section-nav > .order-3 {
        display: flex;
    }
    html[data-focus-mode="off"] .ewt-section-nav .btn { width: 100%; }

    /* No sticky bar on section-mode steps, so drop the reserved 80px gap. */
    html[data-focus-mode="off"] .questionnaire-main {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

/* Focus mode owns its own Back/Next/Save-and-Exit row (.ewt-focus-nav),
   so hide the section-mode nav and the standalone Save-and-Exit block
   whenever focus mode is active. Section mode keeps them visible. */
html[data-focus-mode="on"] .ewt-section-nav {
    display: none !important;
}

/* Inverse guard: when section mode is active, the focus controller sets the
   [hidden] attribute on .ewt-focus-nav, but Bootstrap's d-md-flex uses
   `display: flex !important` which overrides the UA [hidden] style. Force
   [hidden] to win so the two nav rows don't both render simultaneously. */
.ewt-focus-nav[hidden] {
    display: none !important;
}

/* Sanity block — CSS above closed the @media; re-open a no-op so surrounding
   rules in this file remain unchanged structurally. */
@media (max-width: 767.98px) {

    /* Inline formset cards (D-19, Component 11) */
    .ewt-formset-card {
        padding: 1rem;
        margin-bottom: 0.75rem;
        border: 1px solid var(--ewt-border, #e2e8f0);
        border-radius: var(--ewt-radius-sm, 8px);
        background: var(--ewt-card-bg, #fff);
    }
    .ewt-formset-card > .row,
    .ewt-formset-card > .form-row,
    .ewt-formset-card .col,
    .ewt-formset-card [class^="col-"],
    .ewt-formset-card [class*=" col-"] {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    .ewt-formset-card .form-group,
    .ewt-formset-card .mb-3 { margin-bottom: 0.75rem; }
    .ewt-formset-add {
        width: 100%;
        min-height: 48px;
        margin-top: 1rem;
    }

    /* Why-we-ask bottom sheet (D-17, Component 9) */
    .ewt-why-sheet {
        max-height: 50vh;
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
    }
    .ewt-why-sheet .offcanvas-body {
        font-size: 16px;
        line-height: 1.5;
    }

    /* Mobile offcanvas step list tidy-up (Component 7) */
    .ewt-mobile-step-list .ewt-mobile-step a { color: var(--ewt-body, #0f172a); }
    .ewt-mobile-step.active > a { background: rgba(79, 70, 229, 0.08); border-radius: 6px; }
    .ewt-mobile-step.completed .nav-step-icon.completed { color: var(--ewt-accent, #059669); }
}

/* ========== Phase 5 / QUX-05: Smart-default visual cue (D-25) ========== */
.ewt-prefilled .form-control,
.ewt-prefilled .form-select {
    border-left: 3px solid #6366f1;  /* indigo-500 */
    background-color: rgba(99, 102, 241, 0.04);
    transition: border-color 150ms ease, background-color 150ms ease;
}
[data-bs-theme="dark"] .ewt-prefilled .form-control,
[data-bs-theme="dark"] .ewt-prefilled .form-select {
    border-left-color: #818cf8;  /* indigo-400 for dark-mode contrast */
    background-color: rgba(129, 140, 248, 0.08);
}
.ewt-prefilled-hint {
    font-size: 0.875rem;
    color: var(--ewt-muted);
    margin-top: 0.25rem;
}
.ewt-prefilled-hint .bi-magic {
    color: #6366f1;
    font-size: 12px;
}
[data-bs-theme="dark"] .ewt-prefilled-hint .bi-magic {
    color: #818cf8;
}

/* ========== Phase 5-04 / QUX-06: Continue card + resume chrome ========== */
.ewt-continue-card {
    border: 1px solid var(--ewt-border, rgba(0,0,0,0.1));
    border-left: 2px solid var(--ewt-primary, #4f46e5);
    background: linear-gradient(135deg, rgba(79,70,229,0.04) 0%, rgba(5,150,105,0.04) 100%);
}
.ewt-continue-card .card-body { padding: 2rem; }
@media (max-width: 767.98px) {
    .ewt-continue-card .card-body { padding: 1.5rem; }
}
.ewt-welcome-back {
    background: rgba(5, 150, 105, 0.08);
    border-left: 3px solid rgba(5, 150, 105, 0.35);
    border-radius: var(--ewt-radius-sm, 8px);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.ewt-welcome-back .bi-hand-thumbs-up { color: var(--ewt-accent, #059669); }
.ewt-saved-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--ewt-accent, #059669);
    font-size: 0.875rem;
    gap: 0.25rem;
}
.ewt-save-exit { font-size: 0.875rem; }

/* ========== Phase 6 / Plan 6-04: Document-selection card grid ========== */
/* Tokens: reuse Phase 1 (#0f172a slate-900, #334155 slate-700, var(--ewt-border))
   + Phase 5 indigo family (#6366f1 indigo-500, #818cf8 indigo-400 dark,
   #4338ca indigo-700 badge text, rgba(99,102,241,0.10) badge fill).
   No new hex values introduced. */

.ewt-doc-section {
    margin: 1rem 0;
}

.ewt-doc-grid {
    margin: 1rem 0;
}

.ewt-doc-card {
    list-style: none;
}

.ewt-doc-card__label {
    display: block;
    padding: 1rem 1.25rem;
    min-height: 72px;  /* UI-SPEC mobile touch target */
    border: 1px solid var(--ewt-border, rgba(0, 0, 0, 0.1));
    border-radius: 12px;
    background: var(--ewt-card-bg, #ffffff);
    cursor: pointer;
    transition: box-shadow 150ms ease, border-color 150ms ease;
    margin: 0;
    height: 100%;
}

.ewt-doc-card__label:hover {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    border-color: rgba(15, 23, 42, 0.2);
}

.ewt-doc-card__label:focus-within {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    border-color: var(--ewt-primary, #4f46e5);
    outline: none;
}

.ewt-doc-card--recommended .ewt-doc-card__label {
    border-left: 2px solid #6366f1;  /* indigo-500 */
}

[data-bs-theme="dark"] .ewt-doc-card--recommended .ewt-doc-card__label {
    border-left-color: #818cf8;  /* indigo-400 dark-mode */
}

.ewt-doc-card__checkbox {
    float: left;
    margin-right: 0.75rem;
}

.ewt-doc-card__body {
    overflow: hidden;  /* contains the checkbox float */
}

.ewt-doc-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;  /* slate-900 */
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

[data-bs-theme="dark"] .ewt-doc-card__title {
    color: #e2e8f0;  /* inherit dark-mode body color */
}

.ewt-doc-card__purpose {
    font-size: 0.875rem;
    color: #334155;  /* slate-700 */
    margin: 0 0 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[data-bs-theme="dark"] .ewt-doc-card__purpose {
    color: var(--ewt-muted, #94a3b8);
}

.ewt-doc-card__rationale {
    font-size: 0.875rem;
    font-style: italic;
    color: var(--ewt-muted, #94a3b8);
    margin: 0 0 0.5rem 0;
}

.ewt-doc-card__rationale .bi-magic {
    color: #6366f1;  /* indigo-500 */
}

[data-bs-theme="dark"] .ewt-doc-card__rationale .bi-magic {
    color: #818cf8;  /* indigo-400 */
}

.ewt-doc-card-includes {
    font-size: 0.875rem;
    color: var(--ewt-muted, #94a3b8);
    margin: 0.5rem 0 0 0;
    font-style: italic;
}

/* Recommended badge — no new weight declared (inherits project .btn / 500) */
.ewt-recommended-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    color: #4338ca;  /* indigo-700 — WCAG AA 7.1:1 on the tinted background */
    background-color: rgba(99, 102, 241, 0.10);  /* indigo-500 @ 10% */
    border-radius: 50rem;
    margin-bottom: 0.25rem;
}

[data-bs-theme="dark"] .ewt-recommended-badge {
    color: #c7d2fe;  /* indigo-200 for dark-mode contrast */
    background-color: rgba(129, 140, 248, 0.15);
}

/* ========== Phase 6 / Plan 6-04: Final review "Your package" list ========== */
.ewt-final-review__header h2 {
    margin-bottom: 0.25rem;
}

.ewt-final-review__edit-link {
    font-size: 0.875rem;
    color: var(--ewt-primary, #4f46e5);
    text-decoration: none;
}

.ewt-final-review__edit-link:hover {
    text-decoration: underline;
}

.ewt-package-list .list-group-item {
    background: transparent;
    border-left: 0;
    border-right: 0;
}

.ewt-package-list .bi-check-circle-fill {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* ========== Phase 6 / Plan 6-06 prep: Doc-diff banner ========== */
/* Sibling of .ewt-welcome-back (D-30 pattern). Plan 6-06 will ship the
   partial + auto-fade JS; Plan 6-04 lays the styles so 6-06 can be a
   pure-template change. */
.ewt-diff-banner {
    background: rgba(5, 150, 105, 0.08);
    border-left: 3px solid rgba(5, 150, 105, 0.35);
    border-radius: var(--ewt-radius-sm, 8px);
    padding: 12px 16px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #0f172a;
    transition: opacity 600ms ease;
}

[data-bs-theme="dark"] .ewt-diff-banner {
    color: #e2e8f0;
}

.ewt-diff-banner .bi-magic {
    color: #6366f1;  /* indigo-500 — semantic tie to recommendation family */
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

[data-bs-theme="dark"] .ewt-diff-banner .bi-magic {
    color: #818cf8;
}

.ewt-diff-banner .btn-close {
    margin-left: auto;
    min-width: 44px;
    min-height: 44px;
}

/* ========== Phase 6.3 / D-06..D-14: UPL compliance classes ========== */

/* D-07: Persistent above-fold UPL banner */
.ewt-upl-banner {
    background: #fef3c7;              /* amber-100 (existing precedent at line 405) */
    color: #78350f;                    /* amber-900 — WCAG AA ≥ 7:1 on amber-100 */
    border-bottom: 1px solid #fcd34d;  /* amber-300 */
    font-size: 0.75rem;                /* 12px — matches .ewt-disclaimer-text sizing */
    line-height: 1.5;
    max-height: 40px;                  /* Phase 6.2 G2-* mobile height budget */
    position: relative;                /* UI-SPEC: not sticky — above-fold-on-entry only.
                                          relative (not sticky) so z-index applies and the
                                          wizard's sticky sidebar can't paint over it. */
    z-index: 31;                       /* above .questionnaire-sidebar (z-30), below navbar */
}
.ewt-upl-banner a { color: inherit; text-decoration: underline; }

[data-bs-theme="dark"] .ewt-upl-banner {
    background: #78350f;              /* amber-900 bg in dark */
    color: #fef3c7;                    /* amber-100 text */
    border-bottom-color: #b45309;     /* amber-700 */
}

/* D-08: Footer inline disclaimer */
.ewt-upl-footer {
    /* Inherits .ewt-disclaimer-text sizing. Namespace-only class for test assertion + future overrides. */
}
[data-bs-theme="dark"] .ewt-upl-footer {
    /* Inherits footer dark palette from .ewt-disclaimer-text; no override needed. */
}

/* D-12: Doc-selection card-grid preamble (framing, not alert) */
.ewt-upl-preamble {
    background: rgba(15, 23, 42, 0.04);   /* subtle neutral tint */
    color: var(--ewt-body, #334155);
    border-left: 3px solid var(--ewt-muted, #94a3b8);  /* neutral gray — NOT indigo accent */
    border-radius: var(--ewt-radius-sm, 8px);
    font-size: 1rem;                       /* 16px body */
    line-height: 1.5;
}
[data-bs-theme="dark"] .ewt-upl-preamble {
    background: rgba(226, 232, 240, 0.06);
    color: #e2e8f0;
    border-left-color: #64748b;
}

/* D-10: Checkout clickwrap card */
.ewt-upl-checkout-clickwrap {
    background: #ffffff;
    color: var(--ewt-body, #334155);
    border: 1px solid var(--ewt-border, #e2e8f0);
    border-radius: var(--ewt-radius-sm, 8px);
}
.ewt-upl-checkout-clickwrap input.form-check-input {
    min-width: 1.25rem;
    min-height: 1.25rem;
}

[data-bs-theme="dark"] .ewt-upl-checkout-clickwrap {
    background: var(--ewt-card-bg, #1e293b);
    color: #e2e8f0;
    border-color: #334155;
}

/* D-14: Will-card swap transparency toast (mirrors .ewt-welcome-back palette) */
.ewt-upl-swap-toast {
    background: rgba(5, 150, 105, 0.08);
    border-left: 3px solid rgba(5, 150, 105, 0.35);
    border-radius: var(--ewt-radius-sm, 8px);
    padding: 0.75rem 1rem;
    color: #0f172a;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    transition: opacity 400ms ease;
}
.ewt-upl-swap-toast .bi-info-circle { color: #059669; }

[data-bs-theme="dark"] .ewt-upl-swap-toast {
    background: rgba(5, 150, 105, 0.18);
    color: #e2e8f0;
}

@media (prefers-reduced-motion: reduce) {
    .ewt-upl-swap-toast { transition: none; }
}

/* ============================================================
   Phase 7 Plan 7-04 — .ewt-will-state-block + .ewt-validation-error*
   Mirrors Phase 6.3 .ewt-upl-* convention (lines 1164-1247).
   No new design tokens; reuses existing custom properties + Phase 6.3 amber.
   ============================================================ */

/* D-15 Will-only state-block (informational; amber family) */
.ewt-will-state-block {
    background: #fef3c7;              /* amber-100, mirrors .ewt-upl-banner */
    color: #78350f;                    /* amber-900 — WCAG AA ≥ 7:1 */
    border-left: 4px solid #fcd34d;    /* amber-300 — left rail */
    border-radius: 0.25rem;
    line-height: 1.5;
}

.ewt-will-state-block h2 {
    color: #78350f;
    font-weight: 600;
}

[data-bs-theme="dark"] .ewt-will-state-block {
    background: #78350f;
    color: #fef3c7;
    border-left-color: #b45309;        /* amber-700 dark variant */
}

[data-bs-theme="dark"] .ewt-will-state-block h2 {
    color: #fef3c7;
}

/* D-20 Validation error block (destructive; danger-red rail; card surface) */
.ewt-validation-error {
    background: #ffffff;
    color: var(--ewt-body, #334155);
    border-left: 4px solid #dc3545;
    border-radius: 0.25rem;
    line-height: 1.5;
}

.ewt-validation-error__heading {
    color: var(--ewt-heading, #0f172a);
    font-weight: 600;
}

.ewt-validation-error__list {
    list-style-type: disc;
}

.ewt-validation-error__list li {
    line-height: 1.5;
}

.ewt-validation-error__fix-link {
    color: #dc3545;
    border-bottom: 1px dotted currentColor;
    text-decoration: none;
    padding: 0.625rem 0;       /* 44px touch target on mobile (UI-SPEC §Spacing) */
    font-weight: 500;
}

.ewt-validation-error__fix-link:hover {
    color: #b02a37;
}

.ewt-validation-error__fix-link:focus-visible {
    outline: 3px solid #dc3545;
    outline-offset: 2px;
}

[data-bs-theme="dark"] .ewt-validation-error {
    background: var(--ewt-card-bg, #1e293b);
    /* border-left danger red preserved — same semantic in dark mode */
}

[data-bs-theme="dark"] .ewt-validation-error__heading {
    color: var(--ewt-heading, #e2e8f0);
}

[data-bs-theme="dark"] .ewt-validation-error__fix-link {
    color: #f87171;             /* lighter red for dark-bg legibility */
}

[data-bs-theme="dark"] .ewt-validation-error__fix-link:hover {
    color: #fca5a5;
}

/* Reduced-motion: validation-error block auto-fade respects preference. */
@media (prefers-reduced-motion: reduce) {
    .ewt-validation-error {
        transition: none;
    }
}

/* Optional formset row scaffold (used by _will_witnesses_formset.html and
   _will_bequests_formset.html). Keep minimal — Bootstrap .card supplies
   the surface; this hook lets future Phase 7 / Phase 9 styles target rows
   without competing with Bootstrap defaults. */
.ewt-formset-row {
    /* No declarations — class exists as a structural hook. */
}

/* ─────────────────────────────────────────────────────────────────────────
   Phase 7.1 / I2 / D-06 + D-08: ewt-document-card family
   ─────────────────────────────────────────────────────────────────────────
   New unified document/session card class hierarchy. Inherits the existing
   .ewt-trust-card layout (border, padding, hover lift) but adds:
     - 44px touch-target floor on quick-action buttons (deliberate delta
       from trust_list.html .btn-sm) per UI-SPEC §Spacing Exceptions.
     - Three new badge palettes for document-type + status (slate-tint,
       slate-tint-darker for draft, indigo-tint for signed; .bg-success
       for paid is a verbatim Bootstrap reuse).
     - Dark-mode overrides for all new badge classes per UI-SPEC §Dark-Mode
       Contract.
     - .ewt-continue-others-link quiet anchor for Plan 04's home-page link.
   ───────────────────────────────────────────────────────────────────────── */
.ewt-document-card {
    border-radius: var(--ewt-radius);
    border: 1px solid var(--ewt-border);
    background: var(--ewt-card-bg);
    padding: 1.5rem;
    transition: all var(--ewt-transition);
    height: 100%;
}
.ewt-document-card:hover {
    box-shadow: var(--ewt-shadow-md);
    transform: translateY(-2px);
}
/* UI-SPEC §Spacing Exceptions: 44px touch-target floor on quick-action buttons.
   Deliberate delta from trust_list.html which uses .btn-sm (~31px). */
.ewt-document-card .btn {
    min-height: 44px;
}

.ewt-document-card--in-progress {
    border: 2px dashed #f59e0b;
    background: rgba(245, 158, 11, .03);
}

/* ── New badge palettes (UI-SPEC §Color §New badge palettes) ─────────────── */
.ewt-doc-type-badge {
    background-color: rgba(15, 23, 42, 0.06);
    color: var(--ewt-body);
    border: none;
    font-weight: 500;
    padding: 4px 10px;
}
[data-bs-theme="dark"] .ewt-doc-type-badge {
    background-color: rgba(241, 245, 249, 0.08);
}

.ewt-status-badge--draft {
    background-color: rgba(15, 23, 42, 0.08);
    color: var(--ewt-body);
    border: none;
    font-weight: 500;
    padding: 4px 10px;
}
[data-bs-theme="dark"] .ewt-status-badge--draft {
    background-color: rgba(241, 245, 249, 0.10);
}

.ewt-status-badge--signed {
    background-color: rgba(79, 70, 229, 0.10);
    color: #4338ca;
    border: none;
    font-weight: 500;
    padding: 4px 10px;
}
[data-bs-theme="dark"] .ewt-status-badge--signed {
    background-color: rgba(129, 140, 248, 0.15);
    color: #c7d2fe;
}

/* ── Continue-N-other-documents quiet anchor (used by Plan 04) ──────────── */
.ewt-continue-others-link {
    color: var(--ewt-body);
    text-decoration: none;
}
.ewt-continue-others-link:hover {
    color: var(--ewt-primary);
    text-decoration: underline;
}

/* ──────────────────────────────────────────────────────────
   Phase 7.2 D-01 + Phase 7.3 D-04 — wizard entry-point chrome
   .ewt-questionnaire-hero (sketch 001-B) + .ewt-questionnaire-hero__switch-link
   ────────────────────────────────────────────────────────── */
.ewt-questionnaire-hero {
    position: relative;
    overflow: hidden;
    padding: 24px;
    margin-bottom: 24px;
    border-radius: var(--ewt-radius);
    color: #ffffff;
    background: linear-gradient(135deg, #312e81 0%, #4f46e5 100%);
}

.ewt-questionnaire-hero::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    right: -40px;
    top: -40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.ewt-questionnaire-hero__eyebrow {
    position: relative;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
}

.ewt-questionnaire-hero h1 {
    position: relative;
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 8px;
}

.ewt-questionnaire-hero__subhead {
    position: relative;
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 16px;
}

.ewt-questionnaire-hero__meta {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.92);
}

.ewt-questionnaire-hero__meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ewt-questionnaire-hero--scope-will {
    /* explicit modifier; gradient already inherits scope-will hue family */
}

/* Phase 7.3 D-04: hero inline switch link (relocated from deleted
   .ewt-skipped-banner). Thin underlined link, visually subordinate to
   hero copy. Same recovery target as the deleted banner:
   ?wizard_goto_step=documents-to-prepare. */
.ewt-questionnaire-hero__switch-link {
    position: relative;
    display: inline-block;
    margin-top: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: underline;
}

.ewt-questionnaire-hero__switch-link:hover,
.ewt-questionnaire-hero__switch-link:focus {
    color: #ffffff;
    text-decoration: underline;
}

[data-bs-theme="dark"] .ewt-questionnaire-hero {
    background: linear-gradient(135deg, var(--ewt-scope-will-light) 0%, var(--ewt-scope-will) 100%);
}

/* ──────────────────────────────────────────────────────────
   Phase 7.2 D-03 — summary callout (sketch 002-B)
   .ewt-summary-callout — bordered indigo box on will-only summary
   ────────────────────────────────────────────────────────── */
.ewt-summary-callout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 24px;
    margin-top: 16px;
    margin-bottom: 16px;
    border-radius: var(--ewt-radius);
    background: var(--ewt-scope-will-light);
    border: 1px solid #c7d2fe;
    color: var(--ewt-heading);
}

.ewt-summary-callout > i,
.ewt-summary-callout .bi-bank2 {
    color: var(--ewt-primary);
    flex-shrink: 0;
}

.ewt-summary-callout strong {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--ewt-heading);
    margin-bottom: 4px;
}

.ewt-summary-callout p {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ewt-body);
}

.ewt-summary-callout__cta {
    flex-shrink: 0;
    min-height: 44px;        /* Phase 5-02 D-15 mobile touch target */
    align-self: center;
}

.ewt-summary-callout--scope-will {
    /* explicit modifier; base already inherits scope-will hue */
}

@media (max-width: 767.98px) {
    .ewt-summary-callout {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    .ewt-summary-callout__cta {
        width: 100%;
    }
}

[data-bs-theme="dark"] .ewt-summary-callout {
    background: var(--ewt-scope-will-light);   /* dark-mode -light = indigo-900 */
    border-color: var(--ewt-scope-will);       /* dark-mode = indigo-400 */
    color: #e2e8f0;
}

[data-bs-theme="dark"] .ewt-summary-callout strong {
    color: #f1f5f9;
}

[data-bs-theme="dark"] .ewt-summary-callout p {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .ewt-summary-callout > i {
    color: var(--ewt-scope-will);              /* indigo-400 stays vivid on dark */
}

/* ──────────────────────────────────────────────────────────
   Phase 7.2 D-06 / D-07 — document-icon block (sketch 003-C)
   .ewt-document-card__doc-icon — scope-aware icon-block layout
   ────────────────────────────────────────────────────────── */
.ewt-document-card__doc-icon {
    flex-shrink: 0;
    width: 96px;
    padding: 12px;
    border-radius: var(--ewt-radius-sm);
    border: 1px solid var(--ewt-border);
    background: linear-gradient(135deg, #f8fafc 0%, var(--ewt-primary-light) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
}

.ewt-document-card__doc-icon i {
    font-size: 2rem;
    line-height: 1;
    color: var(--ewt-primary);
}

.ewt-document-card__doc-icon-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ewt-primary-dark);
}

.ewt-document-card__doc-icon-pct {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ewt-primary);
    line-height: 1.2;
}

/* Scope modifiers — set border + token colors used by inner elements. */
.ewt-document-card__doc-icon--scope-will {
    background: linear-gradient(135deg, #f8fafc 0%, var(--ewt-scope-will-light) 100%);
    border-color: var(--ewt-scope-will-light);
}
.ewt-document-card__doc-icon--scope-will i,
.ewt-document-card__doc-icon--scope-will .ewt-document-card__doc-icon-pct {
    color: var(--ewt-scope-will);
}
.ewt-document-card__doc-icon--scope-will .ewt-document-card__doc-icon-label {
    color: var(--ewt-primary-dark);
}

.ewt-document-card__doc-icon--scope-trust {
    background: linear-gradient(135deg, #f8fafc 0%, var(--ewt-scope-trust-light) 100%);
    border-color: var(--ewt-scope-trust-light);
}
.ewt-document-card__doc-icon--scope-trust i,
.ewt-document-card__doc-icon--scope-trust .ewt-document-card__doc-icon-pct {
    color: var(--ewt-scope-trust);
}
.ewt-document-card__doc-icon--scope-trust .ewt-document-card__doc-icon-label {
    color: var(--ewt-scope-trust);
}

.ewt-document-card__doc-icon--scope-package {
    background: linear-gradient(135deg, #f8fafc 0%, var(--ewt-scope-package-light) 100%);
    border-color: var(--ewt-scope-package-light);
}
.ewt-document-card__doc-icon--scope-package i,
.ewt-document-card__doc-icon--scope-package .ewt-document-card__doc-icon-pct {
    color: var(--ewt-scope-package);
}
.ewt-document-card__doc-icon--scope-package .ewt-document-card__doc-icon-label {
    color: var(--ewt-scope-package);
}

.ewt-document-card__doc-icon--scope-neutral {
    background: linear-gradient(135deg, #f8fafc 0%, var(--ewt-primary-light) 100%);
    border-color: var(--ewt-primary-light);
}
.ewt-document-card__doc-icon--scope-neutral i,
.ewt-document-card__doc-icon--scope-neutral .ewt-document-card__doc-icon-pct {
    color: var(--ewt-primary);
}

/* Card-level scope modifiers (D-07 propagation — orthogonal to --in-progress). */
.ewt-document-card--scope-will {
    border-color: var(--ewt-scope-will-light);
}
.ewt-document-card--scope-trust {
    border-color: var(--ewt-scope-trust-light);
}
.ewt-document-card--scope-package {
    border-color: var(--ewt-scope-package-light);
}

/* Dark-mode: gradients flip to use card-bg as the base, not light-slate #f8fafc. */
[data-bs-theme="dark"] .ewt-document-card__doc-icon {
    background: linear-gradient(135deg, var(--ewt-card-bg) 0%, var(--ewt-primary-light) 100%);
    border-color: var(--ewt-border);
}
[data-bs-theme="dark"] .ewt-document-card__doc-icon--scope-will {
    background: linear-gradient(135deg, var(--ewt-card-bg) 0%, var(--ewt-scope-will-light) 100%);
}
[data-bs-theme="dark"] .ewt-document-card__doc-icon--scope-trust {
    background: linear-gradient(135deg, var(--ewt-card-bg) 0%, var(--ewt-scope-trust-light) 100%);
}
[data-bs-theme="dark"] .ewt-document-card__doc-icon--scope-package {
    background: linear-gradient(135deg, var(--ewt-card-bg) 0%, var(--ewt-scope-package-light) 100%);
}
[data-bs-theme="dark"] .ewt-document-card__doc-icon--scope-neutral {
    background: linear-gradient(135deg, var(--ewt-card-bg) 0%, var(--ewt-primary-light) 100%);
}

/* Phase 9 Plan 9-03 / D-12 — inline structural-change warning. */
.ewt-structural-warning {
    background: #fef3c7;                  /* amber-100; mirrors .ewt-upl-banner */
    color: #78350f;                       /* amber-900; WCAG AA */
    border-left: 4px solid #d97706;       /* amber-600 (--ewt-scope-trust) */
    border-radius: 0.25rem;
    padding: 0.75rem 1rem;
}
.ewt-structural-warning .bi {
    font-size: 1.1rem;
    color: #d97706;                       /* amber-600 — keep icon in band */
}
[data-bs-theme="dark"] .ewt-structural-warning {
    background: #78350f;                  /* amber-900 bg in dark */
    color: #fef3c7;                       /* amber-100 text */
    border-left-color: #b45309;           /* amber-700 */
}
[data-bs-theme="dark"] .ewt-structural-warning .bi {
    color: #fcd34d;                       /* amber-300 — readable on amber-900 */
}
.ewt-structural-warnings-cluster {
    /* Wrapper-only; no styling — keeps the cluster spaced via mb-4 utility. */
}
