/* ==========================================================================
   Shared chrome — "Depth of Field" skin for pieces that appear on many pages:
   page grounds, the top bar (Log out / Home / Back), legacy modals
   (.pricing-modal), the legal documents (Terms, Privacy, Disclaimer),
   scrollbars. Loaded after fl-system.css and before a page's own skin.
   Same rules as every skin: layered, !important on visual properties only.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Legacy page plumbing (was polish.css, retired in session 4). Unlayered,
   in its old order and cascade position (it loaded just before
   fl-system.css): top-bar placement on legacy pages, the phone browser
   edges, dashboard dock positions, account-flow message placement.
   -------------------------------------------------------------------------- */
:root {
    --fl-blue-bright: #4d9fff;
    --fl-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------------
   Top bar: LOGOUT (left) and BACK / HOME (right)
   Slimmer and quieter: hairline borders, soft depth instead of neon glow,
   tracked uppercase labels. LOGOUT keeps the brand coral in both themes.
   -------------------------------------------------------------------------- */
html body .back-button[data-action="handleLogoutClick"],
html body .home-button {
    /* (display is left to each page: some hide these buttons from script) */
    min-width: 84px !important;
    height: 36px !important;
    padding: 0 16px !important;
    line-height: 33px !important;
    text-align: center !important;
    border-width: 1.5px !important;
    border-style: solid !important;
    border-radius: 10px !important;
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.14em !important;
    text-shadow: none !important;
    white-space: nowrap !important;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
                box-shadow 0.2s ease, transform 0.2s var(--fl-ease),
                opacity 0.3s ease !important;
}

/* Dark theme */
html.theme-dark body .back-button[data-action="handleLogoutClick"] {
    background: rgba(253, 80, 111, 0.08) !important;
    border-color: rgba(253, 80, 111, 0.55) !important;
    color: #ff6b86 !important;
    box-shadow: 0 0 14px rgba(253, 80, 111, 0.16), 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

html.theme-dark body .home-button {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.38) !important;
    color: #f0f0f0 !important;
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.07), 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

/* Light theme */
html.theme-light body .back-button[data-action="handleLogoutClick"] {
    background: rgba(253, 80, 111, 0.06) !important;
    border-color: rgba(226, 61, 92, 0.5) !important;
    color: #e23d5c !important;
    box-shadow: 0 2px 10px rgba(253, 80, 111, 0.12) !important;
}

html.theme-light body .home-button {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.16) !important;
    color: #111111 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07) !important;
}

/* Hover (pointer devices) and press */
@media (hover: hover) {
    html body .back-button[data-action="handleLogoutClick"]:hover {
        background: var(--fl-coral) !important;
        border-color: var(--fl-coral) !important;
        color: #ffffff !important;
        box-shadow: 0 6px 20px rgba(253, 80, 111, 0.35) !important;
        transform: translateY(-1px) !important;
    }

    html.theme-dark body .home-button:hover {
        background: #f0f0f0 !important;
        border-color: #f0f0f0 !important;
        color: #000000 !important;
        box-shadow: 0 6px 20px rgba(255, 255, 255, 0.18) !important;
        transform: translateY(-1px) !important;
    }

    html.theme-light body .home-button:hover {
        background: #111111 !important;
        border-color: #111111 !important;
        color: #ffffff !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18) !important;
        transform: translateY(-1px) !important;
    }
}

html body .back-button[data-action="handleLogoutClick"]:active,
html body .home-button:active {
    transform: scale(0.96) !important;
}

/* "Choose your path" sat against the very top edge */
html body .match-start-header {
    padding-top: calc(env(safe-area-inset-top, 0px) + 36px) !important;
}

/* --------------------------------------------------------------------------
   Dashboard: settings and messages icons sit in glass discs that match the
   centre pill (icon centres stay exactly where they were)
   -------------------------------------------------------------------------- */
html body #user-dashboard .settings-icon,
html body #user-dashboard .message-icon {
    padding: 12px !important;
    bottom: 47px !important;
    border-radius: 50% !important;
    line-height: 0 !important;
    transition: transform 0.2s var(--fl-ease), box-shadow 0.2s ease, border-color 0.2s ease;
}

html body #user-dashboard .settings-icon { left: 47px !important; }
html body #user-dashboard .message-icon { right: 47px !important; }

@media (max-width: 600px) {
    html body #user-dashboard .settings-icon,
    html body #user-dashboard .message-icon {
        padding: 10px !important;
        bottom: 24px !important;
    }

    html body #user-dashboard .settings-icon { left: 24px !important; }
    html body #user-dashboard .message-icon { right: 24px !important; }
}

html.theme-dark body #user-dashboard .settings-icon,
html.theme-dark body #user-dashboard .message-icon {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.13);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 8px 22px rgba(0, 0, 0, 0.5);
}

html.theme-light body #user-dashboard .settings-icon,
html.theme-light body #user-dashboard .message-icon {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

html body #user-dashboard .settings-icon:active,
html body #user-dashboard .message-icon:active {
    transform: scale(0.94);
}

/* --------------------------------------------------------------------------
   Account flows (login, forgot password, change password / email / number):
   messages float just below their step, so the form doesn't jump when one
   appears or goes
   -------------------------------------------------------------------------- */
#loginSection,
.phone-entry-section,
.verification-section,
.password-reset-section,
.email-change-section,
.confirmation-section {
    position: relative;
}

#loginSection > :is(.error-message, .success-message),
.phone-entry-section > :is(.error-message, .success-message),
.verification-section > :is(.error-message, .success-message),
.password-reset-section > :is(.error-message, .success-message),
.email-change-section > :is(.error-message, .success-message),
.confirmation-section > :is(.error-message, .success-message) {
    position: absolute !important;
    top: 100%;
    left: 50%;
    width: max-content;
    max-width: min(520px, calc(100vw - 40px));
    margin: 4px 0 0 !important;
    transform: translateX(-50%);
    z-index: 5;
    animation: flMessageIn 0.25s ease-out backwards;
}

@keyframes flMessageIn {
    from { opacity: 0; transform: translate(-50%, -6px); }
}

/* On phones the BACK and main buttons sit side by side, main action on the
   right - as in sign-up and login (these steps stacked them, BACK first) */
@media (max-width: 768px) {
    .phone-entry-section .action-buttons,
    .password-reset-section .action-buttons,
    .email-change-section .action-buttons,
    .confirmation-section .action-buttons {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .phone-entry-section .action-buttons .terminal-button,
    .password-reset-section .action-buttons .terminal-button,
    .email-change-section .action-buttons .terminal-button,
    .confirmation-section .action-buttons .terminal-button {
        width: 100%;
        max-width: 200px;
        min-width: 120px;
        flex: 1;
        padding-left: 10px;
        padding-right: 10px;
        white-space: nowrap;
    }
}

/* --------------------------------------------------------------------------
   A soft fade under the fixed top bar, so content scrolling beneath it
   doesn't run into LOGOUT and BACK (pages whose bar sits directly in <body>:
   settings, billing, report, report e-mail, profile stats)
   -------------------------------------------------------------------------- */
body:has(> .home-button)::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(env(safe-area-inset-top, 0px) + 66px);
    pointer-events: none;
    z-index: 1099;
}

html.theme-dark body:has(> .home-button)::after {
    background: linear-gradient(to bottom, #000000 0%, #000000 50%, rgba(0, 0, 0, 0.8) 72%, rgba(0, 0, 0, 0) 100%);
}

html.theme-light body:has(> .home-button)::after {
    background: linear-gradient(to bottom, #f8f8f8 0%, #f8f8f8 50%, rgba(248, 248, 248, 0.82) 72%, rgba(248, 248, 248, 0) 100%);
}

/* Mobile browser edges
   viewport-fit=cover is already set by the pages. Keep the document as the
   scroll surface so browser toolbars can react to scrolling. Safari controls
   its own glass/status-bar treatment; a fixed full-screen layer cannot force
   content behind it. Installed and Capacitor layouts retain their own rules. */
@media (display-mode: browser) and (max-width: 1024px) {
    html:not(.app-mode) {
        background-color: var(--theme-bg, #000) !important;
        overflow-x: clip;
        scroll-padding-top: calc(72px + env(safe-area-inset-top, 0px));
        scroll-padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }

    html:not(.app-mode) body {
        position: relative;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-x: clip;
        overflow-y: visible;
    }

    /* Leave just the individual floating controls at the top edge. */
    html:not(.app-mode) body:has(> .home-button)::after {
        content: none;
    }

    /* (the top pills' placement is one rule in the layer below, session 5) */
    html:not(.app-mode) body .special-login-button {
        top: calc(15px + env(safe-area-inset-top, 0px)) !important;
    }

    /* These are page surfaces, not dialogs or carousels. A minimum height
       preserves centered short pages and lets longer pages grow naturally. */
    html:not(.app-mode) body :is(
        #landing-page-content, #user-dashboard, #account-page,
        #settings-container, #billing-container, #report-container,
        #contact-container, #stats-container, #match-start-container,
        #match-making-page
    ) {
        position: relative !important;
        inset: auto !important;
        height: auto !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        max-height: none !important;
        overflow: visible !important;
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
        padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    }

    html:not(.app-mode) body :is(#landing-page-content, #user-dashboard, #match-making-page) {
        padding-top: calc(72px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    html:not(.app-mode) body :is(#account-page, #settings-container, #billing-container, #report-container, #contact-container, #stats-container) {
        padding-top: calc(90px + env(safe-area-inset-top, 0px));
    }

    /* Form and About pages use the same nested terminal shell. Let content
       reach the document scroller instead of trapping it inside that shell. */
    html:not(.app-mode) body :is(.terminal-container, .terminal-content) {
        position: relative !important;
        inset: auto !important;
        height: auto !important;
        max-height: none !important;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible !important;
    }

    html:not(.app-mode) body .terminal-content {
        padding-left: max(20px, env(safe-area-inset-left, 0px));
        padding-right: max(20px, env(safe-area-inset-right, 0px));
        padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    }

    /* Some full-page panels live inside a terminal shell. Only the panel
       supplies spacing there, otherwise the shell creates an extra gutter. */
    html:not(.app-mode) body .terminal-content:has(> :is(
        #settings-container, #billing-container, #report-container,
        #contact-container, #stats-container
    )) {
        padding: 0;
    }

    /* Swipe results and step-by-step questions keep their internal scrolling
       and viewport-sized layout, but no longer paint a fixed page-wide layer. */
    html:not(.app-mode) body :is(#request-page, #message-page, #questionnaire-container, #match-page:not(.category-page-active)) {
        position: relative !important;
        inset: auto !important;
        height: 100vh !important;
        height: 100dvh !important;
        padding-left: max(10px, env(safe-area-inset-left, 0px));
        padding-right: max(10px, env(safe-area-inset-right, 0px));
        padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
    }

    html:not(.app-mode) body #background-images-layer,
    html:not(.app-mode) body .terminal-content::before {
        position: absolute !important;
    }

    /* Theme icons travel with the landing content when a short viewport or
       zoom makes it scroll. The positioning script uses this layer's origin. */
    html:not(.app-mode) body #landing-theme-switch,
    html:not(.app-mode) body #landing-theme-switch img.theme-icon {
        position: absolute !important;
    }

    html:not(.app-mode) body #landing-theme-switch {
        width: 100%;
        height: 100%;
        overflow: visible;
    }

    html:not(.app-mode) body .app-store-badges {
        position: relative;
        top: auto !important;
        margin-top: 24px;
        flex-shrink: 0;
    }
}

@layer fl-skin {

/* --------------------------------------------------------------------------
   Grounds and type defaults
   -------------------------------------------------------------------------- */
html,
html body {
    background-color: var(--fl-bg) !important;
    color: var(--fl-ink) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

html body {
    font-family: var(--fl-font-ui) !important;
}

/* Thin, quiet scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--fl-line-3) transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--fl-line-3);
    border: 3px solid transparent;
    border-radius: 10px;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--fl-ink-4); }

/* --------------------------------------------------------------------------
   Top bar: Log out (left) and Home / Back (right) — quiet hairline pills
   -------------------------------------------------------------------------- */
html body .back-button[data-action="handleLogoutClick"],
html body .home-button {
    /* 44px to tap, 40px to see: a transparent 2px border is the extra hit
       area; the hairline is an inset shadow on the padding box */
    min-width: 0 !important;
    height: 44px !important;
    padding: 0 18px !important;
    line-height: 40px !important;
    border: 2px solid transparent !important;
    border-radius: var(--fl-r-pill) !important;
    background: color-mix(in srgb, var(--fl-bg) 74%, transparent) !important;
    background-clip: padding-box !important;
    color: var(--fl-ink-2) !important;
    font-family: var(--fl-font-ui) !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: lowercase !important;
    text-shadow: none !important;
    box-shadow: inset 0 0 0 1px var(--fl-line-2) !important;
}

/* Placement, one rule for every page (session 5; it lived in fl-account,
   fl-forms and page CSS, 15px on some desktops and 20px on others):
   fixed, 15px in from the safe area on phones and tablets, 20px on desktop.
   z-index stays with each page (overlays there sit above or below it). */
html body :is(.back-button[data-action="handleLogoutClick"], .home-button) {
    --_inset: 15px;
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + var(--_inset)) !important;
    bottom: auto !important;
    margin: 0 !important;
    cursor: pointer !important;
}
html body .back-button[data-action="handleLogoutClick"] {
    left: calc(env(safe-area-inset-left, 0px) + var(--_inset)) !important;
    right: auto !important;
}
html body .home-button {
    right: calc(env(safe-area-inset-right, 0px) + var(--_inset)) !important;
    left: auto !important;
}
@media (min-width: 1025px) {
    html body :is(.back-button[data-action="handleLogoutClick"], .home-button) { --_inset: 20px; }
}

/* the labels are written in capitals; show them as words */
html body .back-button[data-action="handleLogoutClick"]::first-letter,
html body .home-button::first-letter { text-transform: uppercase !important; }

html body .back-button[data-action="handleLogoutClick"] {
    color: var(--fl-ink-3) !important;
}

@media (hover: hover) {
    html body .home-button:hover {
        background: var(--fl-surface-2) !important;
        background-clip: padding-box !important;
        color: var(--fl-ink) !important;
        box-shadow: inset 0 0 0 1px var(--fl-ink-3) !important;
    }

    html body .back-button[data-action="handleLogoutClick"]:hover {
        background: var(--fl-danger-wash) !important;
        background-clip: padding-box !important;
        color: var(--fl-danger) !important;
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fl-danger) 45%, transparent) !important;
    }
}

html body .back-button[data-action="handleLogoutClick"]:focus-visible,
html body .home-button:focus-visible {
    outline: 2px solid var(--fl-blue) !important;
    outline-offset: 1px !important;
}

/* pages with the fixed pills straight in <body>: a short-form sheet starts
   under them on phones */
@media (max-width: 600px) {
    html body:has(> .home-button) .terminal-container {
        padding-top: calc(env(safe-area-inset-top, 0px) + 60px) !important;
    }
}

/* --------------------------------------------------------------------------
   Legacy modals (.pricing-modal holds Terms, Privacy, Disclaimer, Pricing)
   -------------------------------------------------------------------------- */
.pricing-modal {
    background: var(--fl-scrim) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.pricing-modal .pricing-content {
    background: var(--fl-surface) !important;
    background-image: none !important;
    border: 1px solid var(--fl-line) !important;
    border-radius: var(--fl-r-xl) !important;
    box-shadow: var(--fl-highlight), var(--fl-shadow-3) !important;
    color: var(--fl-ink-2) !important;
    font-family: var(--fl-font-ui) !important;
}

.pricing-modal .pricing-content::before,
.pricing-modal .pricing-content::after {
    content: none !important;
    animation: none !important;
}

.pricing-modal .modal-close-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--fl-line-2) !important;
    border-radius: 50% !important;
    background: var(--fl-surface-2) !important;
    color: var(--fl-ink-2) !important;
    font-family: var(--fl-font-ui) !important;
    font-size: 0 !important;
    line-height: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    display: grid !important;
    place-items: center !important;
    cursor: pointer;
}

.pricing-modal .modal-close-btn::before {
    content: '' !important;
    /* pinned to the middle: the button's hidden "X" text is a second grid
       row (26px + 12px), which held the drawn X 6px above centre */
    position: absolute;
    inset: 0;
    margin: auto;
    width: 14px;
    height: 14px;
    background:
        linear-gradient(45deg, transparent calc(50% - 0.8px), currentColor calc(50% - 0.8px) calc(50% + 0.8px), transparent calc(50% + 0.8px)),
        linear-gradient(-45deg, transparent calc(50% - 0.8px), currentColor calc(50% - 0.8px) calc(50% + 0.8px), transparent calc(50% + 0.8px));
}

.pricing-modal .modal-close-btn::after {
    /* a 44px hit area around the 40px button (inset from the padding box), nothing drawn */
    content: '' !important;
    position: absolute !important;
    inset: -3px !important;
    border-radius: 50% !important;
    background: none !important;
}

@media (hover: hover) {
    .pricing-modal .modal-close-btn:hover {
        color: var(--fl-ink) !important;
        border-color: var(--fl-ink-3) !important;
        background: var(--fl-surface-3) !important;
        transform: none !important;
    }
}

/* --------------------------------------------------------------------------
   Legal documents: a calm reading column
   -------------------------------------------------------------------------- */
:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) {
    max-width: 44rem !important;
    margin: 0 auto !important;
    padding: 8px 4px 24px !important;
    font-family: var(--fl-font-ui) !important;
    font-size: 0.96875rem !important;
    line-height: 1.7 !important;
    letter-spacing: 0 !important;
    color: var(--fl-ink-2) !important;
    text-align: left !important;
    text-shadow: none !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) h2 {
    margin: 12px 0 8px !important;
    font-family: var(--fl-font-voice) !important;
    font-optical-sizing: auto;
    font-size: clamp(2rem, 2.4vw + 1.2rem, 2.75rem) !important;
    font-weight: 400 !important;
    line-height: 1.05 !important;
    letter-spacing: -0.016em !important;
    text-transform: none !important;
    text-align: left !important;
    color: var(--fl-ink) !important;
    text-shadow: none !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) .effective-date {
    margin: 0 0 28px !important;
    font-family: var(--fl-font-machine) !important;
    font-size: 10.5px !important;
    font-style: normal !important;
    font-weight: 500 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    text-align: left !important;
    color: var(--fl-ink-3) !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) .policy-intro {
    margin: 0 0 8px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) .policy-intro > p:first-child {
    font-size: 1.0625rem !important;
    color: var(--fl-ink) !important;
}

/* section titles are bare text in .policy-section */
:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) .policy-section {
    margin: 36px 0 0 !important;
    padding: 30px 0 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--fl-line) !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    font-family: var(--fl-font-voice) !important;
    font-size: 1.5rem !important;
    font-weight: 460 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.01em !important;
    color: var(--fl-ink) !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) .policy-section > * {
    font-family: var(--fl-font-ui) !important;
    font-size: 0.96875rem !important;
    font-weight: 400 !important;
    line-height: 1.7 !important;
    letter-spacing: 0 !important;
    color: var(--fl-ink-2) !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) h3,
:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) .policy-section > h3,
:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) h4 {
    margin: 26px 0 8px !important;
    font-family: var(--fl-font-ui) !important;
    font-size: 1rem !important;
    font-weight: 650 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: var(--fl-ink) !important;
    text-shadow: none !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) p {
    margin: 0 0 14px !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) ul,
:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) ol {
    margin: 0 0 16px !important;
    padding: 0 0 0 4px !important;
    list-style: none !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) li {
    /* style.css gives every .pricing-content li the old gold; the reader is built in that shell */
    color: inherit !important;
    position: relative !important;
    margin: 0 0 8px !important;
    padding: 0 0 0 20px !important;
    border: 0 !important;
    background: none !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) li::before {
    content: '' !important;
    position: absolute !important;
    left: 2px !important;
    top: 0.72em !important;
    width: 6px !important;
    height: 1.5px !important;
    border-radius: 2px !important;
    background: var(--fl-coral) !important;
}

/* style.css whitens the first letter of every .pricing-content li (the old plan arrows) */
:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) li::first-letter {
    color: inherit !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) strong {
    color: var(--fl-ink) !important;
    font-weight: 620 !important;
}

/* the all-caps legal warnings: same words, set as a quiet note */
:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) .emphasis-box {
    margin: 18px 0 !important;
    padding: 16px 18px 16px 20px !important;
    border: 0 !important;
    border-left: 2px solid var(--fl-coral) !important;
    border-radius: 0 var(--fl-r-sm) var(--fl-r-sm) 0 !important;
    background: var(--fl-coral-wash) !important;
    box-shadow: none !important;
    color: var(--fl-ink) !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) .emphasis-box strong {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    line-height: 1.6 !important;
    color: var(--fl-ink) !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) :is(.contact-info, .final-statement) {
    margin: 18px 0 !important;
    padding: 18px 20px !important;
    border: 1px solid var(--fl-line) !important;
    border-radius: var(--fl-r-md) !important;
    background: var(--fl-surface-2) !important;
    box-shadow: none !important;
    color: var(--fl-ink-2) !important;
}

/* Session 7: the no-background-screening line. New Jersey, Texas and Illinois
   ask for bold capitals of at least 12 points (16px), so this one line is
   larger and heavier than the reader's other notes. The words are written in
   capitals in the source (not text-transform) so they stay capitals when copied. */
:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) .emphasis-box strong.fl-no-screening {
    display: block !important;
    margin: 0 0 8px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    line-height: 1.45 !important;
    color: var(--fl-ink) !important;
}

/* Terms of Service: the dating-service right to cancel is the stand-alone
   first paragraph (California Civil Code 1694.2(b)); it reads at body size */
:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) .policy-intro > .fl-cancel-notice {
    margin-top: 0 !important;
    font-size: 0.96875rem !important;
    color: var(--fl-ink) !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) .policy-intro > .fl-cancel-notice strong {
    font-size: 0.96875rem !important;
    font-weight: 620 !important;
    letter-spacing: 0 !important;
    line-height: 1.65 !important;
}

:is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) a {
    color: var(--fl-ink) !important;
    text-decoration: underline !important;
    text-decoration-color: color-mix(in srgb, var(--fl-coral) 60%, transparent) !important;
    text-underline-offset: 3px !important;
}

/* --------------------------------------------------------------------------
   Pricing matrix (#pricingModal on about.html and match.html): a calm
   comparison sheet. Plan names in the voice, numbers in the voice, units and
   statuses in the machine voice. Every legacy loop (scan lines, pulses,
   glows, the background-position flow) is switched off.
   -------------------------------------------------------------------------- */
#pricingModal .membership-matrix {
    padding: max(24px, env(safe-area-inset-top, 0px)) 16px max(24px, env(safe-area-inset-bottom, 0px)) !important;
    background: color-mix(in srgb, var(--fl-bg) 88%, transparent) !important;
    background-image: none !important;
    font-family: var(--fl-font-ui) !important;
}

#pricingModal .membership-matrix::before,
#pricingModal .membership-matrix::after,
#pricingModal .matrix-corner::before,
#pricingModal .matrix-header::before,
#pricingModal .feature-name::before,
#pricingModal .feature-row::before,
#pricingModal .feature-row:hover::before {
    content: none !important;
    animation: none !important;
}

#pricingModal :is(.feature-icon, .value-active, .bar-fill, .cursor-blink) { animation: none !important; }

#pricingModal .plan-divider { display: none; }

#pricingModal .matrix-container {
    max-width: 1040px !important;
    border: 1px solid var(--fl-line) !important;
    border-radius: var(--fl-r-xl) !important;
    background: var(--fl-surface) !important;
    box-shadow: var(--fl-highlight), var(--fl-shadow-3) !important;
}

#pricingModal :is(.matrix-body, .system-info, .terminal-prompt) {
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

#pricingModal .system-info { padding: 0 !important; }

#pricingModal .matrix-header,
#pricingModal .feature-row {
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)) !important;  /* the label + three plans (v3) */
    border: 0 !important;
    border-bottom: 1px solid var(--fl-line) !important;
    background: none !important;
    box-shadow: none !important;
}

#pricingModal .feature-row:last-child { border-bottom: 0 !important; }

#pricingModal .matrix-header > *,
#pricingModal .feature-row > * {
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

#pricingModal .matrix-header > * + *,
#pricingModal .feature-row > * + * { border-left: 1px solid var(--fl-line) !important; }

@media (hover: hover) {
    #pricingModal .feature-row:hover { background: color-mix(in srgb, var(--fl-surface-2) 60%, transparent) !important; }
    #pricingModal .plan-header:hover,
    #pricingModal .feature-value:hover { background: none !important; transform: none !important; }
}

/* the corner: the sheet's title */
#pricingModal .matrix-corner {
    justify-content: flex-start !important;
    padding: 24px 24px 20px !important;
}

#pricingModal .matrix-label {
    font-family: var(--fl-font-voice) !important;
    font-optical-sizing: auto;
    font-size: clamp(1.25rem, 1.2vw + 0.9rem, 1.75rem) !important;
    font-weight: 400 !important;
    letter-spacing: -0.012em !important;
    line-height: 1.1 !important;
    text-transform: none !important;
    color: var(--fl-ink) !important;
    text-shadow: none !important;
    animation: none !important;
}

#pricingModal .plan-header {
    padding: 22px 8px 18px !important;
    text-align: center !important;
}

#pricingModal .plan-title {
    margin: 0 !important;
    font-family: var(--fl-font-voice) !important;
    font-size: 1.1875rem !important;
    font-weight: 460 !important;
    letter-spacing: -0.005em !important;
    line-height: 1.15 !important;
    text-transform: lowercase !important;
    color: var(--fl-ink) !important;
    text-shadow: none !important;
}

#pricingModal .plan-title::first-letter { text-transform: uppercase !important; }

#pricingModal .plan-subtitle {
    margin: 4px 0 10px !important;
    font-family: var(--fl-font-machine) !important;
    font-size: var(--fl-text-micro) !important;
    font-weight: 500 !important;
    letter-spacing: 0.14em !important;
    color: var(--fl-ink-3) !important;
    opacity: 1 !important;
}
/* paper: the header cell is a shade darker than the page, where ink-3 measured 4.45:1 */
html.theme-light #pricingModal .plan-subtitle { color: var(--fl-ink-2) !important; }

#pricingModal .plan-price {
    padding: 5px 10px !important;
    border: 1px solid var(--fl-line-2) !important;
    border-radius: var(--fl-r-pill) !important;
    background: var(--fl-surface-2) !important;
    font-family: var(--fl-font-ui) !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
    color: var(--fl-ink) !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

#pricingModal .plan-price::first-letter { color: inherit !important; }

/* rows */
#pricingModal .feature-name {
    gap: 0 !important;
    padding: 18px 24px !important;
}

#pricingModal .feature-icon { display: none !important; }

#pricingModal .feature-label {
    font-family: var(--fl-font-ui) !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    line-height: 1.3 !important;
    text-transform: none !important;
    color: var(--fl-ink) !important;
    text-shadow: none !important;
}

/* a row label's quiet second line ("Search again" / "after passing on everyone…") */
#pricingModal .feature-sub {
    display: block;
    margin-top: 3px !important;
    font-family: var(--fl-font-ui) !important;
    font-size: 0.75rem !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    color: var(--fl-ink-3) !important;
}

#pricingModal .feature-value {
    gap: 4px !important;
    padding: 16px 8px !important;
}

#pricingModal .value-highlight {
    font-family: var(--fl-font-voice) !important;
    font-optical-sizing: auto;
    font-size: 1.375rem !important;
    font-weight: 400 !important;
    letter-spacing: -0.01em !important;
    line-height: 1.1 !important;
    color: var(--fl-ink) !important;
    text-shadow: none !important;
}

#pricingModal :is(.value-unit, .value-status) {
    font-family: var(--fl-font-machine) !important;
    font-size: var(--fl-text-micro) !important;
    font-weight: 500 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    color: var(--fl-ink-3) !important;
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

#pricingModal .value-status.status-active { color: var(--fl-success) !important; }
#pricingModal .value-status.status-locked { color: var(--fl-ink-3) !important; }

#pricingModal .value-disabled {
    font-family: var(--fl-font-ui) !important;
    font-size: 1.125rem !important;
    color: var(--fl-ink-3) !important;
    text-shadow: none !important;
}

#pricingModal .value-active {
    width: 8px !important;
    height: 8px !important;
    margin: 6px 0 !important;
    border-radius: 50% !important;
    background: var(--fl-success) !important;
    font-size: 0 !important;
    color: transparent !important;
    text-shadow: none !important;
    box-shadow: 0 0 0 4px var(--fl-success-wash) !important;
}

#pricingModal .value-bar {
    width: min(64px, 70%) !important;
    height: 2px !important;
    margin-top: 6px !important;
    border: 0 !important;
    border-radius: 2px !important;
    background: var(--fl-line-2) !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

#pricingModal .bar-fill {
    display: block !important;
    height: 100% !important;
    border-radius: inherit !important;
    background: var(--fl-coral) !important;
    box-shadow: none !important;
}

#pricingModal .bar-fill.disabled { background: none !important; }

#pricingModal .value-radius {
    margin-top: 4px !important;
    padding: 3px 8px !important;
    border: 1px solid var(--fl-line-2) !important;
    border-radius: var(--fl-r-pill) !important;
    background: none !important;
    font-family: var(--fl-font-ui) !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: var(--fl-ink-2) !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

#pricingModal .matrix-footer {
    padding: 16px 24px !important;
    border: 0 !important;
    border-top: 1px solid var(--fl-line) !important;
    background: none !important;
    box-shadow: none !important;
}

#pricingModal .system-info { gap: 18px !important; opacity: 1 !important; }  /* legacy match.css dimmed it to .7 (3:1) */

#pricingModal .info-item {
    font-family: var(--fl-font-machine) !important;
    font-size: var(--fl-text-micro) !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    color: var(--fl-ink-3) !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

#pricingModal .matrix-close-btn {
    top: max(18px, calc(env(safe-area-inset-top, 0px) + 8px)) !important;
    right: 18px !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border: 1px solid var(--fl-line-2) !important;
    border-radius: 50% !important;
    background: var(--fl-surface-2) !important;
    color: var(--fl-ink-2) !important;
    font-size: 0 !important;
    line-height: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    display: grid !important;
    place-items: center !important;
}

#pricingModal .matrix-close-btn::before {
    content: '' !important;
    /* pinned to the middle, like the legal reader's: the button's hidden "×"
       is a second grid row, which held the drawn X above centre */
    position: absolute;
    inset: 0;
    margin: auto;
    width: 14px;
    height: 14px;
    background:
        linear-gradient(45deg, transparent calc(50% - 0.8px), currentColor calc(50% - 0.8px) calc(50% + 0.8px), transparent calc(50% + 0.8px)),
        linear-gradient(-45deg, transparent calc(50% - 0.8px), currentColor calc(50% - 0.8px) calc(50% + 0.8px), transparent calc(50% + 0.8px));
}

@media (hover: hover) {
    #pricingModal .matrix-close-btn:hover {
        color: var(--fl-ink) !important;
        border-color: var(--fl-ink-3) !important;
        background: var(--fl-surface-3) !important;
        transform: none !important;
    }
}

/* phones: the same four columns, tightened */
@media (max-width: 640px) {
    #pricingModal .membership-matrix {
        justify-content: flex-start !important;
        padding: calc(max(18px, env(safe-area-inset-top, 0px)) + 56px) 10px max(20px, env(safe-area-inset-bottom, 0px)) !important;
    }

    #pricingModal .matrix-container { border-radius: var(--fl-r-lg) !important; }

    #pricingModal .matrix-header,
    #pricingModal .feature-row { grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)) !important; }

    #pricingModal .matrix-corner { padding: 14px 10px !important; }
    #pricingModal .matrix-label { font-size: 1.0625rem !important; }
    #pricingModal .plan-header { padding: 14px 2px 12px !important; }
    #pricingModal .plan-title { font-size: 0.9375rem !important; }
    #pricingModal .plan-subtitle { margin: 2px 0 8px !important; letter-spacing: 0.1em !important; }
    #pricingModal .plan-price { padding: 4px 5px !important; font-size: 0.75rem !important; white-space: normal !important; }
    #pricingModal .feature-name { padding: 14px 10px !important; }
    #pricingModal .feature-label { font-size: 0.8125rem !important; }
    #pricingModal .feature-value { padding: 14px 2px !important; }
    #pricingModal .value-highlight { font-size: 1.0625rem !important; }
    #pricingModal :is(.value-unit, .value-status) { letter-spacing: 0.06em !important; }
    #pricingModal .value-radius { padding: 2px 5px !important; font-size: 0.75rem !important; }
    #pricingModal .feature-value:has(.value-radius) .value-highlight {
        font-family: var(--fl-font-ui) !important;
        font-size: 0.8125rem !important;
        font-weight: 600 !important;
    }
    #pricingModal .matrix-footer { padding: 14px 12px !important; }
}

/* --------------------------------------------------------------------------
   The fade under a fixed top bar (see the legacy plumbing at the top, pages whose pills sit straight
   in <body>): fade from the page's own ground, not from #000 / #f8f8f8
   -------------------------------------------------------------------------- */
html body:has(> .home-button)::after {
    background: linear-gradient(to bottom,
        var(--fl-bg) 0%,
        var(--fl-bg) 50%,
        color-mix(in srgb, var(--fl-bg) 80%, transparent) 72%,
        transparent 100%) !important;
}

/* An <a class="fl-btn"> keeps its button ink: style.css forces every link
   to #f0f0f0 !important in the night theme */
html body a.fl-btn { color: var(--_fg) !important; }

/* About's pricing sheet: the footnote (maximums + renewal), like match.html's
   (fl-match.css styles that one) */
html body.about-page #pricingModal .matrix-renewal-note {
    max-width: 640px;
    margin: 0 0 12px !important;
    padding: 0 !important;
    font-family: var(--fl-font-ui) !important;
    font-size: 0.8125rem !important;
    line-height: 1.55 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-align: left !important;
    color: var(--fl-ink-2) !important;
    text-shadow: none !important;
}

} /* @layer fl-skin */

/* --------------------------------------------------------------------------
   Session 8 (fork B): the plan sheet
   -------------------------------------------------------------------------- */
@layer fl-skin {
    /* "Starter / Pack", "Max / Pro": the second word in the UI face, not mono caps */
    #pricingModal .plan-subtitle {
        font-family: var(--fl-font-ui) !important;
        font-size: 0.8125rem !important;
        font-weight: 500 !important;
        letter-spacing: 0 !important;
        text-transform: lowercase !important;
    }
    #pricingModal .plan-subtitle::first-letter { text-transform: uppercase !important; }

    @media (max-width: 640px) {
        /* the last column's pills touched the sheet's edge */
        #pricingModal .matrix-header,
        #pricingModal .feature-row { padding-right: 6px !important; }
        #pricingModal .plan-subtitle { margin: 1px 0 8px !important; letter-spacing: 0 !important; }
        #pricingModal .plan-price { line-height: 1.25 !important; border-radius: 12px !important; }
    }
}

/* --------------------------------------------------------------------------
   Session 8 (fork B2): the legal reader's sheet - on phones it sat 9px from
   the screen edges with its close button 9px into a 30px corner (inside the
   curve). Now the page gutter (20px), and the button 14px in, clear of it.
   -------------------------------------------------------------------------- */
@layer fl-skin {
    html body .pricing-modal .pricing-content:is(.terms-service-modal-content, .privacy-policy-modal-content, .legal-disclaimer-modal-content, .safety-tips-modal-content) > .modal-close-btn {
        top: 14px !important;
        right: 14px !important;
    }
    @media (max-width: 600px) {
        html body .pricing-modal .pricing-content:is(.terms-service-modal-content, .privacy-policy-modal-content, .legal-disclaimer-modal-content, .safety-tips-modal-content) {
            /* (index.html's script sets min-width inline to 95 % of the screen;
               without it the sheet fills the overlay inside its 20px padding) */
            width: calc(100vw - 40px) !important;
            min-width: 0 !important;
            max-width: none !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
        }
    }
}

/* --------------------------------------------------------------------------
   Session 8 (fork B3, desktop review #28): the legal reader read at ~95
   characters a line on a wide screen (a 704px column at 15.5px) - the sheet
   is now narrower, ~72 a line; and the list dashes were 1.5px at a fractional
   offset, so some rendered faint and some strong - now 2px at a whole pixel.
   -------------------------------------------------------------------------- */
@layer fl-skin {
    @media (min-width: 601px) {
        html body .pricing-modal .pricing-content:is(.terms-service-modal-content, .privacy-policy-modal-content, .legal-disclaimer-modal-content, .safety-tips-modal-content) {
            width: min(41rem, calc(100vw - 48px)) !important;
            min-width: 0 !important;
            max-width: none !important;
        }
    }
    html body :is(.terms-service-content-inner, .privacy-policy-content-inner, .legal-disclaimer-content-inner, .safety-tips-content-inner) li::before {
        top: 12px !important;
        height: 2px !important;
    }
}

/* --------------------------------------------------------------------------
   Session 8 (fork B3): on phones (in the browser the top fade is left out on
   purpose, so the toolbar can follow the page) the content of settings,
   billing, report, report e-mail and profile stats scrolled straight under
   the transparent Log out / Back pills and read through them. Those pills now
   carry a near-solid fill of the page's ground. No blur, only these pages.
   -------------------------------------------------------------------------- */
@layer fl-skin {
    @media (display-mode: browser) and (max-width: 1024px) {
        html:not(.app-mode) body:has(> .home-button) > :is(.home-button, .back-button) {
            background: color-mix(in srgb, var(--fl-bg) 90%, transparent) !important;
        }
    }
}

/* Consumer health data reader (session 8, fork C) */
/* The notice (js/health_data.js) builds its reader with the Safety tips
   classes, so the reader rules above style it. Here only the home row it
   joins: About FirstLook / Privacy · Terms · Safety · Health data no longer
   fits one line on phones, so there the documents get their own centred line
   and the first one loses its leading dot (the wrap used to leave it dangling).
   The selectors outrank fl-landing.css's (same layer, loaded later). */
@layer fl-skin {
    @media (max-width: 480px) {
        html body #landing-page-content .landing-more .fl-legal-links {
            flex: 0 0 100% !important;
            justify-content: center !important;
            margin-left: 0 !important;
        }

        html body #landing-page-content .landing-more .fl-legal-links .fl-legal-link:first-child::before {
            content: none !important;
        }
    }

    /* Terms of Service (session 8, fork D2): the statutory right-to-cancel
       statement is the stand-alone first paragraph (Civil Code 1694.2(b)), so
       the "Last updated" line now follows the first intro block */
    .terms-service-content-inner .policy-intro + .effective-date {
        margin-top: 22px !important;
    }

    /* Every legal reader takes focus on its sheet when it opens (tabindex -1,
       js/privacy_policy.js), not on its close button: no ring on the sheet;
       the first Tab reaches the close button, which keeps its ring */
    :is(#privacyPolicyModal, #termsServiceModal, #legalDisclaimerModal, #safetyTipsModal, #healthDataModal) .pricing-content[tabindex="-1"]:focus {
        outline: none !important;
    }
} /* @layer fl-skin */
