/* TFST-544: narrow controls and policy copy stay inside the viewport. */
button, [role="button"], input[type="submit"] { border-radius: 999px !important; }
body:has(.login-card) main.portal-main { margin: 0 !important; width: 100%; max-width: 100%; }
.login-card { width: min(100%,1560px) !important; min-width: 0; }
.login-card > div { min-width: 0; max-width: 100%; }
html[lang="en"] .tfst-retention-policy [lang="es"], html[lang="es"] .tfst-retention-policy [lang="en"] { display: none; }
@media (max-width: 980px) {
    .login-card { grid-template-columns: minmax(0,1fr) !important; }
    .login-card > div { min-width: 0; max-width: 100%; }
}
@media (max-width: 1023px) {
    .portal-mobile-bar > div { min-width: 0 !important; flex: 0 0 auto; }
    .portal-mobile-brand { min-width: 0; flex: 1 1 auto !important; }
    .portal-mobile-logo { width: 100% !important; max-width: 160px !important; height: auto !important; }
}
/**
 * TFST Portal Dual-Mode Design System & Theme Engine (TFST-511)
 * Strict Dual-Mode Parity between Dark and Light Luxury Themes
 * Fluid Linear clamp() formulas and Omniscreen Responsiveness
 * Zero em-dash characters and zero human imagery sitewide.
 */

:root {
    /* Fluid Linear Clamps (WCAG 1.4.4 compliant rem + vw) */
    --tfst-title-fluid: clamp(2rem, calc(1.4rem + 2vw), 3.8rem);
    --tfst-card-padding: clamp(1.25rem, calc(1rem + 2vw), 3.5rem);
    --tfst-grid-gap: clamp(1rem, calc(0.75rem + 1vw), 2.5rem);
    --tfst-input-font: clamp(0.9rem, calc(0.85rem + 0.25vw), 1.05rem);
    --tfst-input-height: 48px;
}

/* TFST-542: page-scoped compact onboarding and account security controls. */
.security-manager { background: transparent !important; }
.security-manager input, .security-manager select { width: 100%; box-sizing: border-box; min-height: 44px; margin: 0.4rem 0; }
.security-manager button, #mfaMethods button { min-height: 44px; border-radius: 999px; background: transparent; color: var(--tfst-text); border: 1px solid #7A5160; padding: 0.5rem 0.8rem; margin: 0.25rem; }
.security-manager [hidden], #mfaMethods[hidden], #totpNotice[hidden] { display: none !important; }
.security-manager code { display: block; overflow-wrap: anywhere; }
.onboard-card #qrCodeImg { width: 145px !important; height: 145px !important; min-width: 145px !important; min-height: 145px !important; }
.onboard-card #copyKeyBtn { min-height: 44px; }
.onboard-card #qrCodeContainer { width: 145px; height: 145px; border: 0; padding: 0 !important; margin-bottom: 0.4rem !important; background: transparent !important; }
body:has(#mfa-form) main.portal-main { margin: 0; min-height: 0; width: 100%; max-width: 100%; }
.portal-card:has(#mfa-form) { background: transparent !important; }
@media (min-width: 981px) {
    body:has(.onboard-card) main.portal-main { padding: 0.75rem; min-height: 0; margin: 0; width: 100%; max-width: 100%; overflow: visible; }
    .onboard-card { min-height: 0 !important; margin: 0 auto !important; padding: 0.75rem !important; gap: 2rem !important; background: transparent !important; }
    .onboard-card .onboard-form-card { padding: 0.75rem !important; background: transparent !important; }
    .onboard-form-card div, .onboard-form-card p { margin-bottom: 0.35rem !important; }
    #step1Form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0.5rem 1rem; align-items: start; }
    #step1Form > div:last-child { grid-column: 1 / -1; }
    #passwordChecklist { padding: 0.5rem !important; }
    #passwordChecklist .checklist-item { margin-bottom: 0 !important; }
    .onboard-card #manualSecretCode { font-size: 0.85rem !important; }
    body:has(.onboard-card) footer.tfst-site-footer { padding-block: 1rem; }
    body:has(.onboard-card) .tfst-footer-grid { margin-bottom: 0.5rem; gap: 1rem; }
    body:has(.onboard-card) .tfst-footer-bottom { padding-top: 0.5rem; }
    body:has(.onboard-card) footer :is(h2,h3,p,ul) { margin-block: 0.3rem; }
    #mfa-panel-totp > div { display: grid; grid-template-columns: 145px minmax(0,1fr); gap: 0.5rem 1rem; align-items: center; }
    #mfa-panel-totp > div > p { grid-column: 1 / -1; }
    body:has(.onboard-card) footer ul { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0.35rem; }
}
@media (max-width: 980px) {
    .onboard-card { grid-template-columns: 1fr !important; gap: 1rem !important; padding: 1rem !important; min-height: 0 !important; }
    body:has(.onboard-card) main.portal-main { margin: 0; min-height: 0; width: 100%; max-width: 100%; }
}

:root,
[data-theme="light"] {
    /* Canvas & Surfaces */
    --tfst-canvas: #FAFAFA;
    --tfst-bg: #FAFAFA;
    --tfst-card: #FAFAFA;
    --tfst-border: #FAFAFA;

    /* Typography & Ink */
    --tfst-heading: #7A5160;
    --tfst-ink: #1A1A1A;
    --tfst-text: #1A1A1A;
    --tfst-muted: #7A5160;

    /* Brand Accents */
    --tfst-bordeaux: #7A5160;
    --tfst-accent: #7A5160;
    --tfst-bordeaux-hover: #7A5160;
    --tfst-accent-hover: #7A5160;
    --tfst-rose: #A87B8A;
    --tfst-teal: #4E7A7A;
    --tfst-beige: #C6A48F;

    /* Form Controls */
    --tfst-input-bg: #FAFAFA;
    --tfst-input-border: #FAFAFA;
    --tfst-input-text: #1A1A1A;

    /* Notices & Badges */
    --tfst-notice-bg: rgba(78, 122, 122, 0.08);
    --tfst-notice-border: #4E7A7A;
    --tfst-notice-text: #4E7A7A;

    /* Header Bar & Global Geometry */
    --tfst-header-bg: #1A1A1A;
    --tfst-header-text: #FAFAFA;
    --tfst-pill: 999px;
    --tfst-shadow: 0 4px 24px rgba(26, 26, 26, 0.08);
}

[data-theme="dark"] {
    /* Canvas & Surfaces (Obsidian #1A1A1A, fallback #1A1A1A) */
    --tfst-canvas: #1A1A1A;
    --tfst-bg: #1A1A1A;
    --tfst-card: #1A1A1A;
    --tfst-border: #1A1A1A;

    /* Typography & Ink */
    --tfst-heading: #C6A48F;
    --tfst-ink: #FAFAFA;
    --tfst-text: #FAFAFA;
    --tfst-muted: #A87B8A;

    /* Brand Accents */
    --tfst-bordeaux: #7A5160;
    --tfst-accent: #7A5160;
    --tfst-bordeaux-hover: #C6A48F;
    --tfst-accent-hover: #C6A48F;
    --tfst-rose: #A87B8A;
    --tfst-teal: #4E7A7A;
    --tfst-beige: #C6A48F;

    /* Form Controls (Strictly NO white input boxes) */
    --tfst-input-bg: #1A1A1A;
    --tfst-input-border: #1A1A1A;
    --tfst-input-text: #FAFAFA;

    /* Notices & Badges */
    --tfst-notice-bg: #1A1A1A;
    --tfst-notice-border: #4E7A7A;
    --tfst-notice-text: #4E7A7A;

    /* Header Bar & Global Geometry */
    --tfst-header-bg: #1A1A1A;
    --tfst-header-text: #FAFAFA;
    --tfst-pill: 999px;
    --tfst-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

/* Global Applied Theming & Omniscreen Responsiveness */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
    background-color: var(--tfst-canvas);
    color: var(--tfst-ink);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'DM Sans', -apple-system, sans-serif;
    box-sizing: border-box;
    transition: background-color 0.25s ease, color 0.25s ease;
}

main, .dashboard-container, .portal-main {
    background-color: var(--tfst-canvas);
    overflow-x: hidden;
    box-sizing: border-box;
}

.portal-card,
.dashboard-card,
.login-card,
.onboard-card,
.stat-card,
.metric-card,
[class*="card"] {
    background-color: var(--tfst-card);
    border: 1px solid var(--tfst-border);
    color: var(--tfst-text);
    border-radius: clamp(12px, 1.5vw, 24px);
    padding: var(--tfst-card-padding);
    box-shadow: var(--tfst-shadow);
    transition: background-color 0.25s ease, border-color 0.25s ease;
    box-sizing: border-box;
}

h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: var(--tfst-heading);
    font-size: var(--tfst-title-fluid);
    font-weight: 600;
    line-height: 1.15;
    transition: color 0.25s ease;
}

h2, h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: var(--tfst-heading);
    font-weight: 500;
    line-height: 1.25;
    transition: color 0.25s ease;
}

p.portal-subtitle {
    color: var(--tfst-muted);
}

label {
    color: var(--tfst-ink);
}

.label-es {
    color: var(--tfst-muted);
}

/* Form Controls Dual-Mode Parity */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-height: var(--tfst-input-height);
    padding: 12px 16px;
    border: 1px solid var(--tfst-input-border);
    border-radius: 8px;
    background-color: var(--tfst-input-bg);
    color: var(--tfst-input-text);
    font-family: 'DM Sans', sans-serif;
    font-size: var(--tfst-input-font);
    box-sizing: border-box;
    transition: border-color 0.2s ease, background-color 0.25s ease, color 0.25s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #4E7A7A;
    box-shadow: 0 0 0 3px rgba(78, 122, 122, 0.15);
}

select option {
    background-color: var(--tfst-card);
    color: var(--tfst-text);
}

/* Primary Action Button: #7A5160 999px pill */
button[type="submit"],
.btn-pill,
.btn-decrypt,
a.btn-decrypt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: var(--tfst-input-height);
    background-color: #7A5160;
    color: #FAFAFA !important;
    border: none;
    border-radius: var(--tfst-pill);
    padding: 12px 28px;
    font-size: var(--tfst-input-font);
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-sizing: border-box;
}

button[type="submit"]:hover,
.btn-pill:hover,
.btn-decrypt:hover {
    background-color: #C6A48F;
    color: #1A1A1A !important;
    transform: translateY(-1px);
}

/* Security Notice Box */
.security-notice {
    background: var(--tfst-notice-bg);
    border: 1px solid var(--tfst-notice-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: var(--tfst-grid-gap);
    align-items: flex-start;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.security-notice-icon {
    color: #4E7A7A;
    flex-shrink: 0;
    margin-top: 2px;
}

.security-notice-text {
    font-size: 0.85rem;
    color: var(--tfst-notice-text);
    line-height: 1.45;
}

/* Widespread Horizontal Login & Onboarding Canvas (TFST-512, TFST-513) */
.login-card,
.onboard-card {
    width: min(calc(100vw - 3rem), 1560px);
    max-width: 1560px;
    min-height: calc(88vh - 80px);
    margin: 1.5rem auto;
    padding: clamp(2rem, calc(1.5rem + 2.5vw), 4.5rem);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(2rem, calc(1.5rem + 2vw), 5rem);
    align-items: center;
    border-radius: 20px;
}

@media (max-width: 980px) {
    .login-card,
    .onboard-card {
        grid-template-columns: 1fr;
        padding: clamp(1.5rem, calc(1rem + 2vw), 2.5rem);
        gap: 2rem;
        min-height: auto;
    }
}

/* Pure White Quiet-Zone Container for TOTP QR Code (TFST-512) */
.qr-quiet-zone {
    display: inline-block;
    padding: 16px;
    background: #FAFAFA !important;
    border-radius: 16px;
    border: 1px solid #FAFAFA;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Triple-MFA Tab Bar and Panes (TFST-513) */
.mfa-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.mfa-tab-btn {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--tfst-border);
    background: var(--tfst-card);
    color: var(--tfst-text);
    transition: all 0.2s ease;
}

.mfa-tab-btn.active {
    background: #7A5160;
    color: #FAFAFA !important;
    border-color: #7A5160;
}

.mfa-tab-pane {
    display: none;
}

.mfa-tab-pane.active {
    display: block;
}

/* Posh MFA Panels (TFST-514) */
#mfa-panel-totp,
#mfa-panel-email,
#mfa-panel-passkey {
    transition: opacity 0.25s ease;
}

/* Luxury Sidebar Shell & Client Portal Layout (TFST-519 / TFST-521) */
.portal-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    background-color: var(--tfst-canvas);
    color: var(--tfst-ink);
    position: relative;
    overflow-x: clip;
    box-sizing: border-box;
}

.portal-sidebar {
    width: 255px;
    min-width: 255px;
    max-width: 255px;
    background-color: #7A5160;
    color: #FAFAFA;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem 1rem;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    overflow-y: auto;
    box-sizing: border-box;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    background-color: var(--tfst-canvas);
    overflow-x: hidden;
    padding: 1.5rem 2rem 2rem 2rem;
    max-width: calc(100vw - 255px);
    box-sizing: border-box;
}

@media (min-width: 1024px) {
    .portal-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 255px;
        min-width: 255px;
        max-width: 255px;
        height: 100vh;
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        z-index: 100;
    }

    .portal-sidebar::-webkit-scrollbar {
        display: none;
    }

    .portal-main {
        margin-left: 255px;
        width: calc(100% - 255px);
        max-width: calc(100vw - 255px);
        min-height: 100vh;
    }
}

@media (max-width: 1023px) {
    .portal-sidebar {
        transform: translateX(-100%);
    }

    .portal-main {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        padding: 1rem 1.25rem;
    }
}

.portal-content-body {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.portal-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 1.25rem 0;
}

.portal-nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    color: rgba(250, 250, 250, 0.85);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    box-sizing: border-box;
}

.portal-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FAFAFA;
}

.portal-nav-item.active {
    background: rgba(255, 255, 255, 0.18);
    color: #FAFAFA;
    font-weight: 600;
    border-left-color: #C6A48F;
}

.portal-nav-icon,
.portal-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 2;
}

.portal-help-card {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 0.8125rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.portal-help-card h4 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.05rem;
    color: #C6A48F;
    margin: 0 0 0.25rem 0;
    font-weight: 600;
}

.portal-help-card p {
    font-size: 0.78rem;
    color: rgba(250, 250, 250, 0.8);
    line-height: 1.35;
    margin: 0;
}

.portal-signout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #FAFAFA !important;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.portal-signout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #FAFAFA !important;
}

/* Compact Welcome Header & Dual Summary Cards (TFST-519 / TFST-521) */
.portal-welcome-card {
    padding: 1.25rem 1.75rem !important;
    margin-bottom: 1.25rem;
    box-sizing: border-box;
}

.portal-welcome-card h1 {
    font-size: clamp(1.5rem, 2vw, 1.85rem) !important;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.portal-welcome-meta {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--tfst-muted);
    font-weight: 500;
}

.portal-dual-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.portal-summary-card {
    border-radius: 14px;
    padding: 1rem 1.25rem;
    box-shadow: var(--tfst-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.portal-summary-card.secure-card {
    background: var(--tfst-notice-bg);
    border: 1px solid #4E7A7A;
}

.portal-summary-card.video-card {
    background: var(--tfst-card);
    border: 1px solid var(--tfst-border);
}

/* Balanced 2-Column Content Grid (TFST-519 / TFST-521) */
.portal-grid-2col {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-items: start;
}

.portal-grid-2col > * {
    min-width: 0;
}

.progress-badge,
.progress-meta {
    white-space: nowrap;
    flex-shrink: 0;
}

.portal-card,
.callout-box,
.email-wrap {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 1024px) {
    .portal-grid-2col {
        grid-template-columns: 1fr;
    }
}

/* Mobile Bar and Drawer (TFST-519 / TFST-528) */
.portal-mobile-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: #1A1A1A;
    color: #FAFAFA;
    border-bottom: 1px solid #7A5160;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    position: sticky;
    top: 0;
    z-index: 999;
}

.portal-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 990;
}

@media (max-width: 1023px) {
    .portal-shell {
        display: block !important;
        width: 100% !important;
        overflow-x: hidden;
    }

    .portal-mobile-bar {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 950 !important;
        background: #1A1A1A !important;
    }

    .portal-sidebar {
        position: fixed !important;
        top: 0;
        left: -280px !important;
        bottom: 0;
        width: 260px !important;
        min-width: 260px;
        max-width: 260px;
        height: 100vh;
        transform: translateX(-100%) !important;
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.25s ease, left 0.25s ease, visibility 0.25s ease;
        z-index: 1000 !important;
    }

    .portal-sidebar.is-open,
    body.sidebar-open .portal-sidebar {
        left: 0 !important;
        transform: translateX(0) !important;
        visibility: visible;
        pointer-events: auto;
    }

    body.sidebar-open .portal-drawer-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .portal-main {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 1rem !important;
        padding-top: 78px !important;
        box-sizing: border-box !important;
    }
}

/* Admin Filter Tabs & Three-Dots Case Dropdown (TFST-526) */
#registryTabs button {
    background: #FAFAFA;
    color: #7A5160 !important;
    border: 1.5px solid #A87B8A;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 1 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

#registryTabs button.is-active {
    background: #7A5160 !important;
    color: #FAFAFA !important;
    border-color: #7A5160;
}

.case-actions-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.case-actions-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #A87B8A;
    background: #FAFAFA;
    color: #7A5160;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.case-actions-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 220px;
    background: #FAFAFA;
    border: 1px solid #A87B8A;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(26, 26, 26, 0.22);
    padding: 0.4rem;
    z-index: 1200;
    flex-direction: column;
    gap: 0.2rem;
    text-align: left;
}

[data-theme="dark"] .case-actions-menu {
    background: #1A1A1A;
    border-color: #A87B8A;
}

.case-actions-menu.is-open {
    display: flex;
}

.case-actions-menu .case-action-btn {
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.85rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #1A1A1A;
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
}

[data-theme="dark"] .case-actions-menu .case-action-btn {
    color: #FAFAFA;
}

.case-actions-menu .case-action-btn:hover {
    background: rgba(168, 123, 138, 0.16);
}

.case-actions-menu .case-action-btn[data-action="delete"] {
    color: #7A5160;
    font-weight: 600;
}

.case-view-btn {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .portal-dual-cards,
    .portal-grid-2col {
        grid-template-columns: 1fr;
    }

    .admin-table thead {
        display: none !important;
    }

    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table tr.case-row,
    .admin-table td {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .admin-table tr,
    .admin-table tr.case-row {
        background: #FAFAFA;
        color: #1A1A1A;
        border: 1px solid #A87B8A;
        border-radius: 16px;
        padding: 1rem;
        margin-bottom: 1rem;
    }

    [data-theme="dark"] .admin-table tr,
    [data-theme="dark"] .admin-table tr.case-row {
        background: #1A1A1A;
        color: #FAFAFA;
    }

    .admin-table td {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.45rem 0;
        border-bottom: 1px solid rgba(168, 123, 138, 0.18);
        text-align: right;
        white-space: normal;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .admin-table td:nth-child(1),
    .admin-table td:nth-child(2) {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.3rem;
        text-align: left !important;
    }

    .admin-email-truncate {
        max-width: 100%;
        white-space: normal;
        word-break: break-word;
    }

    .admin-table td:last-child {
        border-bottom: none;
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }

    .admin-table td::before {
        content: attr(data-label);
        font-size: 0.72rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #7A5160;
        text-align: left;
        flex-shrink: 0;
    }

    [data-theme="dark"] .admin-table td::before {
        color: #C6A48F;
    }

    .case-actions-dropdown {
        width: 100%;
        justify-content: space-between;
    }

    .case-view-btn {
        width: 100%;
        text-align: center;
        white-space: nowrap;
    }
}

@media (max-width: 767px) {
    .admin-header-actions {
        display: block !important;
        width: 100%;
    }

    .admin-header-actions > button,
    .admin-header-actions > a {
        display: block !important;
        width: 100% !important;
        text-align: center;
        justify-content: center;
        margin-bottom: 0.625rem;
    }
}

/* Multi-Step Intake Stepper (TFST-520) */
.intake-stepper-container {
    width: 100%;
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

.intake-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 640px;
    position: relative;
    padding: 0;
    margin: 0;
    list-style: none;
}

.intake-stepper::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 32px;
    right: 32px;
    height: 2px;
    background: var(--tfst-border);
    z-index: 1;
}

.stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
    text-align: center;
    background: transparent;
    border: none;
    padding: 0 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.stepper-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--tfst-card);
    border: 2px solid var(--tfst-border);
    color: var(--tfst-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: var(--tfst-shadow);
}

.stepper-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tfst-muted);
    max-width: 105px;
    line-height: 1.25;
    transition: color 0.2s ease;
}

/* Active Step: #7A5160 Pill Accent */
.stepper-item.active .stepper-circle {
    background: #7A5160;
    border-color: #7A5160;
    color: #FAFAFA;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(122, 81, 96, 0.35);
}

.stepper-item.active .stepper-label {
    color: var(--tfst-heading);
    font-weight: 700;
}

/* Completed Step: #4E7A7A Circle with checkmark */
.stepper-item.completed .stepper-circle {
    background: #4E7A7A;
    border-color: #4E7A7A;
    color: #FAFAFA;
}

.stepper-item.completed .stepper-label {
    color: #4E7A7A;
}

/* Step Panels */
.intake-panel {
    display: none;
    animation: fadeInStep 0.22s ease-in-out;
}

.intake-panel.active {
    display: block;
}

@keyframes fadeInStep {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer Actions */
.intake-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--tfst-border);
}

/* TFST-522: Sidebar Brand Crest, Locked Record Summary & Admin Dossier / MCP Vault */
.portal-sidebar-logo-wrap {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    text-align: center;
}

.portal-sidebar-crest {
    background: rgba(20, 18, 20, 0.84);
    border: 1px solid rgba(198, 164, 143, 0.36);
    border-radius: 16px;
    padding: 0.75rem 0.75rem 0.25rem 0.75rem;
    margin-bottom: 0.65rem;
}

.locked-summary-card {
    background: var(--tfst-card);
    border: 1px solid rgba(78, 122, 122, 0.35);
    border-left: 4px solid #4E7A7A;
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--tfst-shadow);
}

.locked-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(78, 122, 122, 0.14);
    color: #4E7A7A;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.addendum-drawer {
    background: var(--tfst-card);
    border: 1px solid var(--tfst-border);
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    margin-top: 1.25rem;
    box-shadow: var(--tfst-shadow);
}

.addendum-timeline-item {
    border-left: 3px solid #A87B8A;
    padding: 0.75rem 1rem;
    background: rgba(122, 81, 96, 0.04);
    border-radius: 0 10px 10px 0;
    margin-bottom: 0.75rem;
}

.admin-nav-links,
.admin-nav-pills {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-left: auto;
    margin-right: 1.75rem;
}

.admin-nav-tab {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--tfst-ink);
    border: 1px solid var(--tfst-border);
    transition: all 0.2s ease;
}

.admin-nav-tab.active {
    background: #7A5160;
    color: #FAFAFA !important;
    border-color: #7A5160;
}

.dossier-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dossier-card {
    background: var(--tfst-card);
    border: 1px solid var(--tfst-border);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: var(--tfst-shadow);
}

.dossier-kv {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0.5rem 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--tfst-border);
    font-size: 0.9rem;
}

.dossier-kv:last-child {
    border-bottom: none;
}

.mcp-tier-banner {
    background: rgba(78, 122, 122, 0.1);
    border: 1px solid rgba(78, 122, 122, 0.35);
    border-left: 4px solid #4E7A7A;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.mcp-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: #4E7A7A;
    color: #FAFAFA;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 900px) {
    .dossier-grid, .dossier-kv {
        grid-template-columns: 1fr;
    }
}

/* TFST-523 / TFST-529: Pre-Session Location Check-In Modal & Subtle Recovery Link */
.portal-subtle-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: #7A5160;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease, opacity 0.2s ease;
}

[data-theme="dark"] .portal-subtle-link {
    color: #C6A48F;
}

.portal-subtle-link:hover {
    color: #A87B8A;
    opacity: 0.95;
}

a.forgot-password-link,
.forgot-password-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: #7A5160 !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

html[data-theme="dark"] a.forgot-password-link,
body.dark-mode a.forgot-password-link,
[data-theme="dark"] a.forgot-password-link,
html[data-theme="dark"] .forgot-password-link,
body.dark-mode .forgot-password-link,
[data-theme="dark"] .forgot-password-link {
    color: #C6A48F !important;
}

a.forgot-password-link:hover,
.forgot-password-link:hover {
    color: #A87B8A !important;
}

.portal-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(20, 14, 17, 0.72);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    box-sizing: border-box;
}

.portal-modal-overlay.open {
    display: flex;
}

.portal-modal-card {
    width: 100%;
    max-width: 520px;
    background: var(--tfst-card);
    color: var(--tfst-text);
    border: 1px solid var(--tfst-border);
    border-radius: 16px;
    padding: clamp(1.5rem, 2.5vw, 2rem);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    position: relative;
    box-sizing: border-box;
}

.portal-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: 1px solid var(--tfst-border);
    color: var(--tfst-muted);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.portal-modal-warning {
    display: none;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    background: rgba(122, 81, 96, 0.12);
    border: 1px solid #7A5160;
    color: var(--tfst-heading);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-top: 0.9rem;
}

/* TFST-527 / TFST-528: Horizontal Logo Header/Mobile, 3x2 Mobile Stepper, Luxury Footer & Admin Table Polish */
.portal-mobile-logo {
    height: 38px;
    width: auto;
    max-width: 210px;
    background: transparent;
    display: block;
    object-fit: contain;
}

.admin-header-logo {
    height: 56px;
    width: auto;
    max-width: 280px;
    background: transparent;
    display: block;
    object-fit: contain;
}

.admin-brand,
.tfst-admin-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    background: transparent;
}

.site-header,
.tfst-site-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 950 !important;
}

.admin-header,
.tfst-admin-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 950 !important;
}

body.has-fixed-site-header,
body.has-fixed-admin-header {
    padding-top: 84px;
}

.admin-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header-subtitle {
    display: inline-block;
    margin-left: 1.25rem;
    font-size: 0.72rem;
    color: #C6A48F;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem 0.55rem !important;
    font-size: 0.85rem;
}

.admin-table th:nth-child(4) {
    white-space: nowrap;
}

.admin-email-truncate {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.intake-mobile-step-badge {
    display: none;
}

@media (max-width: 767px) {
    body.has-fixed-site-header,
    body.has-fixed-admin-header {
        padding-top: 118px;
    }

    .site-header,
    header.tfst-site-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 950 !important;
        width: 100% !important;
        padding: 0 !important;
    }

    .site-header-inner,
    .portal-top-nav {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.6rem !important;
        padding: 0.75rem 1rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .site-header .tfst-brand-link {
        justify-content: center !important;
    }

    .site-header .tfst-brand-logo-img {
        height: 44px !important;
        max-width: min(320px, 85vw) !important;
    }

    .site-header .tfst-nav-controls {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        gap: 0.65rem !important;
        margin: 0 !important;
    }

    .site-header .tfst-vault-badge-header {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    .admin-header,
    .tfst-admin-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 950 !important;
        width: 100% !important;
        padding: 0.85rem 1rem !important;
    }

    .admin-header-inner {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
        padding: 0.85rem 1rem !important;
        width: 100% !important;
    }

    .admin-brand,
    .tfst-admin-brand {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.35rem !important;
        width: 100% !important;
    }

    .admin-header-subtitle {
        margin-left: 0 !important;
        margin-top: 0.15rem !important;
        padding-left: 0 !important;
        border-left: none !important;
        text-align: left !important;
        display: block !important;
    }

    .admin-nav-links,
    .admin-nav-pills {
        justify-content: flex-start !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .admin-controls {
        justify-content: flex-start !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .intake-mobile-step-badge {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        background: rgba(122, 81, 96, 0.1);
        border: 1px solid #A87B8A;
        color: var(--tfst-heading);
        padding: 0.55rem 0.9rem;
        border-radius: 10px;
        font-size: 0.84rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
    }

    .intake-stepper-container {
        overflow-x: visible;
        padding-bottom: 0.25rem;
    }

    .intake-stepper {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
        min-width: 0 !important;
    }

    .intake-stepper::before {
        display: none !important;
    }

    .stepper-item {
        padding: 0.35rem 0.2rem;
    }

    .stepper-circle {
        width: 32px;
        height: 32px;
        font-size: 0.82rem;
        margin-bottom: 0.3rem;
    }

    .stepper-label {
        font-size: 0.68rem;
        max-width: none;
        line-height: 1.2;
    }
}

.tfst-luxury-footer {
    background: #1A1A1A;
    color: #FAFAFA;
    border-top: 2px solid #7A5160;
    padding: 3rem 1.75rem 2rem;
    margin-top: 3rem;
    border-radius: 16px;
}

.tfst-luxury-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.tfst-luxury-footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.tfst-luxury-footer h2,
.tfst-luxury-footer h3 {
    color: #C6A48F;
    margin-top: 0;
}

.tfst-luxury-footer h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.45rem;
    font-weight: 600;
    margin-bottom: 0.7rem;
}

.tfst-luxury-footer h3 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.9rem;
}

.tfst-luxury-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tfst-luxury-footer li {
    margin-bottom: 0.55rem;
}

.tfst-luxury-footer a {
    color: #FAFAFA;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.tfst-luxury-footer a:hover {
    color: #C6A48F;
    text-decoration: underline;
}

.tfst-luxury-founder {
    color: #FAFAFA;
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.tfst-luxury-desc {
    color: rgba(250, 250, 250, 0.78);
    font-size: 0.84rem;
    line-height: 1.55;
    margin: 0;
}

.tfst-luxury-footer-bottom {
    border-top: 1px solid #4E7A7A;
    box-shadow: inset 0 1px 0 rgba(168, 123, 138, 0.35);
    padding-top: 1.35rem;
    font-size: 0.8rem;
    line-height: 1.55;
    color: rgba(250, 250, 250, 0.7);
}

.tfst-luxury-footer-bottom strong {
    color: #C6A48F;
}

@media (max-width: 900px) {
    .tfst-luxury-footer-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .tfst-luxury-footer {
        padding: 2rem 1.25rem 1.5rem;
    }
}

/* TFST-536 Luxury Validation Callout & Missing-Field Highlights */
.tfst-validation-callout {
    background: #FAFAFA;
    border: 1.5px solid #A87B8A;
    border-left: 5px solid #7A5160;
    border-radius: 12px;
    padding: 0.95rem 1.15rem;
    color: #1A1A1A;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    box-shadow: 0 4px 14px rgba(122, 81, 96, 0.12);
    text-align: left;
    font-size: 0.88rem;
    line-height: 1.45;
}
.tfst-validation-callout-title {
    font-weight: 700;
    color: #7A5160;
    margin-bottom: 0.2rem;
}
.tfst-field-missing {
    border: 2px solid #7A5160 !important;
    background-color: #FAFAFA !important;
    box-shadow: 0 0 0 3px rgba(122, 81, 96, 0.16) !important;
}
.tfst-field-error-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #A87B8A;
    border-left: 3.5px solid #7A5160;
    background: #FAFAFA;
    color: #1A1A1A;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.35;
}
.tfst-field-error-badge {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #7A5160;
    color: #FAFAFA;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}
html[data-theme="dark"] .tfst-validation-callout,
body.dark-mode .tfst-validation-callout,
[data-theme="dark"] .tfst-validation-callout {
    background: #1A1A1A;
    border: 1.5px solid #A87B8A;
    border-left: 5px solid #C6A48F;
    color: #FAFAFA;
}
html[data-theme="dark"] .tfst-validation-callout-title,
body.dark-mode .tfst-validation-callout-title,
[data-theme="dark"] .tfst-validation-callout-title {
    color: #C6A48F;
}
html[data-theme="dark"] .tfst-field-missing,
body.dark-mode .tfst-field-missing,
[data-theme="dark"] .tfst-field-missing {
    border: 2px solid #C6A48F !important;
    box-shadow: 0 0 0 3px rgba(198, 164, 143, 0.22) !important;
}
html[data-theme="dark"] .tfst-field-error-hint,
body.dark-mode .tfst-field-error-hint,
[data-theme="dark"] .tfst-field-error-hint {
    border-color: #A87B8A;
    border-left-color: #C6A48F;
    background: #1A1A1A;
    color: #FAFAFA;
}
html[data-theme="dark"] .tfst-field-error-badge,
body.dark-mode .tfst-field-error-badge,
[data-theme="dark"] .tfst-field-error-badge {
    background: #C6A48F;
    color: #1A1A1A;
}

/* TFST-537 Browser Autofill Override */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #FAFAFA inset !important;
    -webkit-text-fill-color: #1A1A1A !important;
    transition: background-color 5000s ease-in-out 0s;
}
html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus,
html[data-theme="dark"] select:-webkit-autofill,
html[data-theme="dark"] textarea:-webkit-autofill,
body.dark-mode input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #1A1A1A inset !important;
    -webkit-text-fill-color: #FAFAFA !important;
}

/* TFST-538 Required Field Star & Legend */
.tfst-req-star {
    color: #7A5160;
    font-weight: 700;
    margin-left: 2px;
}
html[data-theme="dark"] .tfst-req-star,
body.dark-mode .tfst-req-star,
[data-theme="dark"] .tfst-req-star {
    color: #C6A48F;
}
.tfst-req-legend {
    margin: 0.65rem 0 0 0;
    font-size: 0.8rem;
    color: var(--tfst-muted);
    line-height: 1.4;
}

/* TFST-539 Intake Nav, Stage 2 Pill, Teal Completion Rewards & 3-Stage Onboarding */
.tfst-stage-pill {
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.35rem 0.9rem;
}
.tfst-btn-secondary {
    background: transparent !important;
    border: 1.5px solid #7A5160 !important;
    color: #7A5160 !important;
    border-radius: 999px !important;
    padding: 9px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}
.tfst-btn-secondary:hover {
    background: rgba(122, 81, 96, 0.08) !important;
}
html[data-theme="dark"] .tfst-btn-secondary,
body.dark-mode .tfst-btn-secondary,
[data-theme="dark"] .tfst-btn-secondary {
    border-color: #C6A48F !important;
    color: #C6A48F !important;
}
.tfst-field-complete {
    border: 1.5px solid #4E7A7A !important;
    box-shadow: 0 0 0 2px rgba(78, 122, 122, 0.14) !important;
}
.tfst-field-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.45rem;
    color: #4E7A7A;
    font-size: 0.78rem;
    font-weight: 700;
    background: transparent;
    opacity: 0;
    animation: tfstCheckFadeIn 0.22s ease forwards;
}
@keyframes tfstCheckFadeIn {
    from { opacity: 0; transform: translateY(1px); }
    to { opacity: 1; transform: translateY(0); }
}
.tfst-intake-progress-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(78, 122, 122, 0.16);
    overflow: hidden;
    margin-bottom: 1rem;
}
.tfst-intake-progress-fill {
    height: 100%;
    background: #4E7A7A;
    border-radius: 999px;
    transition: width 0.28s ease;
}
.tfst-reassurance-banner {
    background: rgba(78, 122, 122, 0.08);
    border: 1px solid rgba(78, 122, 122, 0.4);
    border-left: 4px solid #4E7A7A;
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.25rem;
    font-size: 0.84rem;
    color: var(--tfst-text);
    line-height: 1.45;
}
.tfst-onboarding-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1rem;
}
@media (max-width: 767px) {
    .tfst-onboarding-grid {
        grid-template-columns: 1fr;
    }
}

/* TFST-540 Unified #7A5160 Primary Pill Parity & Read-Only Notice */
.intake-footer-actions .btn-primary,
.tfst-btn-primary,
#nextStepBtn,
#submitIntakeBtn,
#submitBtn {
    background-color: #7A5160 !important;
    color: #FAFAFA !important;
    border: 1.5px solid #7A5160 !important;
    border-radius: 999px !important;
    opacity: 1 !important;
}
.intake-footer-actions .btn-primary:hover,
.tfst-btn-primary:hover,
#nextStepBtn:hover,
#submitIntakeBtn:hover,
#submitBtn:hover {
    background-color: #C6A48F !important;
    border-color: #C6A48F !important;
    color: #1A1A1A !important;
}
.tfst-readonly-notice {
    background: rgba(78, 122, 122, 0.08);
    border: 1.5px solid #A87B8A;
    border-left: 5px solid #4E7A7A;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--tfst-text);
    font-size: 0.88rem;
    line-height: 1.5;
}
html[data-theme="dark"] .tfst-readonly-notice,
body.dark-mode .tfst-readonly-notice,
[data-theme="dark"] .tfst-readonly-notice {
    background: rgba(48, 40, 44, 0.92);
    border-color: #A87B8A;
    border-left-color: #4E7A7A;
    color: #FAFAFA;
}

