        * {
            box-sizing: border-box;
        }

        html {
            height: 100%;
            overflow: hidden;
            -webkit-text-size-adjust: 100%;
        }

        body {
            font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background-color: #FAFAFA;
            color: #333333;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: stretch;
            min-height: 100vh;
            min-height: 100dvh;
            height: 100vh;
            height: 100dvh;
            overflow: hidden;
            overscroll-behavior: none;
        }

        body.app-loading {
            background: var(--lapi-cream, #fdf9f6);
        }

        body.app-loading .screens .screen {
            display: none !important;
            opacity: 0;
        }

        body.app-loading #screenMain {
            display: none !important;
        }

        body.app-loading .progress-wrap {
            display: none !important;
        }

        .web-auth-overlay {
            position: fixed;
            inset: 0;
            z-index: 12000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 24px 20px;
            background: var(--lapi-cream, #fdf9f6);
        }

        .web-auth-overlay.visible {
            display: flex;
        }

        .legal-consent-overlay {
            position: fixed;
            inset: 0;
            z-index: 13000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 16px;
            background: rgba(60, 42, 33, 0.45);
        }
        .legal-consent-overlay.visible { display: flex; }
        .legal-consent-card {
            width: 100%;
            max-width: 520px;
            max-height: 92vh;
            background: #fff;
            border-radius: 16px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 12px 40px rgba(60, 42, 33, 0.2);
        }
        .legal-consent-card h2 {
            margin: 0;
            padding: 16px 18px 8px;
            font-size: var(--lapi-fs-18);
            color: var(--lapi-chocolate, #3c2a21);
        }
        .legal-consent-scroll {
            flex: 1;
            overflow-y: auto;
            padding: 0 18px 12px;
            font-size: var(--lapi-fs-13);
            line-height: 1.5;
            white-space: pre-wrap;
            color: #3c2a21;
        }
        .legal-consent-footer {
            border-top: 1px solid #efe6df;
            padding: 12px 18px 16px;
            background: #fdf9f6;
        }
        .legal-consent-check {
            display: flex;
            gap: 8px;
            align-items: flex-start;
            margin: 0 0 10px;
            font-size: var(--lapi-fs-13);
            line-height: 1.4;
            cursor: pointer;
        }
        .legal-consent-error { color: #c5221f; font-size: var(--lapi-fs-13); margin: 0 0 8px; }
        .onboarding-welcome-screen.active {
            position: relative;
        }

        .onboarding-welcome-screen .onboarding-step-footer--browser-entry {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 20;
            flex-shrink: 0;
            padding-bottom: max(12px, env(safe-area-inset-bottom));
            background: linear-gradient(to top, var(--lapi-cream) 72%, rgba(253, 249, 246, 0));
            pointer-events: auto;
        }

        .onboarding-welcome-screen .onboarding-mascot-container--welcome {
            flex-shrink: 0;
        }

        .onboarding-step-footer--browser-entry .browser-entry-footer {
            width: 100%;
            max-width: 360px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .browser-entry-footer .form-label {
            margin: 0;
            text-align: left;
            font-size: var(--lapi-fs-13);
        }

        .browser-entry-footer .form-input {
            width: 100%;
        }

        .browser-entry-footer--single {
            gap: 0;
        }

        .browser-entry-footer--single .btn-primary {
            width: 100%;
        }

        .browser-entry-footer .profile-email-otp-wrap {
            margin: 0;
        }

        #screen0.browser-entry-otp .onboarding-welcome-hero {
            min-height: 0;
            max-height: 120px;
            overflow: hidden;
        }

        #screen0.browser-entry-otp .onboarding-mascot-container--welcome {
            opacity: 0.15;
            pointer-events: none;
        }

        #screen0.browser-entry-otp .onboarding-welcome-copy-rest {
            display: none;
        }

        #screen0.browser-entry-otp .onboarding-step-body--welcome {
            flex: 0 0 auto;
        }

        #screen0.browser-entry-otp .onboarding-step-footer--browser-entry {
            position: relative;
            max-height: none;
            overflow: visible;
            flex-shrink: 0;
        }

        #screen0.browser-entry-otp #browserEntryCodeWrap:not(.hidden) {
            display: block !important;
        }

        #screen0.browser-entry-otp .profile-email-otp-input {
            min-height: 48px;
        }

        .web-auth-card {
            width: 100%;
            max-width: 360px;
            text-align: center;
        }

        .web-auth-card h2 {
            margin: 0 0 8px;
            font-size: 1.35rem;
            color: var(--lapi-chocolate, #3c2a21);
        }

        .web-auth-card p {
            margin: 0 0 20px;
            color: var(--lapi-text-muted, #8a7568);
            font-size: 0.95rem;
            line-height: 1.45;
        }

        .web-auth-widget {
            min-height: 48px;
            display: flex;
            justify-content: center;
            margin-bottom: 16px;
        }

        .web-auth-lead { margin-bottom: 16px; }
        .web-auth-tabs { display: flex; gap: 8px; margin-bottom: 12px; justify-content: center; }
        .web-auth-tab {
            border: 1px solid var(--lapi-border, #e8ddd6);
            background: #fff;
            border-radius: 999px;
            padding: 8px 16px;
            font: inherit;
            cursor: pointer;
        }
        .web-auth-tab.active { background: var(--lapi-chocolate, #3c2a21); color: #fff; border-color: transparent; }
        .web-auth-field { display: block; text-align: left; margin-bottom: 10px; font-size: 0.85rem; }
        .web-auth-field input {
            display: block; width: 100%; margin-top: 4px; padding: 10px 12px;
            border: 1px solid var(--lapi-border, #e8ddd6); border-radius: 10px;
            font: inherit;
            font-size: 16px;
        }
        .web-auth-error { color: #c5221f; font-size: 0.85rem; margin: 0 0 10px; }
        .web-auth-submit { width: 100%; margin-bottom: 12px; }
        .web-auth-divider { margin: 16px 0; font-size: 0.85rem; color: var(--lapi-text-muted, #8a7568); }
        .web-auth-hint {
            font-size: 0.82rem;
            color: var(--lapi-text-muted, #8a7568);
        }

        :root {
            --lapi-cream: #fdf9f6;
            --lapi-cream-deep: #fcf7f3;
            --lapi-chocolate: #3c2a21;
            --lapi-chocolate-soft: #5c463a;
            --lapi-text-muted: #8a7568;
            --lapi-coral: #ff7a59;
            --lapi-coral-light: #ff8e6e;
            --lapi-coral-press: #f06548;
            --lapi-coral-glow: rgba(255, 122, 89, 0.32);
            --lapi-mint-bg: #e8f6f3;
            --lapi-mint: #1abc9c;
            --lapi-mint-press: #16a085;
            --lapi-accent: #ff7a59;
            --lapi-fs-10: 10px;
            --lapi-fs-11: 11px;
            --lapi-fs-12: 12px;
            --lapi-fs-13: 13px;
            --lapi-fs-14: 14px;
            --lapi-fs-15: 15px;
            --lapi-fs-16: 16px;
            --lapi-fs-17: 17px;
            --lapi-fs-18: 18px;
            --lapi-fs-20: 20px;
            --lapi-fs-21: 21px;
            --lapi-fs-22: 22px;
            --lapi-fs-24: 24px;
            --lapi-fs-26: 26px;
            --lapi-fs-28: 28px;
        }

        /* Telegram WebView: +1px к текстовой шкале (браузер — body.lapi-web-app, без этого блока) */
        html.lapi-tg-env {
            --lapi-fs-10: 11px;
            --lapi-fs-11: 12px;
            --lapi-fs-12: 13px;
            --lapi-fs-13: 14px;
            --lapi-fs-14: 15px;
            --lapi-fs-15: 16px;
            --lapi-fs-16: 17px;
            --lapi-fs-17: 18px;
            --lapi-fs-18: 19px;
            --lapi-fs-20: 21px;
            --lapi-fs-21: 22px;
            --lapi-fs-22: 23px;
            --lapi-fs-24: 25px;
            --lapi-fs-26: 27px;
            --lapi-fs-28: 29px;
        }

        .app-container,
        .app-container.page-container {
            background-color: #ffffff;
            width: 100%;
            max-width: 390px;
            height: 100vh;
            height: 100dvh;
            max-height: 100dvh;
            border-radius: 0;
            box-shadow: none;
            padding: 16px 18px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            position: relative;
        }

        .app-container:has(#screen0.active),
        .app-container:has(#screen1.active),
        .app-container:has(#screen2.active),
        .app-container:has(#screen3.active),
        .app-container:has(#screen4.active) {
            background: var(--lapi-cream);
            font-family: 'Nunito', sans-serif;
            color: var(--lapi-chocolate);
        }

        @media (min-width: 420px) {
            html,
            body {
                height: 100%;
                max-height: 100dvh;
                overflow: hidden;
            }

            body {
                box-sizing: border-box;
                padding: 20px 0;
                align-items: center;
            }

            .app-container.page-container {
                border-radius: 24px;
                box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
                height: min(calc(100dvh - 40px), 844px);
                max-height: min(calc(100dvh - 40px), 844px);
            }
        }

        body.lapi-web-app .screens:has(#screenMain.active) {
            overflow: hidden;
        }

        .progress-wrap {
            flex-shrink: 0;
            margin-bottom: 14px;
            display: none;
        }

        .progress-wrap.visible {
            display: block;
            animation: fadeIn 0.35s ease;
        }

        .progress-label {
            font-size: var(--lapi-fs-13);
            font-weight: 700;
            color: var(--lapi-chocolate-soft);
            margin-bottom: 8px;
            text-align: left;
        }

        .progress-track {
            height: 7px;
            background-color: rgba(255, 122, 89, 0.12);
            border-radius: 24px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--lapi-coral-light), var(--lapi-coral));
            border-radius: 24px;
            width: 0%;
            transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .screens {
            position: relative;
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
        }

        .screens:has(#screenMain.active) {
            overflow: hidden;
        }

        .screen {
            display: none;
            opacity: 0;
            transform: translateY(12px);
            text-align: center;
        }

        .screen.active {
            display: block;
            animation: screenIn 0.4s ease forwards;
        }

        .screen:not(#screenMain) {
            position: absolute;
            inset: 0;
            width: 100%;
            max-width: 100%;
            overflow: hidden;
            background: var(--lapi-cream);
        }

        .screen.active:not(#screenMain) {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
            text-align: center;
            z-index: 2;
        }

        .onboarding-mascot-container {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100%;
            flex-shrink: 0;
            margin: 0 0 18px;
            min-height: 110px;
        }

        .onboarding-mascot-halo {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 120px;
            height: 120px;
            border-radius: 50%;
            transform: translate(-50%, -58%);
            background: radial-gradient(
                circle,
                rgba(255, 160, 130, 0.42) 0%,
                rgba(255, 200, 175, 0.18) 45%,
                rgba(255, 249, 245, 0) 72%
            );
            pointer-events: none;
            filter: blur(2px);
        }

        /* Универсальный круглый холдер: видео / img — обрезается в круг */
        #lapi-media-holder,
        .lapi-media-holder {
            position: relative;
            z-index: 1;
            width: 100px;
            height: 100px;
            border-radius: 50%;
            overflow: hidden;
            flex-shrink: 0;
            background: linear-gradient(145deg, #ffe8de 0%, var(--lapi-cream) 48%, #ffdfd3 100%);
            box-shadow:
                0 0 0 4px rgba(255, 255, 255, 0.92),
                0 12px 32px var(--lapi-coral-glow);
        }

        #lapi-media-holder canvas,
        .lapi-media-holder canvas,
        #lapi-media-holder svg,
        .lapi-media-holder svg,
        #lapi-media-holder img:not(.onboarding-brand-logo),
        .lapi-media-holder img:not(.onboarding-brand-logo) {
            display: none !important;
        }

        #lapi-media-holder video,
        .lapi-media-holder video {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .lapi-media-holder--wave .lapi-animation-placeholder {
            animation: onboardingMascotFloat 3.2s ease-in-out infinite,
                onboardingMascotWave 2.4s ease-in-out infinite;
        }

        .lapi-animation-placeholder {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            font-size: 44px;
            line-height: 1;
            user-select: none;
            animation: onboardingMascotFloat 3.2s ease-in-out infinite;
        }

        .onboarding-mascot-mood {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .onboarding-screen-title {
            font-size: var(--lapi-fs-22);
            font-weight: 800;
            color: var(--lapi-chocolate);
            margin: 0 0 18px;
            line-height: 1.4;
            text-align: center;
            letter-spacing: -0.02em;
        }

        .onboarding-speech {
            width: 100%;
            max-width: 320px;
            text-align: center;
        }

        .onboarding-speech .onboarding-lapi-text + .onboarding-lapi-text {
            margin-top: 14px;
        }

        #screen2,
        #screen2 .onboarding-step-body {
            background: var(--lapi-cream);
        }

        #screen2.active:not(#screenMain) {
            text-align: left;
        }

        #screen2 .onboarding-step-body--focus {
            align-items: stretch;
            justify-content: flex-start;
            gap: 0;
            overflow: hidden;
        }

        #screen2 .onboarding-focus-hero {
            display: flex;
            align-items: stretch;
            justify-content: space-between;
            gap: 6px;
            flex: 1;
            min-height: 0;
            width: 100%;
            margin: 0 0 6px;
            overflow: visible;
        }

        #screen2 .onboarding-focus-hero .onboarding-screen-title {
            flex: 0 1 48%;
            max-width: 48%;
            margin: 0;
            padding: 2px 6px 0 0;
            font-size: var(--lapi-fs-21);
            font-weight: 600;
            line-height: 1.34;
            text-align: left;
            align-self: flex-start;
            position: relative;
            z-index: 3;
            text-shadow:
                0 0 10px rgba(253, 249, 246, 0.95),
                0 2px 8px rgba(253, 249, 246, 0.85);
        }

        #screen2 .onboarding-mascot-container--focus {
            flex: 1 1 auto;
            min-width: 0;
            min-height: 0;
            height: 100%;
            margin: 0;
            display: flex;
            align-items: stretch;
            justify-content: flex-end;
            background: transparent;
            isolation: isolate;
            z-index: 1;
            pointer-events: none;
        }

        #screen2 .onboarding-mascot-halo {
            display: none;
        }

        #screen2 #lapi-media-holder-step2 {
            width: 100%;
            height: 100%;
            max-width: none;
            overflow: visible;
            background: transparent;
            box-shadow: none;
            border-radius: 0;
            display: flex;
            align-items: stretch;
            justify-content: flex-end;
            transform: scale(1.3);
            transform-origin: top right;
        }

        #screen2 #lapi-media-holder-step2 video {
            display: block;
            width: auto;
            height: 100%;
            max-width: 100%;
            max-height: 100%;
            min-height: 100%;
            object-fit: contain;
            object-position: top right;
            background: transparent;
            mix-blend-mode: multiply;
            animation: onboardingMascotFloat 3.2s ease-in-out infinite;
            -webkit-mask-image:
                radial-gradient(ellipse 52% 42% at 0% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                radial-gradient(ellipse 52% 42% at 100% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%),
                linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%, rgba(0, 0, 0, 1) 94%, rgba(0, 0, 0, 0) 100%),
                linear-gradient(to bottom, rgba(0, 0, 0, 1) 82%, rgba(0, 0, 0, 0) 100%);
            mask-image:
                radial-gradient(ellipse 52% 42% at 0% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                radial-gradient(ellipse 52% 42% at 100% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%),
                linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%, rgba(0, 0, 0, 1) 94%, rgba(0, 0, 0, 0) 100%),
                linear-gradient(to bottom, rgba(0, 0, 0, 1) 82%, rgba(0, 0, 0, 0) 100%);
            -webkit-mask-composite: source-in, source-in, source-in, source-in;
            mask-composite: intersect;
            -webkit-mask-size: 100% 100%;
            mask-size: 100% 100%;
            -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
            -webkit-mask-position: center;
            mask-position: center;
        }

        #screen2 .onboarding-lapi-text--step2-lead {
            position: relative;
            z-index: 5;
            font-size: var(--lapi-fs-14);
            line-height: 1.45;
            margin: 0 0 10px;
            padding: 10px 12px;
            max-width: 100%;
            width: 100%;
            text-align: left;
            flex-shrink: 0;
            background: rgba(253, 249, 246, 0.94);
            border-radius: 14px;
            box-shadow: 0 2px 12px rgba(60, 42, 33, 0.06);
        }

        #screen2 .onboarding-focus-block {
            display: block;
            position: relative;
            z-index: 2;
            width: 100%;
            max-width: 320px;
            margin-top: 0;
            padding-top: 0;
            flex-shrink: 0;
        }

        #screen2 .onboarding-focus-tags {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 7px;
            margin: 0 0 6px;
            width: 100%;
        }

        #screen2 .onboarding-focus-tag {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 7px 12px;
            font-size: var(--lapi-fs-12);
        }

        .onboarding-inline-error {
            margin: 0 0 10px;
            padding: 10px 14px;
            font-family: 'Nunito', sans-serif;
            font-size: var(--lapi-fs-13);
            font-weight: 700;
            line-height: 1.4;
            text-align: center;
            color: var(--lapi-chocolate);
            background: rgba(255, 122, 89, 0.12);
            border: 1px solid rgba(255, 122, 89, 0.28);
            border-radius: 14px;
        }

        .onboarding-inline-error[hidden] {
            display: none !important;
        }

        .onboarding-inline-error.browser-entry-hint {
            color: #2d6a4f;
            background: rgba(45, 106, 79, 0.1);
            border-color: rgba(45, 106, 79, 0.25);
        }

        #screen2.active .onboarding-step-footer {
            padding-top: 8px;
            flex-shrink: 0;
            position: relative;
            z-index: 4;
        }

        .app-container:has(#screen2.active) .progress-fill {
            width: 66.6% !important;
        }

        #screen3,
        #screen3 .onboarding-step-body {
            background: var(--lapi-cream);
        }

        #screen3.active:not(#screenMain) {
            text-align: left;
        }

        #screen3 .onboarding-step-body--offer {
            align-items: stretch;
            justify-content: flex-start;
            gap: 0;
            overflow: hidden;
            padding: 0;
        }

        #screen3 .onboarding-offer-hero {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: stretch;
            gap: 0;
            flex: 1 1 auto;
            min-height: 0;
            width: 100%;
            margin: 0;
            overflow: hidden;
        }

        #screen3 .onboarding-offer-hero--video {
            position: relative;
        }

        #screen3 .onboarding-offer-visual {
            flex: 1 1 auto;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: min(52vh, 420px);
            width: 100%;
            padding: 8px 12px 0;
            background: var(--lapi-cream);
            isolation: isolate;
        }

        #screen3 .onboarding-offer-media-holder {
            width: 100%;
            height: 100%;
            max-height: min(48vh, 400px);
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--lapi-cream);
            border-radius: 16px;
            overflow: hidden;
        }

        #screen3 .onboarding-offer-video {
            display: block;
            width: auto;
            height: 100%;
            max-width: 100%;
            max-height: 100%;
            min-height: 0;
            object-fit: contain;
            object-position: center center;
            background: transparent;
            mix-blend-mode: multiply;
            animation: onboardingMascotFloat 3.2s ease-in-out infinite;
            -webkit-mask-image:
                radial-gradient(ellipse 80% 72% at 50% 48%, rgba(0, 0, 0, 1) 55%, rgba(0, 0, 0, 0) 100%);
            mask-image:
                radial-gradient(ellipse 80% 72% at 50% 48%, rgba(0, 0, 0, 1) 55%, rgba(0, 0, 0, 0) 100%);
            -webkit-mask-size: 100% 100%;
            mask-size: 100% 100%;
            -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
            -webkit-mask-position: center;
            mask-position: center;
        }

        #screen3 .onboarding-gift-box {
            display: none;
        }

        #screen3 .onboarding-offer-copy {
            display: none;
        }

        #screen3 .onboarding-offer-single-copy {
            flex: 0 0 auto;
            margin: 10px 0 6px;
            padding: 0 12px;
            font-size: var(--lapi-fs-16);
            font-weight: 600;
            line-height: 1.4;
            text-align: center;
            color: var(--lapi-chocolate, #3c2a21);
        }

        #screen3 .onboarding-offer-details {
            display: none;
        }

        #screen3 .btn-label-multiline {
            display: inline-block;
            line-height: 1.25;
            white-space: normal;
        }

        #screen3 .onboarding-mascot-container--offer {
            display: none;
        }

        #screen3 .onboarding-offer-copy {
            flex: 0 0 auto;
            width: 100%;
            max-width: 100%;
            display: block;
            padding: 0 2px;
            position: relative;
            z-index: 3;
        }

        #screen3 .onboarding-offer-copy .onboarding-screen-title {
            margin: 0;
            padding: 0;
            font-size: var(--lapi-fs-20);
            font-weight: 600;
            line-height: 1.36;
            text-align: left;
            text-shadow:
                0 0 10px rgba(253, 249, 246, 0.95),
                0 2px 8px rgba(253, 249, 246, 0.85);
        }

        #screen3 .onboarding-mascot-halo {
            display: none;
        }

        #screen3 #lapi-media-holder-step3 {
            width: 100%;
            height: 100%;
            max-width: none;
            overflow: visible;
            background: transparent;
            box-shadow: none;
            border-radius: 0;
            display: flex;
            align-items: flex-start;
            justify-content: center;
        }

        #screen3 #lapi-media-holder-step3 video {
            display: block;
            width: 100%;
            height: 100%;
            max-width: 100%;
            max-height: 100%;
            min-height: 0;
            min-width: 0;
            object-fit: contain;
            object-position: top center;
            background: transparent;
            mix-blend-mode: multiply;
            animation: onboardingMascotFloat 3.2s ease-in-out infinite;
            -webkit-mask-image:
                radial-gradient(ellipse 52% 42% at 0% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                radial-gradient(ellipse 52% 42% at 100% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%),
                linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%, rgba(0, 0, 0, 1) 94%, rgba(0, 0, 0, 0) 100%),
                linear-gradient(to bottom, rgba(0, 0, 0, 1) 82%, rgba(0, 0, 0, 0) 100%);
            mask-image:
                radial-gradient(ellipse 52% 42% at 0% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                radial-gradient(ellipse 52% 42% at 100% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%),
                linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%, rgba(0, 0, 0, 1) 94%, rgba(0, 0, 0, 0) 100%),
                linear-gradient(to bottom, rgba(0, 0, 0, 1) 82%, rgba(0, 0, 0, 0) 100%);
            -webkit-mask-composite: source-in, source-in, source-in, source-in;
            mask-composite: intersect;
            -webkit-mask-size: 100% 100%;
            mask-size: 100% 100%;
            -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
            -webkit-mask-position: center;
            mask-position: center;
        }

        #screen3 .onboarding-offer-details {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 4px;
            width: 100%;
            max-width: 100%;
            margin: 0 0 8px;
            padding: 0 2px;
            flex-shrink: 0;
            text-align: left;
        }

        #screen3 .onboarding-offer-details .onboarding-lapi-text,
        #screen3 .onboarding-offer-details .onboarding-tariff-note {
            margin: 0;
            max-width: 100%;
            text-align: left;
        }

        #screen3 .onboarding-offer-details .onboarding-lapi-text {
            font-size: var(--lapi-fs-15);
            line-height: 1.45;
        }

        #screen3 .onboarding-offer-details .onboarding-tariff-note {
            font-size: var(--lapi-fs-14);
            line-height: 1.4;
            color: var(--lapi-text-muted);
        }

        #screen3.active .onboarding-step-footer {
            padding-top: 8px;
            flex-shrink: 0;
            position: relative;
            z-index: 4;
        }

        #screen4,
        #screen4 .onboarding-step-body {
            flex: 1;
            min-height: 0;
        }

        #screen4.active:not(#screenMain) {
            display: flex;
            flex-direction: column;
        }

        #screen4 .onboarding-step-body--identity {
            overflow: hidden;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: stretch;
            text-align: left;
            padding: 0 16px;
            gap: 0;
        }

        #screen4 .onboarding-identity-header {
            flex-shrink: 0;
            width: 100%;
            padding: 6px 0 10px;
            background: var(--lapi-cream);
        }

        #screen4 .onboarding-identity-scroll {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
            padding-bottom: 8px;
        }

        #screen4 .onboarding-screen-title {
            margin: 0 0 8px;
            font-size: var(--lapi-fs-22);
            font-weight: 800;
            line-height: 1.2;
            text-align: left;
            width: 100%;
            max-width: none;
        }

        #screen4 .onboarding-lapi-text {
            text-align: left;
            max-width: none;
            width: 100%;
            font-size: var(--lapi-fs-15);
            line-height: 1.45;
            margin: 0 0 4px;
        }

        #screen4 .onboarding-identity-form {
            width: 100%;
            flex-shrink: 0;
        }

        #screen4 .onboarding-identity-form .form-group {
            margin-bottom: 12px;
        }

        #screen4 .onboarding-identity-form .form-input[readonly] {
            opacity: 0.85;
            background: rgba(255, 255, 255, 0.65);
        }

        #screen4.active .onboarding-step-footer {
            padding-top: 8px;
            flex-shrink: 0;
            position: relative;
            z-index: 4;
            padding-bottom: max(16px, env(safe-area-inset-bottom));
        }

        .onboarding-welcome-screen.active:not(#screenMain) {
            text-align: left;
        }

        .onboarding-welcome-screen .onboarding-step-body--welcome {
            flex: 1 1 auto;
            min-height: 0;
            align-items: stretch;
            justify-content: flex-start;
            padding: 6px 0 0;
            gap: 0;
            overflow: hidden;
        }

        #screen0 .onboarding-step-body--welcome,
        #screen1 .onboarding-step-body--welcome {
            padding-bottom: 0;
        }

        #screen0 .onboarding-welcome-hero,
        #screen1 .onboarding-welcome-hero {
            display: block;
            min-height: min(52vh, 460px);
        }

        #screen0 .onboarding-welcome-copy {
            max-width: min(52%, calc(100% - 52px));
        }

        #screen0 .onboarding-mascot-container--welcome,
        #screen1 .onboarding-mascot-container--welcome {
            top: 0;
            bottom: 0;
            right: -8%;
            width: 94%;
            min-height: 0;
            height: 100%;
            pointer-events: none;
        }

        #screen1 .onboarding-mascot-container--welcome {
            right: -10%;
            width: 96%;
        }

        #screen1 .onboarding-welcome-copy {
            max-width: min(52%, calc(100% - 52px));
        }

        .onboarding-offer-headline {
            margin: 0 0 8px;
            font-size: var(--lapi-fs-17);
            font-weight: 800;
            line-height: 1.35;
            text-align: center;
            color: var(--lapi-chocolate);
        }

        #screen0 .lapi-media-holder,
        #screen1 .lapi-media-holder,
        #lapi-media-holder-screen0,
        #lapi-media-holder-screen1 {
            min-height: 0;
            height: 100%;
        }

        #screen0 .lapi-media-holder video,
        #screen1 .lapi-media-holder video,
        #lapi-media-holder-screen0 video,
        #lapi-media-holder-screen1 video {
            min-height: 0;
            max-height: 100%;
        }

        .onboarding-welcome-screen .onboarding-brand-logo {
            display: block;
            width: auto;
            height: 132px;
            max-width: min(520px, 88vw);
            object-fit: contain;
            object-position: left center;
            margin: 0 0 6px -6px;
            align-self: flex-start;
            flex-shrink: 0;
            position: relative;
            z-index: 2;
            -webkit-mask-image:
                radial-gradient(ellipse 56% 44% at 100% 4%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.42) 42%, rgba(0, 0, 0, 1) 80%),
                linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 5%, rgba(0, 0, 0, 1) 95%, rgba(0, 0, 0, 0) 100%),
                linear-gradient(to bottom, rgba(0, 0, 0, 1) 98.5%, rgba(0, 0, 0, 0) 100%);
            mask-image:
                radial-gradient(ellipse 56% 44% at 100% 4%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.42) 42%, rgba(0, 0, 0, 1) 80%),
                linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 5%, rgba(0, 0, 0, 1) 95%, rgba(0, 0, 0, 0) 100%),
                linear-gradient(to bottom, rgba(0, 0, 0, 1) 98.5%, rgba(0, 0, 0, 0) 100%);
            -webkit-mask-composite: source-in, source-in, source-in;
            mask-composite: intersect;
            -webkit-mask-size: 100% 100%;
            mask-size: 100% 100%;
            -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
        }

        .onboarding-welcome-screen .onboarding-welcome-hero {
            position: relative;
            flex: 1;
            min-height: 0;
            width: 100%;
            margin-top: 0;
            padding-bottom: 88px;
            overflow: visible;
        }

        .onboarding-welcome-screen .onboarding-welcome-copy {
            position: relative;
            z-index: 6;
            display: inline-block;
            max-width: min(72%, calc(100% - 48px));
            vertical-align: top;
            text-align: left;
            padding: 0 0 0 14px;
            margin: 0 0 0 6px;
            text-shadow:
                0 0 12px rgba(253, 249, 246, 0.95),
                0 2px 10px rgba(253, 249, 246, 0.85);
        }

        .onboarding-welcome-screen .onboarding-welcome-copy-rest {
            width: 0;
            min-width: 100%;
        }

        .onboarding-welcome-screen .onboarding-welcome-subtitle,
        .onboarding-welcome-screen .onboarding-welcome-lead {
            max-width: 100%;
        }

        .onboarding-welcome-screen .onboarding-welcome-title {
            margin: 0 0 2px;
            font-size: var(--lapi-fs-28);
            font-weight: 800;
            line-height: 1.1;
            letter-spacing: -0.03em;
            color: var(--lapi-chocolate);
        }

        .onboarding-welcome-screen .onboarding-welcome-subtitle {
            margin: 0 0 10px;
            font-size: var(--lapi-fs-18);
            font-weight: 800;
            line-height: 1.2;
            letter-spacing: -0.02em;
            color: var(--lapi-chocolate);
        }

        .onboarding-welcome-screen .onboarding-welcome-lead {
            margin: 0;
            font-size: var(--lapi-fs-14);
            font-weight: 600;
            line-height: 1.45;
            color: var(--lapi-chocolate-soft);
        }

        .onboarding-welcome-screen .onboarding-mascot-container--welcome {
            position: absolute;
            top: 0;
            bottom: 0;
            left: auto;
            right: -8%;
            width: 94%;
            height: 100%;
            margin: 0;
            min-height: 0;
            display: flex;
            align-items: flex-end;
            justify-content: flex-end;
            background: transparent;
            isolation: isolate;
            z-index: 5;
            pointer-events: none;
            overflow: visible;
        }

        .onboarding-lapi-text {
            font-size: var(--lapi-fs-17);
            line-height: 1.55;
            color: var(--lapi-chocolate);
            text-align: center;
            margin: 0;
            max-width: 300px;
        }

        .onboarding-lapi-text--step2 {
            font-size: var(--lapi-fs-16);
            line-height: 1.5;
            max-width: 310px;
        }

        .onboarding-focus-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
            margin: 0 0 10px;
            max-width: 100%;
        }

        .onboarding-focus-tag {
            border: 2px solid rgba(26, 188, 156, 0.15);
            background: var(--lapi-mint-bg);
            border-radius: 999px;
            padding: 9px 16px;
            font-size: var(--lapi-fs-14);
            font-weight: 700;
            font-family: inherit;
            color: var(--lapi-mint);
            cursor: pointer;
            transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
        }

        .onboarding-focus-tag:hover {
            background: #dff5f0;
            border-color: rgba(26, 188, 156, 0.35);
        }

        .onboarding-focus-tag.selected {
            background: var(--lapi-mint);
            border-color: var(--lapi-mint);
            color: #fff;
            box-shadow: 0 6px 18px rgba(26, 188, 156, 0.35);
        }

        .onboarding-focus-tag:active {
            transform: scale(0.96);
        }

        .onboarding-tariff-wrap {
            display: flex;
            justify-content: center;
            margin: 6px 0 8px;
        }

        .onboarding-tariff-wrap .tariff-badge {
            background: linear-gradient(135deg, #ffe4d6, #ffd4c4);
            color: var(--lapi-accent);
            font-size: var(--lapi-fs-24);
            padding: 10px 22px;
            box-shadow: 0 8px 20px var(--lapi-coral-glow);
        }

        .onboarding-tariff-note {
            font-size: var(--lapi-fs-13);
            line-height: 1.45;
            color: var(--lapi-text-muted);
            text-align: center;
            margin: 0;
        }

        @keyframes onboardingMascotFloat {
            0%, 100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-7px);
            }
        }

        @keyframes onboardingMascotWave {
            0%, 100% {
                transform: translateY(0) rotate(0deg);
            }
            25% {
                transform: translateY(-4px) rotate(-4deg);
            }
            75% {
                transform: translateY(-4px) rotate(4deg);
            }
        }

        .onboarding-step-body {
            flex: 1;
            min-height: 0;
            overflow: hidden;
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 0 4px;
            gap: 0;
        }

        .onboarding-step-footer {
            flex-shrink: 0;
            width: 100%;
            padding-top: 14px;
        }

        .onboarding-welcome-screen.active .onboarding-step-footer {
            position: relative;
            z-index: 8;
            padding-top: 6px;
        }

        .onboarding-welcome-screen .lapi-media-holder {
            width: 100%;
            height: 100%;
            max-width: none;
            overflow: visible;
            background: transparent;
            box-shadow: none;
            border-radius: 0;
            display: flex;
            align-items: flex-end;
            justify-content: flex-end;
            transform: none;
        }

        .lapi-mascot-video--soft-edge,
        .onboarding-welcome-screen .lapi-media-holder video,
        #lapi-media-holder-screen0 video,
        #lapi-media-holder-screen1 video {
            display: block !important;
            width: auto;
            height: auto;
            max-width: 118%;
            max-height: 100%;
            min-height: 0;
            object-fit: contain;
            object-position: bottom right;
            background: transparent;
            mix-blend-mode: multiply;
            animation: onboardingMascotFloat 3.2s ease-in-out infinite;
            -webkit-mask-image:
                radial-gradient(ellipse 52% 42% at 0% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                radial-gradient(ellipse 52% 42% at 100% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%),
                linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%, rgba(0, 0, 0, 1) 94%, rgba(0, 0, 0, 0) 100%),
                linear-gradient(to bottom, rgba(0, 0, 0, 1) 82%, rgba(0, 0, 0, 0) 100%);
            mask-image:
                radial-gradient(ellipse 52% 42% at 0% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                radial-gradient(ellipse 52% 42% at 100% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%),
                linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%, rgba(0, 0, 0, 1) 94%, rgba(0, 0, 0, 0) 100%),
                linear-gradient(to bottom, rgba(0, 0, 0, 1) 82%, rgba(0, 0, 0, 0) 100%);
            -webkit-mask-composite: source-in, source-in, source-in, source-in;
            mask-composite: intersect;
            -webkit-mask-size: 100% 100%;
            mask-size: 100% 100%;
            -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
            -webkit-mask-position: center;
            mask-position: center;
        }


        .screens:not(:has(#screenMain.active)) {
            overflow: hidden;
        }

        .screen.active:not(#screenMain):not(#screen1):not(#screen2):not(#screen3) .btn-primary {
            background: var(--lapi-coral);
            color: #fff;
            font-weight: 800;
            font-size: var(--lapi-fs-17);
            letter-spacing: 0.01em;
            padding: 16px 20px;
            border-radius: 20px;
            box-shadow: 0 10px 24px var(--lapi-coral-glow);
        }

        .screen.active:not(#screenMain):not(#screen1):not(#screen2):not(#screen3) .btn-primary:hover {
            background: var(--lapi-coral-light);
            transform: translateY(-1px);
            box-shadow: 0 12px 28px rgba(255, 122, 89, 0.38);
        }

        .screen.active:not(#screenMain):not(#screen1):not(#screen2):not(#screen3) .btn-primary:active {
            background: var(--lapi-coral-press);
            transform: scale(0.97) translateY(1px);
            box-shadow: 0 5px 14px rgba(255, 122, 89, 0.28);
        }

        #screen2.active .onboarding-step-footer .btn-primary,
        #screen3.active .onboarding-step-footer .btn-primary {
            position: relative;
            z-index: 0;
            overflow: hidden;
            isolation: isolate;
            width: 100%;
            max-width: none;
            border: none;
            color: #fff;
            font-weight: 800;
            background-color: #b5e8d8;
            box-shadow: 0 10px 22px rgba(181, 232, 216, 0.55);
            text-shadow: 0 1px 2px rgba(60, 42, 33, 0.12);
            color: #3c2a21;
        }

        #screen2.active .onboarding-step-footer .btn-primary::before,
        #screen3.active .onboarding-step-footer .btn-primary::before {
            content: '';
            position: absolute;
            inset: 0;
            z-index: -1;
            border-radius: inherit;
            background: linear-gradient(
                90deg,
                #b8e8d8 0%,
                #d4f5ea 16%,
                #ffe8dc 32%,
                #ffd9ce 48%,
                #fff0e8 56%,
                #ffd9ce 64%,
                #ffe8dc 78%,
                #d4f5ea 90%,
                #b8e8d8 100%
            );
            background-size: 240% 100%;
            animation: onboardingBtnShimmerBg 5.5s ease-in-out infinite;
        }

        @keyframes onboardingBtnShimmerBg {
            0% {
                background-position: 0% 50%;
            }
            100% {
                background-position: 200% 50%;
            }
        }

        .lapi-btn-shimmer {
            position: relative;
            z-index: 0;
            overflow: hidden;
            isolation: isolate;
            border: none;
            color: #3c2a21;
            font-weight: 800;
            background-color: #b5e8d8;
            box-shadow: 0 10px 22px rgba(181, 232, 216, 0.45);
        }

        .lapi-btn-shimmer::before {
            content: '';
            position: absolute;
            inset: 0;
            z-index: -1;
            border-radius: inherit;
            background: linear-gradient(
                90deg,
                #b8e8d8 0%,
                #d4f5ea 16%,
                #ffe8dc 32%,
                #ffd9ce 48%,
                #fff0e8 56%,
                #ffd9ce 64%,
                #ffe8dc 78%,
                #d4f5ea 90%,
                #b8e8d8 100%
            );
            background-size: 240% 100%;
            animation: onboardingBtnShimmerBg 5.5s ease-in-out infinite;
        }

        .lapi-btn-shimmer:active {
            transform: scale(0.98);
        }

        .lapi-btn-shimmer--round {
            width: 72px;
            height: 72px;
            border-radius: 50%;
            padding: 0;
            box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.28), 0 10px 22px rgba(181, 232, 216, 0.35);
        }

        .lapi-btn-shimmer--round::after {
            content: '';
            position: absolute;
            inset: 10px;
            border-radius: 50%;
            border: 3px solid rgba(255, 255, 255, 0.85);
            pointer-events: none;
        }

        #screen2.active .onboarding-step-footer .btn-primary:hover,
        #screen3.active .onboarding-step-footer .btn-primary:hover {
            background-color: #c5efe3;
            box-shadow: 0 12px 26px rgba(181, 232, 216, 0.65);
            filter: brightness(1.03);
        }

        #screen2.active .onboarding-step-footer .btn-primary:hover::before,
        #screen3.active .onboarding-step-footer .btn-primary:hover::before {
            filter: brightness(1.08);
        }

        #screen2.active .onboarding-step-footer .btn-primary:active,
        #screen3.active .onboarding-step-footer .btn-primary:active {
            transform: scale(0.97) translateY(1px);
            box-shadow: 0 6px 14px rgba(22, 160, 133, 0.3);
        }

        #screen2.active .onboarding-step-footer .btn-primary:active::before,
        #screen3.active .onboarding-step-footer .btn-primary:active::before {
            animation: none;
            background: #a8dcc8;
            background-size: 100% 100%;
            background-position: 50% 50%;
        }

        .screen.active:not(#screenMain) .logo {
            font-size: var(--lapi-fs-28);
            font-weight: 800;
            color: var(--lapi-coral);
            letter-spacing: -0.03em;
        }

        .screen.active:not(#screenMain) .slogan {
            font-size: var(--lapi-fs-15);
            font-weight: 700;
            color: var(--lapi-chocolate-soft);
        }

        .screen.active:not(#screenMain) .form-error {
            font-size: var(--lapi-fs-13);
            text-align: center;
        }

        .screen.leaving:not(#screenMain) {
            display: flex !important;
            flex-direction: column;
            flex: 1;
            min-height: 0;
            z-index: 1;
            pointer-events: none;
            background: var(--lapi-cream);
            animation: screenOut 0.22s ease forwards;
        }

        .screen.leaving:not(#screenMain) .onboarding-mascot-container,
        .screen.leaving:not(#screenMain) .onboarding-brand-logo,
        .screen.leaving:not(#screenMain) .onboarding-welcome-hero,
        .screen.leaving:not(#screenMain) .onboarding-focus-hero,
        .screen.leaving:not(#screenMain) .onboarding-offer-hero,
        .screen.leaving:not(#screenMain) .onboarding-offer-copy,
        .screen.leaving:not(#screenMain) .onboarding-offer-details,
        .screen.leaving:not(#screenMain) .onboarding-welcome-copy,
        .screen.leaving:not(#screenMain) .onboarding-screen-title,
        .screen.leaving:not(#screenMain) .onboarding-lapi-text,
        .screen.leaving:not(#screenMain) .onboarding-focus-block {
            opacity: 0;
            transition: opacity 0.12s ease;
        }

        .screen.leaving:not(#screenMain) .lapi-media-holder video {
            animation: none !important;
            opacity: 0;
        }

        .screen.entering:not(#screenMain) {
            z-index: 2;
        }

        .screen.leaving#screenMain {
            display: block;
            animation: screenOut 0.25s ease forwards;
        }

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

        @keyframes screenOut {
            from {
                opacity: 1;
            }
            to {
                opacity: 0;
            }
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .logo {
            font-size: var(--lapi-fs-28);
            font-weight: bold;
            color: #333333;
            margin-bottom: 4px;
        }

        .slogan {
            font-size: var(--lapi-fs-14);
            color: #666;
            margin-bottom: 12px;
        }

        .screen-title {
            font-size: var(--lapi-fs-20);
            font-weight: 700;
            color: #333333;
            margin: 0 0 16px;
            text-align: left;
            line-height: 1.3;
        }

        .mascot-widget {
            background-color: #FFDFD3;
            border-radius: 24px;
            padding: 24px 20px;
            margin-bottom: 24px;
        }

        .mascot-widget--main {
            position: relative;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            min-height: 72px;
            margin-bottom: 10px;
            padding: 12px 84px 12px 14px;
            background: rgba(255, 223, 211, 0.45);
            border-radius: 14px;
            overflow: hidden;
        }

        .mascot-widget--main .mascot-widget-text {
            flex: 1;
            min-width: 0;
            font-size: var(--lapi-fs-13);
            line-height: 1.35;
            color: #555;
            text-align: left;
            margin: 0;
            transition: opacity 0.35s ease;
        }

        .mascot-widget--main .mascot-widget-text.is-fading {
            opacity: 0;
        }

        .mascot-widget--main.mascot-widget--clickable {
            cursor: pointer;
        }

        .mascot-widget--main.mascot-widget--clickable:active {
            transform: scale(0.99);
        }

        .mascot-peek-slot {
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            width: 76px;
            height: 100%;
            pointer-events: none;
            overflow: hidden;
        }

        .mascot-peek {
            position: absolute;
            top: 0;
            right: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            will-change: transform;
            animation: mascotPeek 3.4s ease-in-out infinite;
        }

        .mascot-peek--emoji {
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 48px;
            line-height: 1;
        }

        .mascot-peek--video {
            display: block;
            width: 100%;
            height: 100%;
            max-height: none;
            object-fit: contain;
            object-position: right center;
            background: transparent;
            mix-blend-mode: multiply;
        }

        .mascot-widget--main .mascot-peek--video,
        .mascot-widget--main .mascot-peek--emoji {
            -webkit-mask-image:
                radial-gradient(ellipse 52% 40% at 0% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 72%),
                radial-gradient(ellipse 52% 40% at 100% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 72%),
                radial-gradient(ellipse 52% 40% at 0% 100%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 72%),
                radial-gradient(ellipse 52% 40% at 100% 100%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 72%),
                linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 14%, rgba(0, 0, 0, 1) 26%, rgba(0, 0, 0, 1) 74%, rgba(0, 0, 0, 0.55) 86%, rgba(0, 0, 0, 0) 100%),
                linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.45) 20%, rgba(0, 0, 0, 1) 46%, rgba(0, 0, 0, 1) 88%, rgba(0, 0, 0, 0.35) 96%, rgba(0, 0, 0, 0) 100%);
            mask-image:
                radial-gradient(ellipse 52% 40% at 0% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 72%),
                radial-gradient(ellipse 52% 40% at 100% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 72%),
                radial-gradient(ellipse 52% 40% at 0% 100%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 72%),
                radial-gradient(ellipse 52% 40% at 100% 100%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 72%),
                linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 14%, rgba(0, 0, 0, 1) 26%, rgba(0, 0, 0, 1) 74%, rgba(0, 0, 0, 0.55) 86%, rgba(0, 0, 0, 0) 100%),
                linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.45) 20%, rgba(0, 0, 0, 1) 46%, rgba(0, 0, 0, 1) 88%, rgba(0, 0, 0, 0.35) 96%, rgba(0, 0, 0, 0) 100%);
            -webkit-mask-composite: source-in, source-in, source-in, source-in, source-in, source-in;
            mask-composite: intersect;
            -webkit-mask-size: 100% 100%;
            mask-size: 100% 100%;
            -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
            -webkit-mask-position: center;
            mask-position: center;
        }

        .mascot-peek--emoji[hidden],
        .mascot-peek--video[hidden] {
            display: none !important;
            animation: none;
        }

        .mascot-emoji {
            font-size: 52px;
            margin-bottom: 12px;
            line-height: 1;
        }

        @keyframes mascotPeek {
            0%, 100% {
                transform: translate(0, 0) rotate(0deg);
            }
            50% {
                transform: translate(-3px, -4px) rotate(-6deg);
            }
        }

        .intro-text {
            font-size: var(--lapi-fs-15);
            line-height: 1.55;
            color: #444;
            text-align: left;
            margin: 0;
        }

        .body-text {
            font-size: var(--lapi-fs-14);
            line-height: 1.55;
            color: #555;
            text-align: left;
            margin: 0 0 24px;
        }

        .btn-primary {
            background-color: #E2F0D9;
            color: #333333;
            border: none;
            padding: 16px;
            width: 100%;
            border-radius: 16px;
            font-size: var(--lapi-fs-16);
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.2s, transform 0.15s;
        }

        .btn-primary:hover {
            background-color: #d2e4c8;
        }

        .btn-primary:active {
            transform: scale(0.98);
        }

        .btn-primary:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .pet-type-row {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 20px;
        }

        .pet-type-btn {
            background-color: #FAFAFA;
            border: 2px solid transparent;
            padding: 14px 18px;
            border-radius: 24px;
            font-size: var(--lapi-fs-16);
            font-weight: 600;
            color: #333;
            cursor: pointer;
            transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
            text-align: center;
        }

        .pet-type-btn:hover {
            background-color: #f5f5f5;
        }

        .pet-type-btn.selected {
            background-color: #FFDFD3;
            border-color: #e8c4b8;
        }

        .form-group {
            margin-bottom: 16px;
            text-align: left;
        }

        .form-label {
            display: block;
            font-size: var(--lapi-fs-13);
            font-weight: 600;
            color: #555;
            margin-bottom: 8px;
        }

        .form-input {
            width: 100%;
            padding: 14px 16px;
            border: 2px solid #eee;
            border-radius: 16px;
            font-size: var(--lapi-fs-16);
            font-family: inherit;
            color: #333;
            background: #FAFAFA;
            transition: border-color 0.2s, background-color 0.2s;
        }

        /* iOS Safari: при font-size < 16px при фокусе увеличивает страницу */
        @supports (-webkit-touch-callout: none) {
            textarea,
            select,
            input:not([type='checkbox']):not([type='radio']):not([type='button']):not([type='submit']):not([type='file']):not([type='hidden']):not([type='range']) {
                font-size: 16px !important;
            }
        }

        .form-input:focus {
            outline: none;
            border-color: #E2F0D9;
            background: #fff;
        }

        .form-input.input-error {
            border-color: #e57373;
            background-color: #fff8f8;
            transition: border-color 0.25s ease, background-color 0.25s ease;
        }

        .form-input.input-error:focus {
            border-color: #d32f2f;
            background: #fff;
        }

        .form-error-inline {
            display: none;
            margin-top: 6px;
            margin-bottom: 12px;
            font-size: var(--lapi-fs-12);
            line-height: 1.45;
            font-weight: 500;
            color: #b45309;
            text-align: center;
        }

        #medicalBaselineDateError.form-error-inline {
            margin-top: 8px;
            margin-bottom: 0;
            font-size: var(--lapi-fs-15);
            line-height: 1.5;
            font-weight: 500;
            color: #9a5b2e;
            text-align: center;
        }

        .form-error-inline.visible {
            display: none !important;
        }

        .focus-cards {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 24px;
        }

        .focus-card {
            background-color: #FAFAFA;
            border: 2px solid transparent;
            border-radius: 16px;
            padding: 16px;
            text-align: left;
            font-size: var(--lapi-fs-14);
            line-height: 1.45;
            color: #444;
            cursor: pointer;
            transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
            user-select: none;
        }

        .focus-card:hover {
            background-color: #f5f5f5;
        }

        .focus-card.selected {
            background-color: #E2F0D9;
            border-color: #c8dbb8;
        }

        .tariff-badge {
            display: inline-block;
            background-color: #FFDFD3;
            border-radius: 24px;
            padding: 8px 16px;
            font-size: var(--lapi-fs-22);
            font-weight: 700;
            color: #333;
            margin-bottom: 16px;
        }

        .onboarding-mascot-block .tariff-badge {
            margin-top: 6px;
            margin-bottom: 0;
        }

        .body-text.onboarding-tariff-details {
            margin: 0 0 12px;
        }

        #screen3 .onboarding-step-footer .onboarding-inline-error {
            flex-shrink: 0;
        }

        .form-error {
            font-size: var(--lapi-fs-12);
            color: #c44;
            text-align: left;
            margin: -8px 0 12px;
            display: none;
        }

        .form-error.visible {
            display: none !important;
        }

        #medicalBaselineDateError.form-error-inline.visible {
            display: none !important;
        }

        #screenMain.screen.active {
            display: flex;
        }

        #screenMain.active {
            text-align: left;
            flex: 1;
            min-height: 0;
            flex-direction: column;
            overflow: hidden;
        }

        #screenMain .btn-primary {
            background: var(--lapi-coral);
            color: #fff;
            font-weight: 800;
            font-size: var(--lapi-fs-16);
            padding: 14px 18px;
            border-radius: 16px;
            box-shadow: 0 8px 20px var(--lapi-coral-glow);
        }

        #subScreenProfile .btn-primary.btn-lapi-gradient,
        #subScreenProfile .profile-action-btn.btn-primary {
            color: #3c2a21;
            background-color: #b5e8d8;
            box-shadow: 0 10px 22px rgba(181, 232, 216, 0.45);
        }

        #screenMain .btn-secondary {
            background: transparent;
            color: var(--lapi-chocolate-soft);
            border: 1px solid rgba(60, 42, 33, 0.15);
            border-radius: 16px;
        }

        .main-app {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
            height: 100%;
            overflow: hidden;
        }

        .main-content {
            flex: 1;
            min-height: 0;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            background: var(--lapi-cream);
            font-family: 'Nunito', sans-serif;
            color: var(--lapi-chocolate);
        }

        .sub-screen {
            display: none;
        }

        .sub-screen.active {
            display: block;
            animation: fadeIn 0.3s ease;
        }

        #subScreenHome.active {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
            overflow: hidden;
        }

        .home-scroll {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
            padding: 4px 2px 12px;
        }

        .home-mood-card {
            margin-bottom: 16px;
            padding: 16px 14px 10px;
            border-radius: 20px;
            background: rgba(255, 223, 211, 0.55);
            overflow: visible;
        }

        .home-mood-hero {
            display: flex;
            align-items: stretch;
            justify-content: space-between;
            gap: 8px;
            min-height: 150px;
        }

        .home-mood-text {
            flex: 0 1 46%;
            max-width: 46%;
            margin: 0;
            padding: 4px 4px 0 0;
            font-size: var(--lapi-fs-15);
            line-height: 1.45;
            font-weight: 500;
            text-align: left;
            color: var(--lapi-chocolate);
            align-self: flex-start;
            position: relative;
            z-index: 3;
            text-shadow:
                0 0 10px rgba(253, 249, 246, 0.95),
                0 2px 8px rgba(253, 249, 246, 0.85);
        }

        .home-mood-mascot-container {
            flex: 1 1 auto;
            min-width: 0;
            min-height: 150px;
            align-self: stretch;
            display: flex;
            align-items: stretch;
            justify-content: flex-end;
            pointer-events: none;
        }

        .home-mood-media-holder {
            width: 100%;
            height: 100%;
            min-height: 150px;
            display: flex;
            align-items: stretch;
            justify-content: flex-end;
            overflow: visible;
            background: transparent;
        }

        .home-mood-card {
            cursor: pointer;
        }

        .home-mood-media-holder video {
            display: block;
            width: auto;
            height: 100%;
            min-height: 150px;
            max-width: 100%;
            max-height: none;
            object-fit: contain;
            object-position: bottom right;
            background: transparent;
            mix-blend-mode: multiply;
            animation: onboardingMascotFloat 3.2s ease-in-out infinite;
        }

        .home-mood-media-holder video.lapi-mascot-video--soft-edge,
        .home-mood-media-holder video {
            -webkit-mask-image:
                radial-gradient(ellipse 52% 42% at 0% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                radial-gradient(ellipse 52% 42% at 100% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%),
                linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%, rgba(0, 0, 0, 1) 94%, rgba(0, 0, 0, 0) 100%),
                linear-gradient(to bottom, rgba(0, 0, 0, 1) 82%, rgba(0, 0, 0, 0) 100%);
            mask-image:
                radial-gradient(ellipse 52% 42% at 0% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                radial-gradient(ellipse 52% 42% at 100% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 78%),
                linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%),
                linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 6%, rgba(0, 0, 0, 1) 94%, rgba(0, 0, 0, 0) 100%),
                linear-gradient(to bottom, rgba(0, 0, 0, 1) 82%, rgba(0, 0, 0, 0) 100%);
            -webkit-mask-composite: source-in, source-in, source-in, source-in;
            mask-composite: intersect;
            -webkit-mask-size: 100% 100%;
            mask-size: 100% 100%;
            -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
            -webkit-mask-position: center;
            mask-position: center;
        }

        .home-quick-actions {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 16px;
        }

        #screenMain .home-quick-actions .btn-primary {
            position: relative;
            z-index: 0;
            overflow: hidden;
            isolation: isolate;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 2px;
            width: 100%;
            max-width: none;
            min-height: 56px;
            border: none;
            font-weight: 800;
            font-size: var(--lapi-fs-12);
            line-height: 1.2;
            padding: 12px 8px;
            border-radius: 20px;
            text-align: center;
            white-space: normal;
            background-color: #b5e8d8;
            box-shadow: 0 10px 22px rgba(181, 232, 216, 0.55);
            text-shadow: 0 1px 2px rgba(60, 42, 33, 0.12);
            color: #3c2a21;
        }

        .home-action-line {
            display: block;
        }

        #screenMain .home-quick-actions .btn-primary::before {
            content: '';
            position: absolute;
            inset: 0;
            z-index: -1;
            border-radius: inherit;
            background: linear-gradient(
                90deg,
                #b8e8d8 0%,
                #d4f5ea 16%,
                #ffe8dc 32%,
                #ffd9ce 48%,
                #fff0e8 56%,
                #ffd9ce 64%,
                #ffe8dc 78%,
                #d4f5ea 90%,
                #b8e8d8 100%
            );
            background-size: 240% 100%;
            animation: onboardingBtnShimmerBg 5.5s ease-in-out infinite;
        }

        #screenMain .home-quick-actions .btn-primary:active {
            transform: scale(0.97) translateY(1px);
            box-shadow: 0 6px 14px rgba(22, 160, 133, 0.3);
        }

        #screenMain .home-quick-actions .btn-primary:active::before {
            animation: none;
            background: #a8dcc8;
            background-size: 100% 100%;
            background-position: 50% 50%;
        }

        .home-status-banner {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            border-radius: 24px;
            padding: 14px 108px 14px 18px;
            margin-bottom: 16px;
            min-height: 88px;
            overflow: hidden;
        }

        .home-status-text {
            flex: 1;
            min-width: 0;
            margin: 0;
            font-size: var(--lapi-fs-14);
            font-weight: 400;
            line-height: 1.45;
            text-align: left;
        }

        .home-status-mascot {
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            width: 104px;
            height: 100%;
            display: flex;
            align-items: stretch;
            justify-content: flex-end;
            pointer-events: none;
            overflow: hidden;
        }

        .home-status-mascot::after {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 14px;
            z-index: 1;
            pointer-events: none;
            -webkit-backdrop-filter: blur(4px);
            backdrop-filter: blur(4px);
            background: linear-gradient(to right, var(--home-status-mascot-edge, rgba(216, 243, 232, 0.5)), transparent);
        }

        .home-status-mascot video {
            display: block;
            width: auto;
            height: 108%;
            min-height: 108%;
            max-width: 108%;
            max-height: none;
            margin-top: -2%;
            margin-right: -3%;
            object-fit: contain;
            object-position: bottom right;
            background: transparent;
            mix-blend-mode: multiply;
            -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.35) 7%, rgba(0, 0, 0, 0.85) 13%, rgba(0, 0, 0, 1) 18%);
            mask-image: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.35) 7%, rgba(0, 0, 0, 0.85) 13%, rgba(0, 0, 0, 1) 18%);
            -webkit-mask-size: 100% 100%;
            mask-size: 100% 100%;
            -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
        }

        .home-status-banner--ok {
            --home-status-mascot-edge: rgba(216, 243, 232, 0.5);
            background: #d8f3e8;
        }

        .home-status-banner--ok .home-status-text {
            color: #1a6b4a;
        }

        .home-status-banner--warn {
            --home-status-mascot-edge: rgba(255, 232, 214, 0.5);
            background: #ffe8d6;
        }

        .home-status-banner--warn .home-status-text {
            color: #8f4a2c;
        }

        .task-datetime-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

        .home-today-head {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 10px;
        }

        .home-today-title {
            margin: 0;
            font-size: var(--lapi-fs-16);
            font-weight: 700;
            color: var(--lapi-chocolate);
            text-align: left;
        }

        .home-today-pet-filter {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }

        .home-today-pet-chip {
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 6px 12px;
            border-radius: 16px;
            border: 2px solid transparent;
            background: #f0f0f0;
            color: #777;
            font-size: var(--lapi-fs-13);
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            white-space: nowrap;
            transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
        }

        .home-today-pet-chip:hover:not(.active) {
            background: #f5f5f5;
            color: #555;
        }

        .profile-contact-line {
            margin: 0 0 8px;
        }

        .profile-support-email {
            font-weight: 700;
            color: var(--lapi-chocolate);
            user-select: all;
            -webkit-user-select: all;
        }

        .profile-contact-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 4px;
        }

        .profile-contact-copy-btn,
        .profile-contact-mail-btn {
            flex: 1 1 auto;
            min-width: 0;
            padding: 10px 14px;
            font-size: var(--lapi-fs-14);
        }

        .profile-passport-pet-picker {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 10px;
        }
        .profile-passport-pet-picker[hidden] {
            display: none !important;
        }
        .profile-passport-pet-chip {
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 6px 12px;
            border-radius: 16px;
            border: 2px solid transparent;
            background: #f0f0f0;
            color: #777;
            font-size: var(--lapi-fs-13);
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            white-space: nowrap;
        }
        .profile-passport-pet-chip.active {
            background: #e2f0d9;
            border-color: #c8dbb8;
            color: #333;
        }
        .home-today-pet-chip.active {
            background: #e2f0d9;
            border-color: #c8dbb8;
            color: #333;
        }

        .home-today-pet-chip-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .home-today-empty {
            margin: 0;
            padding: 12px 14px;
            font-size: var(--lapi-fs-13);
            color: var(--lapi-text-muted);
            text-align: left;
            background: rgba(255, 255, 255, 0.65);
            border-radius: 12px;
        }

        .home-today-list {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 8px;
            max-height: none;
            overflow: visible;
            padding-right: 2px;
        }

        .home-today-card {
            position: relative;
            flex: 0 0 auto;
            align-self: stretch;
            display: block;
            width: 100%;
            box-sizing: border-box;
            background: #fff;
            border-radius: 16px;
            padding: 12px 14px 12px 18px;
            text-align: left;
            box-shadow: 0 2px 10px rgba(60, 42, 33, 0.06);
            cursor: pointer;
            overflow: hidden;
            touch-action: manipulation;
        }

        .home-today-card::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 6px;
            border-radius: 0 6px 6px 0;
        }

        .home-today-card.critical::before {
            background: #e8a090;
        }

        .home-today-card.today::before {
            background: #e8c547;
        }

        .home-today-card.routine::before {
            background: #9ec98a;
        }

        .home-today-card:active {
            transform: scale(0.99);
        }

        .home-today-card .reminder-title {
            margin: 0 0 4px;
            font-size: var(--lapi-fs-14);
            font-weight: 600;
            line-height: 1.35;
            color: var(--lapi-chocolate);
            overflow-wrap: anywhere;
            word-break: break-word;
        }

        .home-today-meta {
            margin: 0;
            font-size: var(--lapi-fs-12);
            line-height: 1.35;
            color: var(--lapi-text-muted);
            display: flex;
            align-items: flex-start;
            flex-wrap: wrap;
            gap: 4px;
        }

        .home-today-pet-inline {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            vertical-align: middle;
        }

        #subScreenProfile.active {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
            overflow: hidden;
        }

        .profile-scroll {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
            touch-action: pan-y;
            overscroll-behavior: contain;
            padding: 8px 2px 16px;
        }

        .profile-screen-title {
            margin: 0 0 16px;
            font-size: var(--lapi-fs-22);
            font-weight: 700;
            text-align: left;
        }

        .profile-field-readonly {
            background: #f5f0ec;
            color: var(--lapi-chocolate-soft);
            cursor: default;
        }

        .app-bottom-nav {
            flex-shrink: 0;
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(68px, auto) minmax(0, 1fr) minmax(0, 1fr);
            align-items: flex-end;
            justify-items: center;
            column-gap: 2px;
            margin-top: auto;
            padding: 2px 4px calc(2px + env(safe-area-inset-bottom, 0px));
            background: #ffffff;
            border-top: 1px solid rgba(60, 42, 33, 0.08);
            box-shadow: 0 -4px 16px rgba(60, 42, 33, 0.06);
            overflow: visible;
            z-index: 40;
        }

        .app-bottom-nav[hidden] {
            display: none !important;
        }

        .bottom-nav-item {
            flex: 0 0 auto;
            min-width: 0;
            width: 100%;
            max-width: 72px;
            display: flex;
            align-items: flex-end;
            justify-content: center;
            padding: 0;
            border: none;
            background: transparent;
            cursor: pointer;
            -webkit-tap-highlight-color: transparent;
        }

        .bottom-nav-item .bottom-nav-icon {
            display: block;
            width: min(56px, 14.5vw);
            height: min(56px, 14.5vw);
            max-width: 100%;
            object-fit: contain;
            opacity: 0.42;
            transition: opacity 0.2s ease, transform 0.15s ease;
        }

        .bottom-nav-item.active .bottom-nav-icon {
            opacity: 1;
        }

        .bottom-nav-item:active .bottom-nav-icon {
            transform: scale(0.94);
        }

        .bottom-nav-item--fab {
            grid-column: 3;
            flex: 0 0 auto;
            width: auto;
            max-width: none;
            height: auto;
            margin: 0 2px 0;
            padding: 0;
            align-self: flex-end;
            overflow: visible;
        }

        .bottom-nav-item--fab .bottom-nav-icon {
            width: min(67px, 17.4vw);
            height: min(67px, 17.4vw);
            opacity: 1;
            object-fit: contain;
            mix-blend-mode: darken;
            transform: none;
            transform-origin: center bottom;
        }

        .bottom-nav-item--fab:active .bottom-nav-icon {
            transform: scale(0.94);
        }

        .bottom-sheet-overlay {
            align-items: flex-end;
            padding: 0;
        }

        .bottom-sheet {
            width: 100%;
            max-width: 390px;
            margin: 0 auto;
            padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px));
            border-radius: 24px 24px 0 0;
            background: #fff;
            text-align: left;
            animation: sheetUp 0.32s ease;
        }

        @keyframes sheetUp {
            from {
                transform: translateY(100%);
            }
            to {
                transform: translateY(0);
            }
        }

        .bottom-sheet-title {
            margin: 0 0 8px;
            font-size: var(--lapi-fs-18);
            font-weight: 700;
            color: var(--lapi-chocolate);
        }

        .bottom-sheet-desc {
            margin: 0 0 16px;
            font-size: var(--lapi-fs-14);
            line-height: 1.45;
            color: var(--lapi-text-muted);
        }

        .symptom-step {
            display: none;
        }

        .symptom-step.active {
            display: block;
        }

        .symptom-options {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 16px;
        }

        .symptom-option {
            border: 1px solid rgba(60, 42, 33, 0.12);
            border-radius: 12px;
            padding: 10px 12px;
            background: #faf7f4;
            font-family: inherit;
            font-size: var(--lapi-fs-13);
            cursor: pointer;
        }

        .symptom-option.selected {
            border-color: var(--lapi-coral);
            background: rgba(255, 122, 89, 0.12);
            color: var(--lapi-coral-press);
        }

        #subScreenPets.active {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
            height: 100%;
            max-height: 100%;
            overflow: hidden;
        }

        .pets-scroll-body {
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
        }

        #subScreenPets.active #carePlanSection,
        #subScreenPets.active .care-panel-viewport {
            flex: none;
            min-height: auto;
            overflow: visible;
        }

        #subScreenPets.active .care-plan-list {
            max-height: none;
            overflow: visible;
        }

        .pets-top-panel {
            flex-shrink: 0;
        }

        .pets-top-panel .home-mood-card {
            margin-bottom: 8px;
            padding: 10px 12px 6px;
        }

        #subScreenPets .pets-mood-card .home-mood-hero {
            min-height: 108px;
        }

        #subScreenPets .pets-mood-card .home-mood-mascot-container,
        #subScreenPets .pets-mood-card .home-mood-media-holder {
            min-height: 108px;
        }

        #subScreenPets .pets-mood-card .home-mood-media-holder video {
            min-height: 108px;
        }

        #subScreenPets .pets-screen-header {
            padding-bottom: 4px;
        }

        #subScreenPets .pets-selector-row {
            margin-bottom: 10px;
        }

        #subScreenPets.active .care-plan-list,
        #subScreenPets.active .medical-archive-list,
        #subScreenPets.active #healthManualPanel {
            max-height: none;
            overflow: visible;
        }

        .home-mood-text.is-fading {
            opacity: 0;
            transition: opacity 0.35s ease;
        }

        .pets-screen-header {
            flex-shrink: 0;
            position: relative;
            z-index: 2;
            background: #ffffff;
        }

        .pets-selector-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 16px;
        }

        .pets-selector-scroll-wrap {
            flex: 1;
            min-width: 0;
            position: relative;
        }

        .pets-selector-scroll-wrap::after {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            bottom: 4px;
            width: 36px;
            background: linear-gradient(to right, transparent, #ffffff);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.25s ease;
        }

        .pets-selector-scroll-wrap.has-overflow::after {
            opacity: 1;
        }

        #petsSelectorContainer {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            white-space: nowrap;
            padding-bottom: 6px;
            scrollbar-width: thin;
            scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
        }

        #petsSelectorContainer.centered {
            justify-content: center;
        }

        #petsSelectorContainer.scrollable {
            justify-content: flex-start;
        }

        #petsSelectorContainer::-webkit-scrollbar {
            height: 3px;
        }

        #petsSelectorContainer::-webkit-scrollbar-thumb {
            background: rgba(0, 0, 0, 0.15);
            border-radius: 3px;
        }

        #petsSelectorContainer::-webkit-scrollbar-track {
            background: transparent;
        }

        .btn-add-pet-circle {
            flex-shrink: 0;
            width: 44px;
            height: 44px;
            border: none;
            border-radius: 50%;
            background: #FFDFD3;
            color: #333;
            font-size: var(--lapi-fs-26);
            font-weight: 400;
            line-height: 1;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            transition: background-color 0.2s ease, transform 0.15s ease;
        }

        .btn-add-pet-circle:hover {
            background: #f5cfc4;
        }

        .btn-add-pet-circle:active {
            transform: scale(0.95);
        }

        .pets-selector-row--first-pet .pets-selector-scroll-wrap {
            display: none;
        }

        .first-pet-onboarding-hint {
            flex: 1;
            min-width: 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 10px 14px;
            border-radius: 16px;
            background: rgba(181, 232, 216, 0.5);
        }

        .first-pet-onboarding-hint[hidden] {
            display: none !important;
        }

        .first-pet-onboarding-text {
            margin: 0;
            font-size: var(--lapi-fs-14);
            font-weight: 700;
            line-height: 1.35;
            color: var(--lapi-chocolate, #3c2a21);
        }

        .first-pet-onboarding-arrow {
            flex-shrink: 0;
            font-size: var(--lapi-fs-26);
            font-weight: 700;
            line-height: 1;
            color: var(--lapi-coral, #ff7a59);
            transform: translateX(2px);
        }

        .pets-selector-row--first-pet .btn-add-pet-circle {
            box-shadow: 0 0 0 3px rgba(255, 122, 89, 0.32), 0 4px 12px rgba(0, 0, 0, 0.08);
        }

        .pet-chip {
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 10px 16px;
            border-radius: 20px;
            border: 2px solid transparent;
            background: #f0f0f0;
            color: #777;
            font-size: var(--lapi-fs-14);
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            white-space: nowrap;
            transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
        }

        .pet-chip:hover:not(.active) {
            background: #f5f5f5;
            color: #555;
        }

        .pet-chip.active {
            background: #E2F0D9;
            border-color: #c8dbb8;
            color: #333;
        }

        .pet-chip:active {
            transform: scale(0.97);
        }

        .pet-chip-icon {
            flex-shrink: 0;
            width: 36px;
            height: 36px;
            margin: -6px 0;
            font-size: var(--lapi-fs-16);
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .pet-avatar {
            object-fit: cover;
            border-radius: 50%;
            flex-shrink: 0;
            display: block;
        }

        .pet-avatar--chip { width: 36px; height: 36px; }
        .pet-avatar--card { width: 32px; height: 32px; }
        .pet-avatar--md { width: 26px; height: 26px; }
        .pet-avatar--xs { width: 20px; height: 20px; }
        .pet-avatar--lg { width: 72px; height: 72px; }

        .pet-avatar--emoji {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: rgba(181, 232, 216, 0.35);
        }

        .pet-avatar--chip.pet-avatar--emoji { width: 36px; height: 36px; font-size: var(--lapi-fs-22); }
        .pet-avatar--card.pet-avatar--emoji { width: 32px; height: 32px; font-size: var(--lapi-fs-20); }
        .pet-avatar--lg.pet-avatar--emoji { width: 72px; height: 72px; font-size: 36px; border-radius: 50%; }

        .pet-avatar-upload {
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .pet-avatar-preview {
            width: 72px;
            height: 72px;
            border-radius: 50%;
            overflow: hidden;
            flex-shrink: 0;
            background: rgba(181, 232, 216, 0.35);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .pet-avatar-preview .pet-avatar--lg {
            width: 72px;
            height: 72px;
        }

        #addPetModal.add-pet-modal--edit .pet-avatar-preview {
            width: 104px;
            height: 104px;
        }

        #addPetModal.add-pet-modal--edit .pet-avatar-preview .pet-avatar--lg,
        #addPetModal.add-pet-modal--edit .pet-avatar-preview .pet-avatar--emoji.pet-avatar--lg {
            width: 104px;
            height: 104px;
            font-size: 52px;
        }

        .pet-avatar-upload-actions {
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: flex-start;
        }

        #addPetModal.add-pet-modal--edit .pet-avatar-upload-actions {
            gap: 6px;
        }

        #addPetModal.add-pet-modal--edit .pet-avatar-btn-upload,
        #addPetModal.add-pet-modal--edit .pet-avatar-btn-remove {
            padding: 7px 12px;
            font-size: var(--lapi-fs-13);
            font-weight: 700;
            border-radius: 12px;
            min-height: 0;
            line-height: 1.2;
        }

        #addPetModal.add-pet-modal--edit .pet-avatar-btn-upload {
            background: #b5e8d8;
            color: var(--lapi-chocolate, #3c2a21);
            border: none;
            box-shadow: 0 4px 12px rgba(181, 232, 216, 0.45);
        }

        #addPetModal.add-pet-modal--edit .pet-avatar-btn-upload:active {
            background: #9fd9c8;
        }

        #addPetModal.add-pet-modal--edit .pet-avatar-btn-remove {
            background: #ffe8e0;
            color: #9a3d2e;
            border: 1px solid rgba(255, 122, 89, 0.28);
            box-shadow: 0 4px 12px rgba(255, 122, 89, 0.12);
        }

        #addPetModal.add-pet-modal--edit .pet-avatar-btn-remove:active {
            background: #ffd4c8;
        }

        .form-optional {
            font-weight: 400;
            color: var(--text-muted, #8a8a9a);
            font-size: 0.92em;
        }

        .pet-avatar-upload-hint {
            margin: 0;
            font-size: var(--lapi-fs-12);
            color: var(--lapi-text-muted, #8a7568);
            line-height: 1.4;
        }

        .profile-pet-name-btn .pet-avatar--md,
        .profile-pet-name-btn .pet-avatar--emoji {
            margin-right: 4px;
            vertical-align: middle;
        }

        .home-today-meta .pet-avatar--xs,
        .home-today-meta .pet-avatar--emoji.pet-avatar--xs {
            flex-shrink: 0;
            margin-right: 2px;
        }

        .emergency-clinic-map-btn {
            margin-top: 6px;
            padding: 8px 12px;
            font-size: var(--lapi-fs-13);
        }

        .lapi-chat-pet-label .pet-avatar--xs,
        .lapi-chat-pet-label .pet-avatar--emoji.pet-avatar--xs {
            vertical-align: -4px;
            margin-right: 4px;
        }

        .digitize-pet-option-icon .pet-avatar--md,
        .digitize-pet-option-icon .pet-avatar--emoji.pet-avatar--md {
            vertical-align: middle;
        }

        #petsList {
            flex-shrink: 0;
            transition: opacity 0.25s ease;
        }

        #petsList.switching {
            opacity: 0.55;
        }

        #carePlanSection {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            transition: opacity 0.25s ease;
        }

        #carePlanSection.switching {
            opacity: 0.55;
        }

        .pet-card {
            position: relative;
            background: #FAFAFA;
            border-radius: 12px;
            padding: 8px 76px 10px 10px;
            margin-bottom: 10px;
            text-align: left;
            border: 2px solid transparent;
        }

        .pet-card-header {
            margin-bottom: 2px;
            padding-right: 30px;
        }

        .pet-card-name-row {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            max-width: 100%;
        }

        .pet-card-name {
            flex: 0 1 auto;
            min-width: 0;
            font-size: var(--lapi-fs-17);
            font-weight: 700;
            margin: 0;
            color: #333;
            line-height: 1.25;
        }

        .pet-card-type-icon {
            flex-shrink: 0;
            font-size: var(--lapi-fs-20);
            line-height: 1;
            display: inline-flex;
            align-items: center;
        }

        .pet-card-age {
            font-size: var(--lapi-fs-12);
            color: #777;
            margin: 0 0 8px;
            line-height: 1.3;
        }

        .pet-card-actions-top {
            position: absolute;
            top: 10px;
            right: 10px;
            display: flex;
            gap: 6px;
            align-items: center;
            z-index: 2;
        }
        .pet-card-sos {
            border: none;
            background: #ff6b4a;
            color: #fff;
            font-weight: 800;
            font-size: var(--lapi-fs-12);
            letter-spacing: 0.04em;
            border-radius: 10px;
            padding: 6px 10px;
            cursor: pointer;
            box-shadow: 0 2px 8px rgba(255, 107, 74, 0.35);
        }
        .pet-card-sos:hover { filter: brightness(1.05); }
        .pet-sos-bubble {
            display: none;
            margin-top: 10px;
            padding: 12px;
            border-radius: 14px;
            background: linear-gradient(180deg, #fff8f4 0%, #ffece4 100%);
            border: 1px solid rgba(255, 107, 74, 0.25);
        }
        .pet-sos-bubble.visible { display: block; }
        .health-manual-row--with-save {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 6px;
            margin-bottom: 10px;
        }
        .health-manual-row--with-save .form-label {
            margin: 0;
            width: 100%;
        }
        .health-manual-input-row {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: flex-end;
            gap: 8px;
            width: 100%;
        }
        .health-manual-input-row .form-input {
            flex: 1 1 auto;
            min-width: 0;
            width: 100%;
            max-width: 100%;
        }
        .health-manual-row--note .health-manual-input-row {
            align-items: flex-start;
        }
        .health-manual-row--note textarea.form-input {
            min-height: 64px;
            resize: vertical;
        }
        .health-manual-archive-item {
            opacity: 1 !important;
            background: var(--lapi-cream-deep) !important;
            cursor: default;
            pointer-events: auto;
        }
        #healthManualArchivePanel .health-manual-archive-item,
        #healthManualArchivePanel .health-manual-archive-item * {
            text-decoration: none !important;
            -webkit-text-decoration: none !important;
        }
        .reminder-card.health-manual-archive-item .reminder-title,
        .task-card.health-manual-archive-item .reminder-title,
        #healthManualArchivePanel .health-manual-archive-item .reminder-title {
            text-decoration: none !important;
            color: #2d2d2d !important;
        }
        .reminder-card.health-manual-archive-item .reminder-date-badge,
        .task-card.health-manual-archive-item .reminder-date-badge,
        #healthManualArchivePanel .health-manual-archive-item .reminder-date-badge {
            text-decoration: none !important;
            color: #666 !important;
        }
        .health-save-check {
            width: 40px;
            height: 40px;
            border: none;
            border-radius: 12px;
            background: #3cb878;
            color: #fff;
            font-size: var(--lapi-fs-22);
            font-weight: 800;
            line-height: 1;
            cursor: pointer;
            box-shadow: 0 2px 8px rgba(60, 184, 120, 0.35);
        }
        .health-save-check:hover { filter: brightness(1.06); }
        .archive-trends-chart-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 8px;
        }
        .archive-trends-chart-head h5 { margin: 0; }
        .health-weight-range {
            max-width: 110px;
            padding: 4px 8px;
            font-size: var(--lapi-fs-12);
        }
        .btn-health-export-pdf { width: 100%; }
        .form-input::placeholder,
        textarea.form-input::placeholder,
        .lapi-chat-input::placeholder,
        .web-auth-field input::placeholder {
            color: rgba(60, 42, 33, 0.38);
            opacity: 1;
        }
        .pet-sos-overlay.digitize-phone-modal { cursor: pointer; }
        .pet-sos-shell { cursor: default; max-height: min(85vh, 640px); }
        .pet-sos-shell .emergency-panel { padding: 4px 0; }

        .sos-clinics-header {
            justify-content: space-between;
        }

        .sos-clinics-header .lapi-overlay-title {
            flex: 1;
            margin: 0;
            font-size: var(--lapi-fs-18);
        }

        .sos-clinics-close {
            flex-shrink: 0;
            width: 40px;
            height: 40px;
            border: none;
            border-radius: 12px;
            background: var(--lapi-cream-deep);
            color: var(--lapi-chocolate);
            font-size: var(--lapi-fs-20);
            line-height: 1;
            cursor: pointer;
        }

        .sos-clinics-map-btn {
            width: 100%;
            margin-bottom: 4px;
        }

        .emergency-clinic-item a.emergency-clinic-phone {
            display: inline-block;
            margin-top: 6px;
            font-size: var(--lapi-fs-16);
            font-weight: 700;
            color: var(--lapi-chocolate);
            text-decoration: none;
        }

        .emergency-clinic-item a.emergency-clinic-phone:active {
            opacity: 0.85;
        }
        .health-card-view-overlay--tap-close {
            align-items: center;
            justify-content: center;
            padding: 16px;
            background: rgba(60, 42, 33, 0.55);
            cursor: pointer;
        }
        .health-card-view-overlay--tap-close .health-card-view-sheet {
            cursor: default;
            position: relative;
            max-width: min(96vw, 400px);
            max-height: min(92vh, 920px);
            padding-top: 52px;
            overflow-x: hidden;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 12px;
        }
        .health-card-pdf-bar {
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding: 12px 14px 14px;
            border-radius: 16px;
            background: #fff;
            box-shadow: 0 8px 28px rgba(60, 42, 33, 0.12);
        }
        .health-card-pdf-bar[hidden] {
            display: none !important;
        }
        .health-card-pdf-bar--loading .health-card-pdf-actions,
        .health-card-pdf-bar--loading .health-card-export-format {
            display: none;
        }
        .health-card-export-format {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }
        .health-card-export-format[hidden] {
            display: none !important;
        }
        .health-card-export-format-btn {
            box-sizing: border-box;
            width: 100%;
            height: 74px;
            min-height: 74px;
            max-height: 74px;
            border-radius: 18px;
            border: 1px solid rgba(60, 42, 33, 0.12);
            background: #f0f0f0;
            color: #333;
            cursor: pointer;
            padding: 10px 8px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            font-family: inherit;
            text-align: center;
            box-shadow: 0 3px 14px rgba(60, 42, 33, 0.06);
        }

        .health-card-export-format-btn.btn-lapi-gradient {
            border: none;
        }

        .health-card-export-format-btn.active:not(.btn-lapi-gradient) {
            background: #e8ece8;
            border-color: rgba(60, 42, 33, 0.18);
        }

        .health-card-export-format-title {
            font-size: var(--lapi-fs-16);
            font-weight: 800;
            line-height: 1.15;
        }

        .health-card-export-format-subtitle {
            font-size: var(--lapi-fs-12);
            font-weight: 400;
            color: #6b5348;
            line-height: 1.2;
        }

        .health-card-export-format-btn.btn-lapi-gradient .health-card-export-format-subtitle {
            color: #5a4a42;
        }
        .health-card-export-back {
            display: block;
            width: 100%;
            margin-top: 4px;
            padding: 0;
            border: none;
            background: none;
            color: #6b5348;
            font-size: var(--lapi-fs-13);
            font-family: inherit;
            text-decoration: underline;
            cursor: pointer;
        }
        .health-card-pdf-bar-hint {
            margin: 0;
            font-size: var(--lapi-fs-13);
            line-height: 1.4;
            color: #6b5348;
            text-align: center;
        }
        .health-card-pdf-actions {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .health-card-pdf-btn {
            display: block;
            width: 100%;
            text-align: center;
            text-decoration: none;
            box-sizing: border-box;
        }
        a.health-card-pdf-btn--open.btn-secondary {
            color: var(--lapi-chocolate-soft, #5a4a42);
        }
        a.health-card-pdf-btn--open.btn-primary {
            color: #fff;
        }
        .health-card-view-close {
            position: absolute;
            top: 8px;
            left: 8px;
            z-index: 4;
            width: 44px;
            height: 44px;
            border: none;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.95);
            color: #5a4a42;
            font-size: var(--lapi-fs-28);
            line-height: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            box-shadow: 0 4px 14px rgba(60, 42, 33, 0.2);
        }
        .health-card-view-close:active {
            transform: scale(0.94);
        }
        .health-card-view-footer {
            flex-shrink: 0;
        }
        .health-card-view-back {
            width: 100%;
            margin: 0;
        }
        .med-card-edit-row { margin-bottom: 10px; }
        .med-card-constants-display { font-size: var(--lapi-fs-13); color: var(--lapi-text-muted, #8a7568); margin-top: 4px; }

        .pet-card-actions-top .pet-card-remove {
            position: static;
            top: auto;
            right: auto;
            bottom: auto;
            width: 28px;
            height: 28px;
            border: none;
            border-radius: 10px;
            background: rgba(0, 0, 0, 0.04);
            color: #999;
            font-size: var(--lapi-fs-16);
            line-height: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
        }

        .pet-card-remove:hover {
            background: rgba(0, 0, 0, 0.08);
            color: #666;
        }

        .pet-card-remove:active {
            transform: scale(0.94);
        }

        .care-mode-tabs {
            display: flex;
            gap: 8px;
            margin-top: 10px;
            margin-left: -10px;
            margin-right: -76px;
            width: calc(100% + 86px);
            align-items: stretch;
        }

        .care-mode-tab {
            position: relative;
            z-index: 0;
            overflow: hidden;
            isolation: isolate;
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            min-height: 44px;
            border: none;
            border-radius: 12px;
            padding: 10px 8px;
            background-color: #f3f3f3;
            color: #777;
            font-size: var(--lapi-fs-12);
            font-weight: 700;
            font-family: inherit;
            line-height: 1.25;
            cursor: pointer;
            transition: transform 0.15s ease, color 0.2s ease;
        }

        .care-mode-tab::before {
            content: '';
            position: absolute;
            inset: 0;
            z-index: -1;
            border-radius: inherit;
            opacity: 0;
            background: linear-gradient(90deg, #b8e8d8 0%, #d4f5ea 16%, #ffe8dc 32%, #ffd9ce 48%, #fff0e8 56%, #ffd9ce 64%, #ffe8dc 78%, #d4f5ea 90%, #b8e8d8 100%);
            background-size: 240% 100%;
        }

        .care-mode-tab.active {
            color: #3c2a21;
            background-color: #b5e8d8;
            box-shadow: 0 6px 14px rgba(181, 232, 216, 0.45);
        }

        .care-mode-tab.active::before {
            opacity: 1;
            animation: onboardingBtnShimmerBg 5.5s ease-in-out infinite;
        }

        .care-plan-title {
            font-size: var(--lapi-fs-18);
            font-weight: 700;
            color: #333;
            margin: 0 0 12px;
            text-align: left;
            flex-shrink: 0;
        }

        .care-panel-hidden {
            display: none !important;
        }

        .care-panel-viewport {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .care-action-hidden {
            display: none !important;
        }

        .archive-upload-strip {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            margin: 0 0 14px;
            padding: 12px 14px;
            border: 2px dashed rgba(26, 188, 156, 0.35);
            border-radius: 14px;
            background: #fff;
            cursor: pointer;
            font-family: inherit;
            text-align: left;
            transition: border-color 0.2s ease, background 0.2s ease;
        }

        .archive-upload-strip:hover {
            border-color: rgba(26, 188, 156, 0.55);
            background: #f8fffc;
        }

        .archive-upload-icon {
            font-size: var(--lapi-fs-22);
            line-height: 1;
            transform: rotate(-45deg);
        }

        .archive-upload-text {
            font-size: var(--lapi-fs-14);
            font-weight: 700;
            color: var(--lapi-chocolate);
        }

        .health-manual-panel {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin: 0 0 14px;
            padding: 12px 14px;
            border-radius: 14px;
            background: #fff;
            border: 1px solid #e8e2db;
        }

        .health-manual-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }

        .health-manual-row .form-input {
            flex: 1 1 100px;
            min-width: 0;
        }

        .health-timeline-list {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .health-timeline-item {
            padding: 8px 10px;
            border-radius: 10px;
            background: var(--lapi-cream-deep);
            font-size: var(--lapi-fs-13);
            line-height: 1.4;
            color: var(--lapi-chocolate-soft);
        }

        .health-timeline-item time {
            display: block;
            font-size: var(--lapi-fs-11);
            font-weight: 700;
            color: var(--lapi-text-muted);
            margin-bottom: 4px;
        }

        .health-score-card {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 12px;
            padding: 14px 16px;
            border-radius: 16px;
            background: linear-gradient(135deg, #fff8f0 0%, #f3e8ff 100%);
            border: 1px solid rgba(139, 92, 246, 0.15);
        }

        .health-score-bar-wrap {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .health-score-bar-labels {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 2px;
        }

        .health-score-bar-end {
            font-size: var(--lapi-fs-10);
            font-weight: 600;
            color: rgba(90, 72, 64, 0.45);
            line-height: 1;
        }

        .health-score-bar-track {
            position: relative;
            height: 14px;
            border-radius: 999px;
            background: linear-gradient(90deg, #f8d4c8 0%, #e8f5e0 55%, #c8ead8 100%);
            box-shadow: inset 0 1px 2px rgba(60, 42, 33, 0.08);
        }

        .health-score-bar-marker {
            position: absolute;
            top: 50%;
            transform: translate(-50%, -50%);
            z-index: 2;
            display: flex;
            flex-direction: column;
            align-items: center;
            pointer-events: none;
        }

        .health-score-bar-dot {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #fff;
            border: 3px solid var(--lapi-chocolate);
            box-shadow: 0 2px 6px rgba(60, 42, 33, 0.2);
        }

        .health-score-bar-value {
            margin-bottom: 6px;
            font-size: var(--lapi-fs-18);
            font-weight: 800;
            color: var(--lapi-chocolate);
            line-height: 1;
        }

        .health-score-influence {
            margin: 0;
            font-size: var(--lapi-fs-12);
            line-height: 1.5;
            color: var(--lapi-text-muted);
        }

        .health-score-influence strong {
            color: var(--lapi-chocolate);
            font-weight: 700;
        }

        .ai-memory-banner {
            padding: 12px 14px;
            border-radius: 12px;
            background: #ecfdf5;
            border: 1px solid #a7f3d0;
            font-size: var(--lapi-fs-13);
            line-height: 1.45;
            display: flex;
            gap: 10px;
            align-items: flex-start;
            justify-content: space-between;
        }

        .ai-memory-banner + .ai-memory-banner {
            margin-top: 8px;
        }

        .emergency-panel {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .btn-sos {
            width: 100%;
            padding: 14px;
            border: none;
            border-radius: 14px;
            font-size: var(--lapi-fs-16);
            font-weight: 800;
            color: #fff;
            background: linear-gradient(135deg, #dc2626, #b91c1c);
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
        }

        .emergency-clinic-item {
            padding: 10px 12px;
            border-radius: 10px;
            background: var(--lapi-cream-deep);
            font-size: var(--lapi-fs-13);
            margin-bottom: 8px;
        }

        .emergency-clinic-item:last-child {
            margin-bottom: 0;
        }

        .emergency-clinic-item strong {
            display: block;
            margin-bottom: 4px;
        }

        .emergency-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .timeline-type-badge {
            display: inline-block;
            font-size: var(--lapi-fs-10);
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: var(--lapi-violet);
            margin-bottom: 4px;
        }

        .health-card-view-overlay .lapi-overlay-body {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            padding: 16px;
        }

        .health-card-view-canvas {
            display: block;
            width: 100%;
            max-width: 360px;
            height: auto;
            margin: 0 auto;
            border-radius: 16px;
            box-shadow: 0 12px 32px rgba(60, 42, 33, 0.15);
        }

        .btn-upload-archive {
            margin-top: 0;
            width: 100%;
            border: none;
            border-radius: 10px;
            padding: 8px 10px;
            background: #FFDFD3;
            color: #333;
            font-size: var(--lapi-fs-13);
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            text-align: left;
            transition: background-color 0.2s ease, transform 0.15s ease;
        }

        .btn-upload-archive:hover {
            background: #f5cfc4;
        }

        .btn-upload-archive:active {
            transform: scale(0.98);
        }

        .archive-group-title {
            font-size: var(--lapi-fs-12);
            font-weight: 700;
            color: #888;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin: 16px 0 8px;
        }

        .archive-doc-card {
            display: flex;
            align-items: center;
            gap: 12px;
            background: #FAFAFA;
            border-radius: 14px;
            padding: 12px;
            margin-bottom: 8px;
            text-align: left;
            cursor: pointer;
            transition: background-color 0.2s ease, transform 0.15s ease;
        }

        .archive-doc-card:hover {
            background: #f3f3f3;
        }

        .archive-doc-card:active {
            transform: scale(0.99);
        }

        .archive-doc-preview {
            flex-shrink: 0;
            width: 40px;
            height: 40px;
            border-radius: 10px;
            background: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: var(--lapi-fs-20);
        }

        .archive-doc-info {
            flex: 1;
            min-width: 0;
        }

        .archive-doc-name {
            font-size: var(--lapi-fs-13);
            font-weight: 600;
            color: #333;
            margin: 0 0 4px;
            word-break: break-word;
        }

        .archive-doc-meta {
            font-size: var(--lapi-fs-11);
            color: #888;
            margin: 0;
        }

        .archive-doc-tag {
            display: inline-block;
            margin-top: 4px;
            padding: 3px 8px;
            border-radius: 8px;
            background: #E2F0D9;
            color: #444;
            font-size: var(--lapi-fs-10);
            font-weight: 700;
        }

        .archive-panel-body {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .archive-panel-body .medical-archive-list {
            flex: 1 1 auto;
            min-height: 0;
            max-height: none;
        }

        .archive-section-hidden {
            display: none !important;
        }

        .archive-trends-section {
            flex-shrink: 0;
            margin-top: 8px;
            padding-top: 12px;
            border-top: 1px solid #eee;
        }

        .archive-trends-title {
            font-size: var(--lapi-fs-14);
            font-weight: 700;
            color: #333;
            margin: 0 0 10px;
            text-align: left;
        }

        .archive-trends-toggle {
            width: 100%;
            border: none;
            border-radius: 10px;
            padding: 8px 10px;
            margin-bottom: 10px;
            background: #f3f3f3;
            color: #666;
            font-size: var(--lapi-fs-12);
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            text-align: left;
        }

        .archive-trends-tables,
        .archive-trends-charts {
            min-height: 0;
        }

        .archive-trends-placeholder {
            font-size: var(--lapi-fs-12);
            color: #999;
            margin: 0 0 10px;
            text-align: left;
            line-height: 1.45;
        }

        .archive-trends-table-wrap {
            background: #fafafa;
            border-radius: 12px;
            padding: 10px;
            margin-bottom: 8px;
        }

        .archive-trends-table-wrap h5 {
            margin: 0 0 6px;
            font-size: var(--lapi-fs-11);
            font-weight: 700;
            color: #888;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .archive-trends-table-wrap p {
            margin: 0;
            font-size: var(--lapi-fs-12);
            color: #aaa;
        }

        .archive-trends-chart-box {
            background: #fafafa;
            border-radius: 12px;
            padding: 10px;
            margin-bottom: 8px;
        }

        .archive-trends-chart-box h5 {
            margin: 0 0 8px;
            font-size: var(--lapi-fs-11);
            font-weight: 700;
            color: #888;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .archive-trends-chart-box canvas {
            display: block;
            width: 100%;
            height: 120px;
        }

        .archive-doc-menu-sheet {
            padding-bottom: 20px;
        }

        .archive-menu-preview {
            width: 100%;
            max-height: 140px;
            border-radius: 14px;
            background: #f5f5f5;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            margin-bottom: 12px;
        }

        .archive-menu-preview img {
            width: 100%;
            max-height: 140px;
            object-fit: contain;
            display: block;
        }

        .archive-menu-preview-icon {
            font-size: 48px;
            line-height: 1;
        }

        .archive-menu-file-name {
            font-size: var(--lapi-fs-13);
            font-weight: 600;
            color: #333;
            margin: 0 0 4px;
            word-break: break-word;
            text-align: left;
        }

        .archive-menu-file-meta {
            font-size: var(--lapi-fs-11);
            color: #888;
            margin: 0 0 14px;
            text-align: left;
        }

        .archive-menu-actions {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-bottom: 12px;
        }

        .archive-menu-btn {
            width: 100%;
            border: none;
            border-radius: 12px;
            padding: 12px 14px;
            background: #fafafa;
            color: #333;
            font-size: var(--lapi-fs-14);
            font-weight: 600;
            font-family: inherit;
            text-align: left;
            cursor: pointer;
            transition: background-color 0.2s ease, transform 0.15s ease;
        }

        .archive-menu-btn:hover {
            background: #f0f0f0;
        }

        .archive-menu-btn:active {
            transform: scale(0.99);
        }

        .archive-menu-btn--primary {
            background: #E2F0D9;
        }

        .archive-menu-btn--primary:hover {
            background: #d2e4c8;
        }

        .archive-menu-btn--danger {
            background: #fff3f0;
            color: #b45309;
        }

        .archive-menu-btn--danger:hover {
            background: #ffe8e0;
        }

        #deleteArchiveDocModal {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 115;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(0, 0, 0, 0.35);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
        }

        #deleteArchiveDocModal.visible {
            display: flex;
        }

        .reminder-delete-btn {
            position: absolute;
            top: 8px;
            right: 8px;
            z-index: 3;
            width: 24px;
            height: 24px;
            border: none;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.9);
            color: #aaa;
            font-size: var(--lapi-fs-12);
            line-height: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
        }

        .reminder-delete-btn:hover {
            color: #666;
            background: #fff;
        }

        .reminder-urgent-badge {
            display: block;
            margin-top: 6px;
            font-size: var(--lapi-fs-11);
            font-weight: 700;
            color: #b45309;
        }

        .reminder-repeat-badge {
            display: block;
            margin-top: 4px;
            font-size: var(--lapi-fs-11);
            font-weight: 600;
            color: #5b7a72;
        }

        .reminder-card.has-delete-btn {
            padding-top: 28px;
        }

        .care-plan-list,
        .medical-archive-list {
            flex: 1 1 auto;
            min-height: 0;
            max-height: calc(100dvh - var(--pets-scroll-chrome, 320px));
            max-height: calc(100vh - var(--pets-scroll-chrome, 320px));
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
            will-change: transform;
            padding-bottom: 8px;
            overscroll-behavior: contain;
        }

        body.lapi-web-app #subScreenPets.active .pets-scroll-body .care-plan-list,
        body.lapi-web-app #subScreenPets.active .pets-scroll-body .medical-archive-list,
        #subScreenPets.active .pets-scroll-body .care-plan-list,
        #subScreenPets.active .pets-scroll-body .medical-archive-list {
            flex: none;
            max-height: none !important;
            overflow: visible !important;
            overscroll-behavior: auto;
        }

        body.lapi-web-app .screens {
            overflow: hidden !important;
        }

        body.lapi-web-app .main-app--with-nav {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .reminder-date-set-btn {
            flex-shrink: 0;
            border: none;
            background: transparent;
            font-size: var(--lapi-fs-12);
            font-weight: 600;
            color: #aaa;
            white-space: nowrap;
            cursor: pointer;
            padding: 4px 0;
            font-family: inherit;
            transition: color 0.2s ease;
        }

        .reminder-date-set-btn:hover {
            color: #777;
        }

        .reminder-date-set-btn:active {
            color: #666;
        }

        .btn-add-task {
            margin-top: 0;
            width: 100%;
            border: none;
            border-radius: 10px;
            padding: 8px 10px;
            background: #E2F0D9;
            color: #333;
            font-size: var(--lapi-fs-13);
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            text-align: left;
            transition: background-color 0.2s ease, transform 0.15s ease;
        }

        .btn-add-task:hover {
            background: #d2e4c8;
        }

        .btn-add-task:active {
            transform: scale(0.98);
        }

        .task-suggestions {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin: 12px 0;
        }

        .task-suggestion-chip {
            border: none;
            border-radius: 14px;
            padding: 8px 10px;
            background: #FAFAFA;
            color: #444;
            font-size: var(--lapi-fs-12);
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            white-space: nowrap;
            transition: background-color 0.2s ease, transform 0.15s ease;
        }

        .task-suggestion-chip:hover {
            background: #FFDFD3;
        }

        .task-suggestion-chip:active {
            transform: scale(0.97);
        }

        .reminder-card-row {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 10px;
            width: 100%;
        }

        .reminder-swipe-wrap[data-future-locked="true"] {
            pointer-events: none;
        }

        .reminder-card.future-locked {
            cursor: default;
            opacity: 0.88;
        }

        .reminder-card.planned,
        .task-card.planned {
            background: #fff;
            opacity: 1;
        }

        .reminder-card.planned::before,
        .task-card.planned::before {
            background: #9ec98a;
        }

        .reminder-card.overdue-debt,
        .task-card.overdue-debt {
            background: #fff;
        }

        .reminder-card.overdue-debt::before,
        .task-card.overdue-debt::before {
            background: #e85d4c;
        }

        .reminder-card.overdue-debt .reminder-urgent-badge {
            color: #c2410c;
        }

        .reminder-content {
            flex: 1;
            min-width: 0;
        }

        .reminder-date-badge {
            flex-shrink: 0;
            font-size: var(--lapi-fs-12);
            font-weight: 600;
            color: #666;
            background: #fff;
            border-radius: 10px;
            padding: 6px 10px;
            white-space: nowrap;
        }

        .btn-medical-baseline {
            flex-shrink: 0;
            border: none;
            border-radius: 10px;
            padding: 8px 10px;
            background: #fff0e8;
            color: #b45309;
            font-size: var(--lapi-fs-11);
            font-weight: 700;
            font-family: inherit;
            line-height: 1.25;
            text-align: left;
            cursor: pointer;
            max-width: 58%;
            transition: background-color 0.2s ease, transform 0.15s ease;
        }

        .btn-medical-baseline:hover {
            background: #ffe4d6;
        }

        .btn-medical-baseline:active {
            transform: scale(0.98);
        }

        .reminder-card.medical-pending {
            cursor: default;
        }

        .reminder-card.medical-pending .reminder-swipe-wrap,
        .reminder-swipe-wrap[data-medical-pending="true"] .reminder-card {
            pointer-events: auto;
        }

        .empty-state {
            text-align: center;
            padding: 32px 16px;
            color: #888;
            font-size: var(--lapi-fs-14);
        }

        .calendar-section-title {
            font-size: var(--lapi-fs-13);
            font-weight: 700;
            color: #888;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin: 16px 0 10px;
            text-align: left;
        }

        .calendar-section-title.critical-title {
            color: #b45309;
        }

        .days-strip {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            padding-bottom: 8px;
            margin-bottom: 12px;
        }

        .day-chip {
            flex-shrink: 0;
            min-width: 52px;
            padding: 10px 8px;
            border-radius: 14px;
            background: #FAFAFA;
            border: 2px solid transparent;
            text-align: center;
            font-size: var(--lapi-fs-12);
            cursor: pointer;
        }

        .day-chip.today {
            border-color: #E2F0D9;
            background: #E2F0D9;
        }

        .reminder-swipe-wrap {
            position: relative;
            margin-bottom: 10px;
            border-radius: 16px;
            overflow: hidden;
        }

        .reminder-swipe-reveal {
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 0;
            max-width: 100%;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 8px;
            padding-left: 18px;
            box-sizing: border-box;
            background: linear-gradient(90deg, #c8dbb8, #E2F0D9);
            border-radius: 16px;
            font-size: var(--lapi-fs-22);
            font-weight: 700;
            color: #3d5c32;
            opacity: 0;
            will-change: opacity, width;
            transform: none;
            transition: opacity 0.2s ease, width 0.08s linear;
            pointer-events: none;
            overflow: hidden;
        }

        .reminder-swipe-reveal.visible {
            opacity: 1;
        }

        .reminder-card,
        .task-card {
            position: relative;
            z-index: 1;
            background: #FAFAFA;
            border-radius: 16px;
            padding: 14px 16px 14px 18px;
            text-align: left;
            will-change: transform, opacity;
            transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
            transform: translate3d(0, 0, 0);
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            touch-action: pan-y;
            cursor: pointer;
            user-select: none;
            -webkit-user-select: none;
        }

        .reminder-card.swiping,
        .task-card.swiping {
            transition: none;
            will-change: transform, opacity;
        }

        .reminder-card.snap-back,
        .task-card.snap-back {
            transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
        }

        .reminder-card.fly-out,
        .task-card.fly-out {
            transition: transform 0.38s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.38s ease;
        }

        .reminder-card.fly-out-active,
        .task-card.fly-out-active {
            transform: translate3d(100%, 0, 0);
            opacity: 0;
        }

        .reminder-swipe-wrap.reminder-deleting {
            overflow: hidden;
            transition: max-height 0.32s ease, margin 0.32s ease, opacity 0.32s ease;
        }

        .reminder-card.settle-completed,
        .task-card.settle-completed {
            transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.35s ease;
        }

        .care-archive-toggle {
            width: 100%;
            margin: 4px 0 10px;
            padding: 10px 12px;
            border: none;
            border-radius: 12px;
            background: #f3f3f3;
            color: #888;
            font-size: var(--lapi-fs-12);
            font-weight: 600;
            font-family: inherit;
            text-align: left;
            cursor: pointer;
            transition: background-color 0.2s ease, color 0.2s ease;
        }

        .care-archive-toggle:hover {
            background: #ececec;
            color: #666;
        }

        .care-archive-panel {
            display: none;
        }

        .care-archive-panel.expanded {
            display: block;
        }

        .reminder-card.archive-card,
        .task-card.archive-card {
            opacity: 0.65;
            background: #f5f5f5;
            cursor: pointer;
            pointer-events: auto;
            touch-action: manipulation;
            user-select: text;
            -webkit-user-select: text;
            margin-bottom: 10px;
        }

        .reminder-card.archive-card .reminder-title,
        .task-card.archive-card .reminder-title {
            text-decoration: line-through;
            color: #777;
        }

        .reminder-card.archive-card.critical::before,
        .task-card.archive-card.critical::before,
        .reminder-card.archive-card.today::before,
        .task-card.archive-card.today::before,
        .reminder-card.archive-card.routine::before,
        .task-card.archive-card.routine::before {
            background: #d4d4d4;
        }

        .reminder-card.archive-card .reminder-date-badge {
            color: #aaa;
            background: #fafafa;
        }

        .reminder-card.critical,
        .task-card.critical,
        .home-today-card.critical,
        .reminder-card.today,
        .task-card.today,
        .home-today-card.today {
            background: #fff;
            border-left: none;
            overflow: hidden;
        }

        .reminder-card.routine,
        .task-card.routine,
        .home-today-card.routine {
            background: #fff;
            border-left: none;
            overflow: hidden;
        }

        .reminder-card.critical::before,
        .task-card.critical::before,
        .reminder-card.today::before,
        .task-card.today::before,
        .reminder-card.routine::before,
        .task-card.routine::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 6px;
            border-radius: 0 6px 6px 0;
        }

        .reminder-card.critical::before,
        .task-card.critical::before {
            background: #e8a090;
        }

        .reminder-card.today::before,
        .task-card.today::before,
        .home-today-card.today::before {
            background: #e8c547;
        }

        .reminder-card.routine::before,
        .task-card.routine::before {
            background: #9ec98a;
        }

        .reminder-title {
            font-size: var(--lapi-fs-14);
            font-weight: 600;
            margin: 0;
            color: #333;
        }

        .modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.4);
            z-index: 100;
            align-items: flex-end;
            justify-content: center;
        }

        .modal-overlay.visible {
            display: flex;
        }

        #customTaskChipModal.modal-overlay {
            z-index: 130;
        }

        .modal-sheet {
            background: #fff;
            width: 100%;
            max-width: 390px;
            border-radius: 24px 24px 0 0;
            padding: 24px;
            max-height: 90vh;
            overflow-y: auto;
        }

        .modal-title {
            font-size: var(--lapi-fs-20);
            font-weight: 700;
            margin: 0 0 20px;
            text-align: left;
        }

        .btn-secondary {
            background: #f0f0f0;
            color: #333;
            border: none;
            padding: 14px;
            width: 100%;
            border-radius: 16px;
            font-size: var(--lapi-fs-15);
            font-weight: 600;
            cursor: pointer;
            margin-top: 8px;
        }

        #deletePetModal {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 110;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(0, 0, 0, 0.35);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
        }

        #deletePetModal.visible,
        #deleteReminderModal.visible {
            display: flex;
        }

        #deleteReminderModal {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 110;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(0, 0, 0, 0.35);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
        }

        #completeTaskModal.modal-overlay {
            z-index: 110;
        }

        .delete-pet-dialog {
            background: #fff;
            width: 100%;
            max-width: 340px;
            border-radius: 20px;
            padding: 24px;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
        }

        .delete-pet-title {
            font-size: var(--lapi-fs-20);
            font-weight: 700;
            color: #333;
            margin: 0 0 12px;
            text-align: left;
            line-height: 1.3;
        }

        .delete-pet-desc {
            font-size: var(--lapi-fs-14);
            line-height: 1.55;
            color: #555;
            margin: 0 0 24px;
            text-align: left;
        }

        .delete-pet-actions {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .btn-delete-confirm {
            background: #f0f0f0;
            color: #888;
            border: none;
            padding: 14px;
            width: 100%;
            border-radius: 16px;
            font-size: var(--lapi-fs-15);
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            transition: background-color 0.2s ease, color 0.2s ease;
        }

        .btn-delete-confirm:hover {
            background: #e8e8e8;
            color: #666;
        }

        .delete-pet-actions .btn-primary {
            margin: 0;
        }

        #subScreenChat.active {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
            overflow: hidden;
        }

        .in-app-screen-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 16px 8px;
            flex-shrink: 0;
            background: var(--lapi-cream);
        }

        .in-app-screen-title {
            flex: 1;
            margin: 0;
            font-size: var(--lapi-fs-17);
            font-weight: 700;
            text-align: center;
        }

        .in-app-back-btn, .in-app-home-btn {
            border: none;
            background: rgba(60, 42, 33, 0.06);
            border-radius: 12px;
            width: 40px;
            height: 40px;
            font-size: var(--lapi-fs-18);
            cursor: pointer;
            font-family: inherit;
        }

        .in-app-home-btn--mascot {
            width: 48px;
            height: 48px;
            flex-shrink: 0;
            padding: 0;
            overflow: hidden;
            background: transparent;
            border: none;
            border-radius: 14px;
            box-shadow: none;
        }

        .in-app-home-mascot-slot {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            overflow: hidden;
            background: transparent;
        }

        .in-app-home-mascot-video {
            display: block;
            width: 100%;
            height: 100%;
            margin: 0;
            object-fit: contain;
            object-position: center;
            background: transparent;
            mix-blend-mode: multiply;
            pointer-events: none;
        }

        .in-app-home-mascot-video[data-load-error="1"] {
            display: none;
        }

        .in-app-home-mascot-fallback {
            display: none;
            font-size: var(--lapi-fs-26);
            line-height: 1;
        }

        .in-app-home-mascot-video[data-load-error="1"] + .in-app-home-mascot-fallback {
            display: block;
        }

        .in-app-screen-body {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding: 0 16px 24px;
        }

        .in-app-screen-body.lapi-chat-in-app {
            overflow: hidden;
            padding: 0 16px 6px;
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
        }

        .lapi-chat-in-app .lapi-chat-pet-label {
            flex-shrink: 0;
            margin: 0 0 8px;
        }

        .lapi-chat-panel {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .lapi-chat-messages-scroll {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding: 4px 0 10px;
        }

        .lapi-chat-messages {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .lapi-chat-bubble {
            max-width: 88%;
            padding: 10px 14px;
            border-radius: 18px;
            font-size: var(--lapi-fs-15);
            line-height: 1.45;
            word-break: break-word;
        }

        .lapi-chat-bubble--user {
            align-self: flex-end;
            margin-left: auto;
            background: #b5e8d8;
            color: var(--lapi-chocolate, #3c2a21);
            border-bottom-right-radius: 6px;
        }

        .lapi-chat-bubble--assistant {
            align-self: flex-start;
            margin-right: auto;
            background: #ffe8e0;
            color: var(--lapi-chocolate, #3c2a21);
            border: none;
            border-bottom-left-radius: 6px;
        }

        .lapi-chat-bubble-text p {
            margin: 0 0 0.55em;
            line-height: 1.45;
        }

        .lapi-chat-bubble-text p:last-child {
            margin-bottom: 0;
        }

        .lapi-chat-bubble--error {
            background: #ffe8e0;
            color: #9a3d2e;
            border-color: rgba(255, 122, 89, 0.35);
        }

        .lapi-chat-thinking {
            color: var(--lapi-chocolate-soft, #5c4a3d);
            font-style: italic;
        }

        .lapi-chat-composer {
            flex-shrink: 0;
            padding-top: 8px;
            border-top: 1px solid rgba(60, 42, 33, 0.07);
            background: var(--lapi-cream);
        }

        .lapi-chat-in-app .lapi-chat-composer .lapi-chat-input-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .lapi-chat-in-app .lapi-chat-composer .lapi-chat-input {
            flex: 1;
            min-width: 0;
        }

        .lapi-chat-attach-btn {
            flex-shrink: 0;
            width: 40px;
            height: 44px;
            border: 1px solid rgba(60, 42, 33, 0.12);
            border-radius: 16px;
            background: #fff;
            font-size: var(--lapi-fs-20);
            line-height: 1;
            cursor: pointer;
            font-family: inherit;
        }

        .lapi-chat-attach-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .lapi-chat-send-btn {
            flex-shrink: 0;
            width: 50px;
            height: 50px;
            border: 2px solid rgba(255, 255, 255, 0.72);
            border-radius: 18px;
            background:
                linear-gradient(165deg, rgba(255, 255, 255, 0.55) 0%, transparent 42%),
                linear-gradient(145deg, #b8e8d8 0%, #ffe8dc 46%, #ff9a7a 100%);
            color: #3c2a21;
            font-size: var(--lapi-fs-26);
            font-weight: 900;
            line-height: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow:
                inset 0 2px 0 rgba(255, 255, 255, 0.65),
                0 5px 0 rgba(60, 42, 33, 0.16),
                0 12px 24px rgba(255, 122, 89, 0.42);
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
            transform: translateY(-1px);
            font-family: inherit;
        }

        .lapi-chat-send-btn:disabled {
            opacity: 0.45;
            cursor: default;
            transform: none;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.35),
                0 2px 0 rgba(60, 42, 33, 0.1);
        }

        .lapi-chat-send-btn:active:not(:disabled) {
            transform: translateY(2px) scale(0.96);
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.4),
                0 2px 0 rgba(60, 42, 33, 0.14),
                0 6px 14px rgba(255, 122, 89, 0.28);
        }

        .lapi-chat-in-app .lapi-chat-input {
            flex: 1;
            min-width: 0;
            box-sizing: border-box;
        }

        .lapi-chat-bubble--attachment {
            font-size: var(--lapi-fs-14);
            font-weight: 600;
        }

        .lapi-chat-in-app .lapi-chat-input:disabled {
            opacity: 0.55;
            cursor: not-allowed;
        }

        .pet-picker-item.selected {
            border-color: #9ec98a;
            background: #f0f8eb;
        }

        .pet-picker-item .pet-avatar--md,
        .pet-picker-item .pet-avatar--emoji.pet-avatar--md {
            flex-shrink: 0;
        }

        .profile-pet-name-btn {
            flex: 1;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            border: none;
            background: none;
            padding: 0;
            text-align: left;
            font: inherit;
            color: inherit;
            cursor: pointer;
        }

        .profile-pet-actions {
            display: flex;
            gap: 6px;
            flex-shrink: 0;
        }

        .profile-icon-btn {
            border: none;
            background: rgba(60, 42, 33, 0.06);
            border-radius: 10px;
            width: 34px;
            height: 34px;
            font-size: var(--lapi-fs-16);
            cursor: pointer;
        }

        .profile-passport-grid--compact .passport-thumb {
            width: 52px;
            height: 52px;
        }

        .passport-thumb-btn {
            border: none;
            padding: 0;
            margin: 0;
            background: none;
            cursor: pointer;
            border-radius: 12px;
            line-height: 0;
        }

        .passport-thumb-btn:active {
            transform: scale(0.97);
        }

        #passportPreviewModal .passport-preview-image {
            display: block;
            width: 100%;
            max-height: min(58vh, 420px);
            object-fit: contain;
            border-radius: 14px;
            margin: 0 auto 14px;
            background: #f5f0ec;
        }

        #passportPreviewModal .passport-preview-actions {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .profile-passport-add-btn {
            margin-top: 8px;
            width: 100%;
        }

        .health-section { margin-bottom: 20px; }
        .health-section-title { margin: 0 0 6px; font-size: var(--lapi-fs-15); font-weight: 700; }
        .health-section-hint { margin: 0 0 10px; font-size: var(--lapi-fs-12); color: #8a7568; }
        .health-section--card { background: #fafafa; border-radius: 16px; padding: 14px; }
        .med-card-constants { display: grid; gap: 8px; margin-bottom: 14px; }
        .med-card-constant { font-size: var(--lapi-fs-13); line-height: 1.4; }
        .med-card-constant strong {
            display: block;
            font-size: var(--lapi-fs-11);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #8a7568;
            margin-bottom: 2px;
        }
        .med-card-charts canvas { width: 100%; height: 140px; display: block; }
        .archive-chat-card .archive-doc-tag { background: rgba(181, 232, 216, 0.5); }
        .pet-picker-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
        .pet-picker-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 14px;
            border: 2px solid transparent;
            border-radius: 16px;
            background: #fafafa;
            font-size: var(--lapi-fs-15);
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            text-align: left;
            width: 100%;
        }
        .pet-picker-item:hover { border-color: #c8dbb8; background: #f4faf0; }

        .btn-lapi-gradient {
            position: relative;
            z-index: 0;
            overflow: hidden;
            isolation: isolate;
            border: none;
            background-color: #b5e8d8;
            color: #3c2a21;
            font-weight: 800;
            box-shadow: 0 10px 22px rgba(181, 232, 216, 0.45);
        }

        .btn-lapi-gradient::before {
            content: '';
            position: absolute;
            inset: 0;
            z-index: -1;
            border-radius: inherit;
            background: linear-gradient(90deg, #b8e8d8 0%, #d4f5ea 16%, #ffe8dc 32%, #ffd9ce 48%, #fff0e8 56%, #ffd9ce 64%, #ffe8dc 78%, #d4f5ea 90%, #b8e8d8 100%);
            background-size: 240% 100%;
            animation: onboardingBtnShimmerBg 5.5s ease-in-out infinite;
        }

        .btn-cancel-subscription {
            background: #f0f0f0;
            color: #666;
        }

        .form-input--error {
            border-color: #e8a090;
            box-shadow: 0 0 0 2px rgba(232, 160, 144, 0.25);
        }

        .form-hint-lapi {
            margin: 8px 0 0;
            padding: 10px 12px;
            border-radius: 14px;
            background: linear-gradient(135deg, rgba(255, 232, 220, 0.9), rgba(212, 245, 234, 0.9));
            font-size: var(--lapi-fs-13);
            line-height: 1.4;
            color: #3c2a21;
        }

        .profile-email-otp-wrap.hidden {
            display: none;
        }

        .profile-email-otp-input {
            letter-spacing: 0.35em;
            text-align: center;
            font-size: var(--lapi-fs-20);
        }

        .profile-phone-hint.hidden {
            display: none;
        }
        .mascot-toast-video { width: 72px; height: 72px; object-fit: contain; border-radius: 12px; flex-shrink: 0; }
        .mascot-toast.has-video {
            flex-direction: column;
            align-items: center;
            text-align: center;
            padding: 16px 20px;
            max-width: 280px;
        }
        .mascot-toast.has-video .mascot-toast-emoji { display: none; }

        .form-error-lapi {
            background: rgba(255, 232, 224, 0.95);
            border-radius: 14px;
            padding: 10px 12px;
            font-size: var(--lapi-fs-14);
            line-height: 1.45;
            color: #8a4a3a;
            font-weight: 600;
        }

        .mascot-toast {
            position: fixed;
            top: 50%;
            left: 50%;
            max-width: 300px;
            width: calc(100% - 48px);
            max-height: min(88vh, 420px);
            overflow: hidden;
            overscroll-behavior: contain;
            background: #FFDFD3;
            color: #333;
            padding: 22px 20px;
            border-radius: 20px;
            text-align: center;
            z-index: 500;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
            will-change: transform, opacity;
            transform: translate(-50%, -50%);
            transition: opacity 0.3s ease;
        }

        html.lapi-toast-open,
        html.lapi-toast-open body {
            overflow: hidden;
        }

        .mascot-toast.visible {
            animation: toastPopIn 0.45s cubic-bezier(0.25, 1, 0.5, 1) forwards;
        }

        .mascot-toast.has-video .mascot-toast-video {
            max-height: 110px;
            width: auto;
            max-width: 100%;
            margin: 0 auto 10px;
        }

        .mascot-toast.hidden {
            opacity: 0;
            pointer-events: none;
            transform: translate(-50%, calc(-50% + 18px));
        }

        .mascot-toast.toast-error {
            background: #ffe8e0;
        }

        .mascot-toast-emoji {
            display: block;
            font-size: 44px;
            line-height: 1;
            margin-bottom: 12px;
            will-change: transform;
            animation: mascotBounce 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
        }

        .mascot-toast-text {
            margin: 0;
            font-size: var(--lapi-fs-15);
            font-weight: 600;
            line-height: 1.45;
        }

        @keyframes mascotBounce {
            0%, 100% {
                transform: translateY(0);
            }
            35% {
                transform: translateY(-14px);
            }
            55% {
                transform: translateY(-2px);
            }
            72% {
                transform: translateY(-8px);
            }
        }

        @keyframes toastPopIn {
            0% {
                opacity: 0;
                transform: translate(-50%, calc(-50% + 28px));
            }
            55% {
                opacity: 1;
                transform: translate(-50%, calc(-50% - 8px));
            }
            78% {
                transform: translate(-50%, calc(-50% + 3px));
            }
            100% {
                opacity: 1;
                transform: translate(-50%, -50%);
            }
        }

        /* Digitize, Lapi Chat, Profile (inlined — server does not serve /features.css) */
        .digitize-dropzone.hidden { display: none; }
        .lapi-overlay {
            position: fixed;
            inset: 0;
            z-index: 300;
            display: none;
            flex-direction: column;
            background: var(--lapi-cream, #fdf9f6);
            font-family: 'Nunito', sans-serif;
            color: var(--lapi-chocolate, #3c2a21);
        }
        .lapi-overlay.visible { display: flex; }

        .lapi-overlay.digitize-phone-modal {
            align-items: center;
            justify-content: center;
            padding: 12px;
            background: rgba(60, 42, 33, 0.42);
        }

        .lapi-overlay.digitize-phone-modal.visible {
            display: flex;
        }

        .digitize-phone-shell {
            width: 100%;
            max-width: 390px;
            max-height: min(780px, 94vh);
            border-radius: 28px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            background: var(--lapi-cream, #fdf9f6);
            box-shadow: 0 24px 60px rgba(60, 42, 33, 0.22);
        }

        .digitize-phone-shell .lapi-overlay-header {
            flex-shrink: 0;
        }

        .digitize-phone-shell .lapi-overlay-body {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
        }

        .digitize-pet-list--solo .digitize-pet-option {
            pointer-events: none;
        }
        .lapi-overlay-header {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px 16px 10px;
            background: var(--lapi-cream, #fdf9f6);
        }
        .lapi-overlay-back {
            border: none;
            background: transparent;
            font-size: var(--lapi-fs-22);
            line-height: 1;
            cursor: pointer;
            color: var(--lapi-chocolate-soft, #5c463a);
        }
        .lapi-overlay-title { margin: 0; font-size: var(--lapi-fs-18); font-weight: 700; }
        .lapi-overlay-body {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding: 12px 16px 24px;
        }
        .digitize-pet-list { display: flex; flex-direction: column; gap: 10px; }
        .digitize-pet-option {
            display: flex;
            align-items: center;
            gap: 12px;
            width: 100%;
            padding: 14px 16px;
            border: 2px solid transparent;
            border-radius: 20px;
            background: #fff;
            text-align: left;
            font-family: inherit;
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(60, 42, 33, 0.06);
        }
        .digitize-pet-option.selected {
            border-color: var(--lapi-coral, #ff7a59);
            background: rgba(255, 122, 89, 0.08);
        }
        .digitize-pet-option-icon { font-size: var(--lapi-fs-28); }
        .digitize-pet-option-name { font-size: var(--lapi-fs-16); font-weight: 700; }
        .digitize-dropzone {
            border: 2px dashed rgba(255, 122, 89, 0.45);
            border-radius: 24px;
            padding: 32px 20px;
            text-align: center;
            background: rgba(255, 255, 255, 0.65);
        }
        .digitize-dropzone.dragover {
            border-color: var(--lapi-coral, #ff7a59);
            background: rgba(255, 122, 89, 0.1);
        }
        .digitize-dropzone-title { margin: 0 0 8px; font-size: var(--lapi-fs-16); font-weight: 700; }
        .digitize-dropzone-hint {
            margin: 0 0 16px;
            font-size: var(--lapi-fs-14);
            color: var(--lapi-text-muted, #8a7568);
            line-height: 1.45;
        }
        .digitize-analyzing {
            display: none;
            flex-direction: column;
            align-items: center;
            text-align: center;
            padding: 24px 12px;
        }
        .digitize-analyzing.visible { display: flex; }
        .digitize-analyzing video {
            width: min(220px, 70vw);
            max-height: 200px;
            display: block !important;
            object-fit: contain;
            mix-blend-mode: multiply;
            background: transparent;
        }
        .digitize-analyzing video:not([src]),
        .digitize-analyzing video[data-load-error="1"] {
            display: none;
        }
        .digitize-analyzing-mascot-fallback {
            display: none;
            font-size: 72px;
            line-height: 1;
        }
        .digitize-analyzing video[data-load-error="1"] + .digitize-analyzing-mascot-fallback {
            display: block;
        }
        .digitize-analyzing-text { margin: 12px 0 0; font-size: var(--lapi-fs-16); font-weight: 600; }

        .lapi-media-upload-overlay {
            z-index: 350;
            background: rgba(0, 0, 0, 0.94);
            align-items: stretch;
            justify-content: stretch;
        }

        .lapi-media-upload-overlay.visible {
            display: flex;
        }

        .lapi-media-upload-panel {
            flex: 1;
            display: flex;
            flex-direction: column;
            width: 100%;
            max-width: 100%;
            background: #000;
            color: #fff;
        }

        .lapi-media-upload-top {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding: 10px 12px;
            padding-top: max(10px, env(safe-area-inset-top));
        }

        .lapi-media-upload-gallery-link {
            width: 100%;
            max-width: 320px;
            margin: 0;
            border-radius: 20px;
            padding: 14px 20px;
            font-family: inherit;
            font-size: var(--lapi-fs-16);
            text-align: center;
        }

        .lapi-media-upload-gallery-link::before {
            border-radius: 20px;
        }

        .lapi-media-upload-close {
            width: 40px;
            height: 40px;
            border: none;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.14);
            color: #fff;
            font-size: 28px;
            line-height: 1;
            cursor: pointer;
            font-family: inherit;
        }

        .lapi-media-upload-preview-wrap {
            flex: 1;
            position: relative;
            min-height: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            background: #111;
        }

        .lapi-media-upload-video {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .lapi-media-upload-overlay.is-collapsed .lapi-media-upload-preview-wrap {
            display: none;
        }

        .lapi-media-upload-expand {
            border: none;
            background: transparent;
            color: rgba(255, 255, 255, 0.88);
            font-family: inherit;
            font-size: var(--lapi-fs-14);
            font-weight: 700;
            cursor: pointer;
            text-decoration: underline;
            text-underline-offset: 3px;
        }

        .lapi-media-upload-bottom {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 14px;
            padding: 18px 20px;
            padding-bottom: max(22px, env(safe-area-inset-bottom));
        }

        .lapi-media-upload-shutter {
            display: block;
        }

        .lapi-media-upload-shutter:active {
            transform: scale(0.94);
        }

        .lapi-media-upload-files-only {
            display: none;
            width: 100%;
            max-width: 320px;
        }

        .lapi-media-upload-overlay.camera-unavailable .lapi-media-upload-preview-wrap,
        .lapi-media-upload-overlay.camera-unavailable .lapi-media-upload-shutter,
        .lapi-media-upload-overlay.camera-unavailable .lapi-media-upload-gallery-link {
            display: none;
        }

        .lapi-media-upload-overlay.camera-unavailable .lapi-media-upload-files-only {
            display: block;
        }

        .lapi-media-upload-overlay.camera-unavailable .lapi-media-upload-bottom {
            flex: 1;
            justify-content: center;
        }

        #archiveDocMetaModal.modal-overlay {
            z-index: 400;
            align-items: center;
            justify-content: center;
            padding: 12px;
            background: rgba(60, 42, 33, 0.42);
        }

        .doc-preview-sheet { max-width: 420px; }
        .doc-preview-body {
            max-height: min(60vh, 480px);
            overflow: auto;
            margin-bottom: 12px;
            border-radius: 16px;
            background: #fff;
            padding: 8px;
        }
        .doc-preview-body img,
        .doc-preview-body iframe,
        .doc-preview-body embed,
        .doc-preview-body object {
            width: 100%;
            min-height: min(50vh, 360px);
            max-height: min(58vh, 460px);
            border: none;
            border-radius: 12px;
        }

        .archive-parse-overlay {
            z-index: 520;
            align-items: center;
            justify-content: center;
            background: rgba(60, 42, 33, 0.45);
        }

        .archive-parse-overlay.visible {
            display: flex;
        }

        .archive-parse-overlay[hidden] {
            display: none !important;
        }

        .archive-parse-card {
            background: #fff;
            border-radius: 24px;
            padding: 20px 24px;
            text-align: center;
            max-width: 280px;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
        }

        .archive-parse-card video {
            width: min(200px, 62vw);
            max-height: 200px;
            height: auto;
            margin: 0 auto 8px;
            display: block !important;
            object-fit: contain;
            mix-blend-mode: multiply;
            background: transparent;
        }

        .archive-parse-card video:not([src]),
        .archive-parse-card video[data-load-error="1"] {
            display: none !important;
        }

        .archive-parse-mascot-fallback {
            display: none;
            font-size: 56px;
            line-height: 1;
            margin-bottom: 8px;
        }

        .archive-parse-card video[data-load-error="1"] + .archive-parse-mascot-fallback {
            display: block;
        }

        .archive-parse-card p {
            margin: 0;
            font-weight: 600;
        }

        .doc-preview-pdf-frame {
            width: 100%;
            min-height: min(50vh, 360px);
            max-height: min(58vh, 460px);
            border: none;
            border-radius: 12px;
            background: #fff;
        }

        .doc-preview-pdf-hint {
            margin: 10px 0 0;
            font-size: var(--lapi-fs-13);
            line-height: 1.4;
            color: var(--lapi-text-muted, #8a7568);
            text-align: center;
        }

        .doc-preview-tg-pdf-img {
            width: 100%;
            height: auto;
            min-height: 0;
            max-height: min(58vh, 460px);
            object-fit: contain;
            display: block;
            border-radius: 12px;
        }

        .doc-preview-open-pdf-btn {
            width: 100%;
            margin-top: 12px;
        }

        body.archive-doc-busy {
            pointer-events: none;
        }

        body.archive-doc-busy .archive-parse-overlay:not([hidden]) {
            pointer-events: auto;
        }

        #archiveDocMetaModal .modal-sheet {
            border-radius: 28px;
            max-height: min(720px, 92vh);
        }

        #subScreenProfile .profile-action-btn {
            width: 100%;
            max-width: none;
            margin-top: 0;
        }

        #subScreenProfile .profile-action-btn + .profile-action-btn,
        #subScreenProfile .profile-passport-add-btn {
            margin-top: 10px;
        }

        .pet-card-breed-inline {
            font-size: var(--lapi-fs-11);
            color: #aaa;
            font-weight: 500;
        }

        .analysis-modal-overlay {
            z-index: 350;
            align-items: flex-end;
            padding: 0;
            background: rgba(60, 42, 33, 0.35);
        }
        .analysis-modal-sheet {
            width: 100%;
            max-height: 92vh;
            max-width: 390px;
            margin: 0 auto;
            border-radius: 28px 28px 0 0;
            background: var(--lapi-cream, #fdf9f6);
            padding: 20px 18px calc(24px + env(safe-area-inset-bottom, 0px));
            overflow-y: auto;
            text-align: left;
        }
        .analysis-modal-mascot { display: flex; justify-content: center; margin-bottom: 8px; }
        .analysis-modal-mascot video { width: 100px; mix-blend-mode: multiply; }
        .analysis-mode-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
        .analysis-mode-tab {
            flex: 1;
            border: none;
            border-radius: 14px;
            padding: 10px 8px;
            font-family: inherit;
            font-size: var(--lapi-fs-13);
            font-weight: 700;
            background: rgba(255, 255, 255, 0.8);
            color: var(--lapi-chocolate-soft, #5c463a);
            cursor: pointer;
        }
        .analysis-mode-tab.active {
            background: var(--lapi-coral, #ff7a59);
            color: #fff;
        }
        .analysis-accordion { display: flex; flex-direction: column; gap: 10px; }
        .analysis-accordion-item {
            border-radius: 24px;
            overflow: hidden;
            background: #fff;
            box-shadow: 0 4px 14px rgba(60, 42, 33, 0.06);
        }
        .analysis-accordion-item.marker-green { border-left: 5px solid #1abc9c; }
        .analysis-accordion-item.marker-yellow { border-left: 5px solid #f1c40f; }
        .analysis-accordion-item.marker-red { border-left: 5px solid #e74c3c; }
        .analysis-status-badge {
            font-size: var(--lapi-fs-14);
            font-weight: 600;
            margin: 0 0 12px;
            line-height: 1.4;
        }
        .analysis-status-badge.status-green { color: #137333; }
        .analysis-status-badge.status-yellow { color: #b06000; }
        .analysis-status-badge.status-red { color: #c5221f; }
        .analysis-advice-block {
            font-size: var(--lapi-fs-14);
            line-height: 1.5;
            color: #444;
            margin-bottom: 12px;
            padding: 10px 12px;
            background: #f8f9fa;
            border-radius: 8px;
        }
        .analysis-accordion-head {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 14px 16px;
            border: none;
            background: transparent;
            font-family: inherit;
            font-size: var(--lapi-fs-14);
            font-weight: 700;
            text-align: left;
            cursor: pointer;
            color: var(--lapi-chocolate, #3c2a21);
        }
        .analysis-accordion-body {
            display: none;
            padding: 0 16px 14px;
            font-size: var(--lapi-fs-14);
            line-height: 1.5;
            color: var(--lapi-chocolate-soft, #5c463a);
        }
        .analysis-accordion-item.expanded .analysis-accordion-body { display: block; }
        .analysis-table { width: 100%; border-collapse: collapse; font-size: var(--lapi-fs-13); }
        .analysis-table th, .analysis-table td {
            padding: 10px 8px;
            text-align: left;
            border-bottom: 1px solid rgba(60, 42, 33, 0.08);
        }
        .analysis-range-row td { padding-top: 0; border-bottom: none; }
        .analysis-range-track {
            position: relative;
            height: 10px;
            border-radius: 999px;
            background: #efe8e2;
            overflow: hidden;
        }
        .analysis-range-normal {
            position: absolute;
            top: 0;
            bottom: 0;
            background: rgba(26, 188, 156, 0.35);
            border-radius: 999px;
        }
        .analysis-range-marker {
            position: absolute;
            top: 50%;
            width: 12px;
            height: 12px;
            margin-top: -6px;
            margin-left: -6px;
            border-radius: 50%;
            background: var(--lapi-coral, #ff7a59);
            border: 2px solid #fff;
        }
        .lapi-chat-progress {
            height: 6px;
            border-radius: 999px;
            background: #efe8e2;
            overflow: hidden;
            margin-bottom: 16px;
        }
        .lapi-chat-progress-fill {
            height: 100%;
            width: 33%;
            border-radius: inherit;
            background: linear-gradient(90deg, var(--lapi-coral-light, #ff8e6e), var(--lapi-coral, #ff7a59));
            transition: width 0.35s ease;
        }
        .lapi-chat-pet-label {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 6px;
            margin: 0 0 12px;
            padding: 8px 12px;
            border-radius: 14px;
            background: rgba(181, 232, 216, 0.45);
            font-size: var(--lapi-fs-14);
            font-weight: 700;
            color: var(--lapi-chocolate, #3c2a21);
        }

        .lapi-chat-input-row { display: flex; gap: 8px; margin-bottom: 12px; }
        .lapi-chat-input {
            flex: 1;
            border: 1px solid rgba(60, 42, 33, 0.12);
            border-radius: 16px;
            padding: 12px 14px;
            font-family: inherit;
            font-size: var(--lapi-fs-16);
        }
        .lapi-capsules { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
        .lapi-capsule {
            border: 1px solid rgba(60, 42, 33, 0.12);
            border-radius: 999px;
            padding: 8px 14px;
            background: #fff;
            font-family: inherit;
            font-size: var(--lapi-fs-13);
            font-weight: 600;
            cursor: pointer;
        }
        .lapi-chat-question { margin-bottom: 14px; }
        .lapi-chat-question label {
            display: block;
            margin-bottom: 6px;
            font-size: var(--lapi-fs-14);
            font-weight: 600;
        }
        .lapi-triage-card { border-radius: 24px; padding: 18px; margin-bottom: 16px; }
        .lapi-triage-card.status-green { background: #d8f3e8; color: #1a6b4a; }
        .lapi-triage-card.status-yellow { background: #fff3cd; color: #7a5a12; }
        .lapi-triage-card.status-red { background: #ffe8e0; color: #9a2e1a; }
        .lapi-triage-card h4 { margin: 0 0 8px; font-size: var(--lapi-fs-17); }
        .lapi-triage-card p { margin: 0 0 12px; font-size: var(--lapi-fs-14); line-height: 1.45; }
        .lapi-triage-emergency {
            font-weight: 800;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }
        .btn-emergency {
            width: 100%;
            border: none;
            border-radius: 20px;
            padding: 16px;
            font-family: inherit;
            font-size: var(--lapi-fs-15);
            font-weight: 800;
            background: var(--lapi-coral, #ff7a59);
            color: #fff;
            box-shadow: 0 10px 24px var(--lapi-coral-glow, rgba(255, 122, 89, 0.32));
            cursor: pointer;
        }
        .profile-section {
            margin-bottom: 20px;
            padding: 16px;
            border-radius: 24px;
            background: #fff;
            box-shadow: 0 4px 14px rgba(60, 42, 33, 0.06);
            text-align: left;
        }
        .profile-section h3 { margin: 0 0 12px; font-size: var(--lapi-fs-16); font-weight: 700; }

        .profile-section--legal {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .profile-section--legal h3 {
            align-self: stretch;
            text-align: left;
        }

        .profile-section--legal .profile-legal-link {
            width: auto;
            min-width: min(100%, 260px);
            max-width: 100%;
            margin: 0 auto;
            padding: 14px 22px;
            font-weight: 600;
            font-size: var(--lapi-fs-15);
            letter-spacing: 0.01em;
            text-decoration: none;
            text-align: center;
            border-radius: 20px;
        }

        .profile-section--legal .profile-legal-link:hover,
        .profile-section--legal .profile-legal-link:focus,
        .profile-section--legal .profile-legal-link:active {
            text-decoration: none;
            color: #3c2a21;
        }
        .profile-pet-row {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 0;
            border-bottom: 1px solid rgba(60, 42, 33, 0.06);
            font-size: var(--lapi-fs-14);
        }
        .profile-pet-row:last-child { border-bottom: none; }
        .profile-referral-banner {
            background: linear-gradient(135deg, rgba(255, 232, 220, 0.9), rgba(212, 245, 234, 0.9));
            border-radius: 20px;
            padding: 16px;
            margin-bottom: 12px;
        }
        .profile-referral-stats { display: flex; gap: 12px; margin-top: 12px; }
        .profile-referral-stat {
            flex: 1;
            text-align: center;
            padding: 10px;
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.75);
        }
        .profile-referral-stat strong {
            display: block;
            font-size: var(--lapi-fs-20);
            color: var(--lapi-coral, #ff7a59);
        }
        .profile-referral-stat span { font-size: var(--lapi-fs-11); color: var(--lapi-text-muted, #8a7568); }

        .profile-referral-pending {
            margin-top: 10px;
            white-space: pre-line;
            color: #2d6a4f;
        }

        .profile-referral-tg-hint {
            margin: 8px 0 0;
            font-size: var(--lapi-fs-12);
            line-height: 1.45;
            color: var(--lapi-text-muted, #8a7568);
        }

        .profile-referral-invite-btn--disabled,
        .profile-referral-invite-btn--disabled:disabled {
            opacity: 0.45;
            cursor: not-allowed;
            filter: grayscale(0.15);
        }

        .custom-task-chip-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin: 12px 0 16px;
            max-height: 200px;
            overflow-y: auto;
        }

        .custom-task-chip-list-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 10px 12px;
            border-radius: 14px;
            background: #f5f0ec;
            font-size: var(--lapi-fs-14);
            color: var(--lapi-chocolate, #3c2a21);
        }

        .custom-task-chip-list-item button {
            flex-shrink: 0;
            border: none;
            background: transparent;
            color: #c5221f;
            font: inherit;
            font-size: var(--lapi-fs-13);
            font-weight: 700;
            cursor: pointer;
            padding: 4px 0;
        }

        #customTaskChipModalInput {
            font-size: var(--lapi-fs-16);
        }
        .passport-preview-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
        .passport-thumb {
            width: 72px;
            height: 72px;
            border-radius: 12px;
            object-fit: cover;
            background: #f5f0ec;
        }