        :root {
            /* 1. BRAND COLORS */
            --primary: #334155;           /* Slate 700 - The Suit */
            --primary-dark: #0F172A;      /* Slate 900 - The Tuxedo */
            
            --accent-gold: #C5A572;       /* Swiss Gold - The Watch (Accents) */
            --accent-gold-dim: #D4C5A5;   /* Muted Gold */

            /* 2. TEXT */
            --navy-900: #0F172A;          /* Ink */
            --navy-800: #334155;          /* Graphite */
            --navy-50:  #F8FAFC;          /* Paper */

            /* 3. LEGACY MAPPING */
            --text-main: var(--navy-900);
            --text-secondary: var(--navy-800);
            --bg-body: var(--navy-50);
            --bg-surface: #FFFFFF;
            --border-color: #E2E8F0;
            --border-input: #CBD5E1;

            /* 4. SURFACES */
            --glass-surface: rgba(255, 255, 255, 0.95);
            --glass-border:  rgba(148, 163, 184, 0.2);
            
            /* 5. SHAPES */
            --radius-md: 12px;
            --radius-lg: 24px;
            
            /* 6. ANIMATION */
            --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
            --ease-smooth:  cubic-bezier(0.4, 0, 0.2, 1);
            
            /* Тени */
            --shadow-1: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
            --shadow-2: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-3: 0 10px 15px -3px rgb(0 0 0 / 0.1);
            
            /* Типографика */
            --font-main: 'Inter', -apple-system, sans-serif;

            /* ── Токены Этапа 5 ── */
            --color-error:     #DC2626;
            --color-error-rgb: 220, 38, 38;
            --shadow-text:     0 2px 4px rgba(0,0,0,0.2);
            --gradient-gold:   linear-gradient(90deg, var(--accent-gold), transparent);
            --z-content:       1;
            --form-w-calc:     900px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            scroll-behavior: smooth;
        }
        
        body {
            font-family: var(--font-main);
            background-color: var(--navy-50);
            background-image: 
                radial-gradient(at 0% 0%, rgba(255,255,255,0.8) 0px, transparent 50%),
                radial-gradient(at 100% 0%, rgba(197, 165, 114, 0.05) 0px, transparent 50%);
            color: var(--text-main);
            line-height: 1.6;
            overflow-x: hidden;
            position: relative;
        }
        
        /* Header с glassmorphism */
        .header {
            position: sticky;
            top: 0;
            z-index: 50;
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-bottom: 1px solid var(--border-color);
            transition: all 0.3s ease;
        }

        .header.scrolled {
            box-shadow: var(--shadow-3);
        }
        
        .header-inner {
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 16px 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .site-name {
            font-family: var(--font-main);
            font-size: clamp(20px, 2.8vh, 32px);
            font-weight: 900;
            color: var(--text-main);
            text-transform: uppercase;
            transition: all 0.3s ease;
        }

        .site-name:hover {
            color: var(--primary);
        }

         /* Убраны старые анимации site-name */
        
        .user-tools {
            display: flex;
            gap: 15px;
            align-items: center;
            flex-wrap: wrap;
        }

        .language-switcher {
            display: flex;
            gap: 8px;
            align-items: center;
            position: relative;
        }

        .language-switcher select {
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            color: var(--text-main);
            padding: 8px 16px;
            text-transform: capitalize;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            outline: none;
            transition: all 0.2s ease;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 12px center;
            padding-right: 35px;
        }

        @media (hover: hover) {
            .language-switcher select:hover {
                border-color: var(--primary);
            }
        }

        .language-switcher select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--primary-glow);
        }

        .language-switcher select option {
            background: var(--bg-surface);
            color: var(--text-main);
            padding: 10px;
            text-transform: capitalize;
        }
        
        .user-tools a {
            color: var(--primary);
            text-decoration: none;
            padding: 10px 24px;
            border: 2px solid var(--primary);
            border-radius: 4px; /* Менее скругленные, швейцарский стиль */
            font-weight: 700;
            text-transform: uppercase;
            transition: all 0.3s ease;
            background: transparent;
        }

        .user-tools a:hover {
            color: white;
            background: var(--primary);
        }
        
        /* Навигация */
        .nav {
            background: var(--bg-surface);
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 65px; /* Высота хедера */
            z-index: 49;
        }
        
        .nav-inner {
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 24px;
        }
        
        .nav-menu {
            list-style: none;
            display: flex;
            margin: 0;
            padding: 0;
            gap: 8px;
        }
        
        .nav-menu li {
            margin: 0;
        }
        
        .nav-menu a {
            display: block; padding: 10px 16px;
            color: var(--navy-800); text-decoration: none;
            font-weight: 500; transition: all 0.2s ease;
            border-radius: 6px;
        }
        .nav-menu a:hover {
            color: var(--accent-gold);
            background: rgba(15, 23, 42, 0.03);
        }
        .nav-menu a.active {
            color: var(--navy-900); font-weight: 700;
            background: transparent;
        }
        /* Gold Dot for Active */
        .nav-menu a.active::before {
            content: '•'; color: var(--accent-gold);
            margin-right: 6px; transform: scale(1.5); display: inline-block;
        }

        /* Dropdown Styles */
        .dropdown {
            position: relative;
            display: inline-block;
        }

        .dropdown-content {
            display: none;
            position: absolute;
            background-color: var(--bg-surface);
            min-width: 220px;
            box-shadow: var(--shadow-2);
            z-index: 1000;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            padding: 8px 0;
            top: 100%;
            left: 0;
        }

        .dropdown-content a {
            color: var(--text-main) !important;
            padding: 10px 16px;
            text-decoration: none;
            display: block;
            border-radius: 0;
            margin: 0;
            font-weight: 500;
        }

        .dropdown-content a:hover {
            background-color: rgba(15, 23, 42, 0.03);
            color: var(--accent-gold) !important;
        }
        
        .dropdown-content a.active {
            color: var(--primary) !important;
            background-color: rgba(15, 23, 42, 0.03);
        }
        
        .dropdown-content a.active::before {
            content: none; /* No gold dot in dropdown */
        }

        .dropdown:hover .dropdown-content {
            display: block;
        }
        
        .dropbtn {
            display: flex !important;
            align-items: center;
            gap: 4px;
        }
        
        /* Backdrop удалён. Закрытие по outside-click обрабатывается
           через document.addEventListener('click') ниже. */
        
        /* Основной контент */
        .main-content {
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 24px;
            position: relative;
            z-index: 1;
            min-height: 60vh;
        }
        
        .content-block {
            width: 100%;
            background: var(--glass-surface);
            border: 1px solid var(--glass-border);
            box-shadow: 
                0 20px 40px -10px rgba(15, 23, 42, 0.05),
                0 0 0 1px rgba(255,255,255,0.8) inset;
            border-radius: var(--radius-lg);
            padding: 64px 48px;
            position: relative;
            overflow: hidden;
            margin-bottom: 24px;
        }

        @supports (backdrop-filter: blur(20px)) {
            .content-block {
                background: rgba(255, 255, 255, 0.85);
                backdrop-filter: blur(16px);
                -webkit-backdrop-filter: blur(16px);
            }
        }

        @media (max-width: 900px) { .content-block { padding: 48px 32px; } }
        @media (max-width: 480px) { .content-block { padding: 32px 20px; } }

        /* Hero Typography */
        .hero-title {
            font-size: 56px;
            color: var(--navy-900);
            letter-spacing: -0.03em;
            line-height: 1.1;
            font-weight: 800;
        }

        .hero-subtitle {
            font-size: 20px;
            color: var(--navy-800);
            font-weight: 400;
            max-width: 600px;
            line-height: 1.6;
        }

        @media (max-width: 640px) {
            .hero-title { font-size: 36px; }
            .hero-subtitle { font-size: 18px; }
        }

        @media (max-width: 640px) {
            .hero-title { font-size: 36px; }
            .hero-subtitle { font-size: 18px; }
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(40px) rotateX(-5deg);
            }
            to {
                opacity: 1;
                transform: translateY(0) rotateX(0);
            }
        }

        /* slideUpFade Animation */
        /* ANIMATION */
        @keyframes slideUpFade {
            0% { opacity: 0; transform: translateY(15px); }
            100% { opacity: 1; transform: translateY(0); }
        }
        .animate-enter > * {
            opacity: 0; animation: slideUpFade 0.5s var(--ease-smooth) forwards;
        }
        .animate-enter > :nth-child(1) { animation-delay: 0.1s; }
        .animate-enter > :nth-child(2) { animation-delay: 0.15s; }
        .animate-enter > :nth-child(3) { animation-delay: 0.2s; }
        .animate-enter > :nth-child(4) { animation-delay: 0.25s; }

        /* THE BUTTON (Slate + Gold Arrow) */
        .btn-primary {
            display: inline-flex; align-items: center; justify-content: center; gap: 12px;
            background: var(--primary);
            color: white !important;
            padding: 16px 32px; border-radius: var(--radius-md);
            font-weight: 600; text-decoration: none;
            transition: all 0.2s var(--ease-smooth);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }
        .btn-primary:hover {
            background: var(--primary-dark);
            transform: translateY(-1px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }
        .btn-primary svg { 
            transition: transform 0.2s ease; 
            stroke: var(--accent-gold);
        }
        .btn-primary:hover svg { transform: translateX(4px); }

        /* FEATURE GRID (THE SOUL) */
        .feature-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 16px;
            margin-bottom: 56px;
        }
        .feature-card {
            display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
            padding: 24px;
            background: rgba(255,255,255,0.5);
            border: 1px solid rgba(148, 163, 184, 0.1);
            border-radius: 16px;
            transition: all 0.2s ease;
        }
        .feature-card:hover {
            background: white;
            box-shadow: 0 10px 20px -5px rgba(0,0,0,0.05);
            transform: translateY(-2px);
            border-color: rgba(197, 165, 114, 0.3);
        }
        .feature-card span {
            font-weight: 500; font-size: 16px; color: var(--navy-800);
            line-height: 1.4;
        }
        .icon-gold {
            color: var(--accent-gold);
            background: rgba(197, 165, 114, 0.1);
            padding: 10px; border-radius: 10px;
            display: inline-flex;
        }

        /* Hero Actions */
        .hero-actions { display: flex; align-items: center; gap: 32px; }
        .secondary-links { display: flex; gap: 16px; font-size: 14px; }
        .separator { color: var(--navy-800); opacity: 0.3; }

        /* GLOBAL EXCEPTION 1: Input Contrast */
        select, input[type="text"], input[type="number"], input[type="email"] {
            border: 1px solid #CBD5E1 !important;
            background-color: var(--bg-surface) !important;
            color: #0F172A;
            max-width: 100%;
            box-sizing: border-box;
            border-radius: 8px;
        }
        
        /* Error state for form inputs (overrides default border) */
        select.input-error, input.input-error {
            border: 1px solid var(--color-error) !important;
        }

        /* GLOBAL EXCEPTION 2: Grid Alignment (Fix for "Kinder" label wrapping) */
        /* Forces all labels in the grid to have uniform height */
        .calc-grid-2 .form-field label {
            min-height: 2.5em; /* Space for 2 lines */
            display: flex !important; /* OVERRIDE INLINE BLOCK */
            align-items: flex-end; /* Align text to bottom */
            line-height: 1.25;
        }

        /* GLOBAL EXCEPTION 3: Partner Field Layout (Fixes Desktop Side-by-Side bug) */
        /* Keeps JS visibility logic intact */
        #income-partner-container, #income-field-container {
            flex-direction: column !important; /* Stack vertically when visible */
            align-items: flex-start !important;
            width: 100% !important;
        }
        #income-partner-container label, #income-field-container label {
            width: 100%; /* Ensure label takes full width */
        }

        @media (max-width: 768px) {
            .feature-grid { grid-template-columns: 1fr; gap: 12px; }
            .feature-card { flex-direction: row; align-items: center; padding: 16px; }
        }

        @media (max-width: 640px) {
            .hero-actions { flex-direction: column; align-items: stretch; gap: 24px; }
            .secondary-links { justify-content: center; }
        }
        
        h1 {
            font-family: var(--font-main);
            font-size: clamp(32px, 5vw, 48px);
            font-weight: 700;
            margin-bottom: 24px;
            color: var(--text-main);
            letter-spacing: -0.02em;
            line-height: 1.1;
        }

        h1 span {
            color: var(--primary);
        }
        
        h2 {
            font-family: var(--font-main);
            font-size: clamp(20px, 3vw, 28px);
            font-weight: 600;
            margin-bottom: 16px;
            color: var(--text-main);
            letter-spacing: -0.02em;
        }
        
        h3 {
            font-family: var(--font-main);
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--text-main);
            letter-spacing: -0.01em;
        }
        
        p {
            margin-bottom: 16px;
            color: var(--text-main);
            font-size: 16px;
            line-height: 1.6;
        }
        
        label {
            font-size: 14px;
            font-weight: 500;
            color: var(--text-secondary);
            letter-spacing: 0.01em;
            margin-bottom: 6px;
            display: block;
        }
        
        /* Поля ввода */
        input[type="text"],
        input[type="number"],
        input[type="email"],
        input[type="tel"],
        select {
            height: 48px;
            width: 100%;
            background: var(--bg-surface);
            border: 1px solid var(--border-input);
            border-radius: 8px;
            padding: 12px 16px;
            font-size: 16px;
            font-family: var(--font-main);
            color: var(--text-main);
            transition: all 0.2s ease;
        }
        
        input[type="text"]:focus,
        input[type="number"]:focus,
        input[type="email"]:focus,
        input[type="tel"]:focus,
        select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--primary-glow);
            outline: none;
        }
        
        input[type="text"]::placeholder,
        input[type="number"]::placeholder {
            color: var(--text-secondary);
            opacity: 0.6;
        }
        
        /* Состояние ошибки */
        input.error,
        select.error {
            border-color: var(--color-error);
        }
        
        input.error:focus,
        select.error:focus {
            box-shadow: 0 0 0 3px rgba(var(--color-error-rgb), 0.2);
        }

        ul {
            list-style: none;
            padding: 0;
        }

        ul li {
            padding: clamp(12px, 1.5vw, 15px) 0;
            padding-left: clamp(25px, 3vw, 30px);
            position: relative;
            color: var(--text-main);
            font-size: clamp(16px, 1.8vw, 18px);
            transition: all 0.3s ease;
        }

        ul li::before {
            content: '▸';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
            font-weight: normal;
            font-size: 18px;
        }

        .nav-menu li::before {
            content: none;
        }
        
        .dropbtn svg {
            transition: transform 0.3s ease;
        }
        .dropdown:hover .dropbtn svg {
            transform: rotate(180deg);
        }

        ul li:hover {
            color: var(--primary);
        }

        /* CTA кнопка */
        .btn-outline {
            display: inline-block;
            padding: 12px 28px;
            border: 2px solid var(--primary);
            color: var(--primary);
            background: transparent;
            text-decoration: none;
            font-weight: 700;
            font-size: 14px;
            transition: all 0.2s ease;
        }

        .btn-outline:hover {
            background: var(--primary);
            color: white;
        }

        /* Мелкие ссылки */
        .link-muted {
            color: var(--text-secondary);
            text-decoration: none;
            transition: all 0.2s ease;
        }

        .link-muted:hover {
            color: var(--accent-gold);
        }
        
        /* Footer */
        .footer {
            background: var(--bg-body);
            color: var(--text-secondary);
            padding: 48px 24px;
            border-top: 1px solid var(--border-color);
            max-width: 1200px;
            margin: 0 auto;
        }

        .footer-grid {
            display: grid;
            grid-template-columns: 2fr 1fr 1fr;
            gap: 48px;
            text-align: left;
        }

        .footer-logo {
            font-family: var(--font-main);
            font-size: 20px;
            font-weight: 700;
            color: var(--text-main);
            margin: 0; /* Убираем отступ, так как он теперь в ts-footer-logo-row */
        }

        .ts-footer-logo-row {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 12px;
            margin-bottom: 32px;
        }

        .ts-logo-divider {
            width: 40px;
            height: 2px;
            background: var(--accent-gold);
            border-radius: 1px;
            opacity: 0.8;
        }

        .ts-footer-slogan {
            font-size: 11px;
            color: var(--navy-800);
            opacity: 0.6;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            font-weight: 500;
            line-height: 1;
        }

        .ts-slogan-line-2 {
            padding-left: 24px; /* Эффект лесенки */
        }

        .copyright {
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.6;
        }

        .footer-heading {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-main);
            margin-bottom: 16px;
        }

        .footer-links {
            list-style: none;
            padding: 0;
        }

        .footer-links li {
            padding: 0;
            margin-bottom: 8px;
        }

        .footer-links li::before {
            content: none;
        }

        .footer-links a {
            text-decoration: none;
            color: var(--text-secondary);
            font-size: 14px;
            font-weight: 400;
            transition: color 0.2s ease;
        }

        .footer-links a:hover {
            color: var(--accent-gold);
        }

        @media (max-width: 768px) {
            .footer-grid {
                grid-template-columns: 1fr;
                gap: 32px;
                text-align: center;
            }
            
            /* Выравниваем логотип и слоган по центру */
            .ts-footer-logo-row {
                align-items: center;
            }
            
            /* Выравниваем раскрывающийся заголовок "Инструменты" по центру */
            .footer-tools-summary {
                justify-content: center;
            }
            
            /* Убираем боковую линию и отступ, чтобы центрирование списка было симметричным */
            .footer-sublinks {
                padding-left: 0;
                border-left: none;
            }
        }

        /* Адаптивность */
        @media (max-width: 1400px) {
            .main-content {
                max-width: min(1100px, 92vw);
            }
        }

        @media (max-width: 1200px) {
            .main-content {
                max-width: min(1000px, 90vw);
            }
        }

        @media (max-width: 1024px) {
            .header-inner {
                max-width: min(900px, 95vw);
                flex-wrap: wrap;
            }
            
            .nav-inner {
                max-width: min(900px, 95vw);
            }

            .main-content {
                max-width: min(900px, 90vw);
            }
            
            .nav {
                top: auto;
            }
        }

        @media (max-width: 768px) {
            /* 1. Header: Force Single Row */
            .header-inner {
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
                padding: 10px 16px;
                gap: 0;
                max-width: 100%;
                text-align: left;
            }
            
            /* 2. Logo Constraints */
            .site-logo { 
                height: auto; 
                max-height: 36px; 
                display: flex;
                align-items: center;
            }
            
            /* 3. User Tools */
            .user-tools { 
                gap: 8px; 
                width: auto;
                justify-content: flex-end;
            }
            
            /* 4. Nav: Scrollable Row */
            .nav { position: relative; top: 0; }
            .nav-inner { padding: 0 16px; }
            
            .nav-menu {
                flex-direction: row;
                overflow-x: auto;
                white-space: nowrap;
                padding: 10px 0;
                gap: 12px;
                -webkit-overflow-scrolling: touch;
                justify-content: flex-start;
            }
            .nav-menu::-webkit-scrollbar { display: none; }
            
            .nav-menu > li > a {
                background: #F1F5F9;
                padding: 6px 14px;
                border-radius: 20px;
                font-size: 14px;
                text-align: center;
            }
            .nav-menu > li > a.active {
                background: var(--primary);
                color: white;
            }
            .nav-menu > li > a.active::before { content: none; }

            /* 5. Content Spacing */
            .content-block { 
                padding: 24px 16px; 
                box-sizing: border-box;
            }
            .main-content { 
                padding: 0 16px; 
                max-width: 100vw; 
                box-sizing: border-box;
            }
            
            /* 6. Text Wrapping (Targeted Safe Mode) */
            h1, h2, h3, h4, p, .content-block, .hero-title {
                overflow-wrap: break-word; 
                word-wrap: break-word; 
                hyphens: auto;
            }
            
            /* FIX ONE: Disable Uppercase on Mobile to allow Hyphenation */
            h3 { text-transform: none !important; }
            
            /* FIX TWO: Result Number Scaling (Clamp Font Size) */
            #tax-savings-result {
                /* Scales between 24px and 40px depending on screen width */
                font-size: clamp(24px, 10vw, 40px) !important;
                white-space: nowrap !important; /* Force single line */
                overflow-wrap: normal !important;
                hyphens: none !important;
            }

            /* FIX THREE: Partner Income Layout (Outer Stack) */
            /* 1. Force the container to be a single column stack on mobile */
            #income-row-container {
                grid-template-columns: 1fr !important;
            }

            /* Note: Inner layout fix moved to GLOBAL EXCEPTION 3 */
            
            /* 7. Label Visibility (Override Inline Styles) */
            label, .form-label {
                font-weight: 600 !important;
                color: #0F172A !important;
                font-size: 14px !important;
            }
            
            /* 8. Gold Number Mobile Size */
            #gap-amount { font-size: 1.2em; }
            
            /* 9. Reset Mobile Label Height (No fixed height on mobile) */
            .calc-grid-2 .form-field label {
                min-height: auto;
                display: block !important;
            }

            /* 10. Dropdown Fix: position:fixed — вырывается из overflow-clipping */
            /* Отключаем hover — он обрезается overflow-x: auto */
            .dropdown:hover .dropdown-content {
                display: none;
            }
            /* fixed-блок выходит из любого clipping-контекста */
            .dropdown-content.is-open {
                display: block !important;
                position: fixed;
                z-index: 9999;
                /* top/left проставляются через JS */
            }
        }

        @media (max-width: 480px) {
            .header-inner {
                padding: 12px 15px;
            }

            .nav-inner {
                padding: 0 15px;
            }

            .main-content {
                padding: 0 12px;
            }

            .content-block {
                padding: 20px 15px;
            }

            .user-tools a {
                padding: 8px 16px;
                font-size: 14px;
            }
        }

        /* Дополнительные эффекты */
        .glow-effect {
            position: relative;
        }

        .glow-effect::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 120%;
            height: 120%;
            background: radial-gradient(circle, rgba(0, 245, 255, 0.3), transparent);
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
            z-index: -1;
        }

        .glow-effect:hover::after {
            opacity: 1;
        }

        /* SITE LOGO */
        .site-logo {
            display: block;
            height: 48px;
            width: auto;
            transition: all 0.3s ease;
        }
        .site-logo img {
            height: 100%;
            width: auto;
            display: block;
        }
        .site-logo:hover {
            opacity: 0.9;
            transform: translateY(-1px);
        }

        /* UI HIGHLIGHT: Gold Number */
        #gap-amount {
            color: var(--accent-gold);
            font-weight: 800;
            font-size: 1.3em;
            padding: 0 4px;
        }

        /* AUTOCOMPLETE DROPDOWN (Global) */
        /* Parent must be relative for absolute positioning */
        .form-field {
            position: relative;
        }
        
        .suggestions-dropdown {
            position: absolute;
            top: 100%; left: 0; right: 0;
            background: white;
            border: 1px solid var(--glass-border);
            border-radius: 0 0 8px 8px;
            max-height: 200px;
            overflow-y: auto;
            z-index: 1000;
            display: block;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }

        .suggestion-item {
            padding: 12px 16px;
            cursor: pointer;
            font-size: 14px;
            color: var(--navy-900);
            border-bottom: 1px solid rgba(148, 163, 184, 0.1);
            transition: background 0.15s ease;
        }

        .suggestion-item:hover {
            background: rgba(15, 23, 42, 0.03);
            color: var(--primary);
        }

        .suggestion-item:last-child {
            border-bottom: none;
        }
        
        /* === TAXSENTRY DESIGN SYSTEM === */
        /* Typography & Layout Utility Classes */
        .ts-page-header {
            margin-bottom: 40px;
            border-bottom: 1px solid var(--glass-border);
            padding-bottom: 24px;
        }
        .ts-page-title {
            font-size: 32px;
            color: var(--navy-900);
            font-weight: 700;
            margin-bottom: 8px;
            line-height: 1.2;
        }
        .ts-title-underline {
            width: 60px;
            height: 3px;
            background: var(--accent-gold);
            border-radius: 2px;
        }
        .ts-section-title {
            font-size: 18px;
            color: var(--navy-900);
            margin-bottom: 8px;
            font-weight: 600;
        }
        .ts-section-text {
            color: var(--navy-800);
            line-height: 1.6;
            text-align: justify;
        }
        .ts-section-divider {
            border-top: 1px solid var(--glass-border);
            margin-top: 24px;
            padding-top: 24px;
        }
        .ts-margin-top-24 {
            margin-top: 24px;
        }
        
        /* Interactive Elements Utilities */
        .ts-link-primary {
            color: var(--primary);
            text-decoration: none;
        }
        .ts-link-primary:hover {
            text-decoration: underline;
        }
        .ts-btn-back {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-weight: 600;
            font-size: 14px;
            margin-bottom: 24px;
            text-decoration: none;
            color: var(--text-secondary);
            transition: color 0.2s ease;
        }
        .ts-btn-back:hover {
            color: var(--accent-gold);
        }
        .ts-btn-sm {
            padding: 12px 24px !important;
            font-size: 14px !important;
        }
        .ts-input {
            width: 100%;
            padding: 12px;
            border: 1px solid var(--glass-border) !important;
            border-radius: 8px;
            box-sizing: border-box;
            background: var(--bg-surface) !important;
        }
        .ts-input[disabled] {
            background: #f5f5f5 !important;
            color: #999 !important;
            cursor: not-allowed;
        }
        
        /* Layout & Container Utilities */
        .ts-flex-column-32 {
            display: flex;
            flex-direction: column;
            gap: 32px;
        }
        .ts-flex-gap-32 {
            display: flex;
            gap: 32px;
        }
        .ts-flex-align-center-gap-8 {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .ts-grid-responsive {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
            gap: 24px;
        }
        .ts-glass-panel {
            background: var(--bg-surface);
            padding: 24px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
        }
        .ts-glass-panel-lg {
            background: var(--bg-surface);
            border: 1px solid var(--glass-border);
            border-radius: 16px;
            padding: 40px;
            box-shadow: var(--shadow-2);
        }
        .ts-info-box {
            background: var(--bg-surface);
            padding: 16px;
            border-left: 3px solid var(--accent-gold);
            border-radius: 4px;
            font-size: 13px;
            color: var(--navy-800);
        }
        .ts-dashed-box {
            padding: 20px;
            background: rgba(51, 65, 85, 0.05);
            border: 1px dashed var(--primary);
            border-radius: 12px;
            text-align: center;
        }
        .ts-result-box {
            margin-top: 40px;
            padding: 40px;
            background: var(--primary);
            color: white;
            border-radius: 16px;
            position: relative;
            overflow: hidden;
            box-shadow: 0 10px 30px -5px rgba(0,0,0,0.2);
        }
        .ts-result-box-glow {
            position: absolute;
            top: -20px;
            right: -20px;
            width: 150px;
            height: 150px;
            background: radial-gradient(circle, var(--accent-gold) 0%, transparent 70%);
            opacity: 0.3;
            filter: blur(20px);
        }
        .ts-section-top-border {
            border-top: 1px solid var(--glass-border);
            padding-top: 24px;
        }
        .ts-app-frame {
            background: white;
            border: 1px solid var(--glass-border);
            box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
            padding: 4px;
            border-radius: 8px;
        }

        /* Icons */
        .ts-icon-14 { width: 14px; height: 14px; }
        .ts-icon-16 { width: 16px; height: 16px; }
        .ts-icon-20 { width: 20px; height: 20px; }
        .ts-mb-24 { margin-bottom: 24px; }
        .ts-mb-32 { margin-bottom: 32px; }
        .ts-mb-48 { margin-bottom: 48px; }
        .ts-mt-24 { margin-top: 24px; }
        .ts-mt-32 { margin-top: 32px; }
        .ts-mt-40 { margin-top: 40px; }
        
        /* Form & Misc Utilities */
        .ts-form-label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
        }
        .ts-hint-text {
            font-size: 12px;
            color: var(--navy-800);
            margin-top: 6px;
            opacity: 0.8;
        }
        .ts-icon-primary {
            color: var(--primary-dark);
        }
        .ts-icon-24 {
            width: 24px;
            height: 24px;
        }
        .ts-icon-16 {
            width: 16px;
            height: 16px;
        }
        .ts-icon-14 {
            width: 14px;
            height: 14px;
        }
        .ts-text-13 { font-size: 13px; }
        .ts-text-14 { font-size: 14px; }
        .ts-text-15 { font-size: 15px; }
        .ts-text-navy-800 { color: var(--navy-800); }
        .ts-text-navy-900 { color: var(--navy-900); }
        .ts-fw-500 { font-weight: 500; }
        .ts-fw-600 { font-weight: 600; }
        .ts-fw-700 { font-weight: 700; }
        .ts-op-60 { opacity: 0.6; }
        .ts-d-none { display: none !important; }
        .ts-d-block { display: block !important; }
        .ts-p-relative { position: relative; }
        
        /* Card Table Utilities */
        .ts-w-100 { width: 100%; }
        .ts-val-right {
            white-space: nowrap;
            text-align: right;
        }
        .ts-td-p4-0 { padding: 4px 0; }
        .ts-td-pl12-pr12 { padding-left: 12px !important; padding-right: 12px !important; }
        .ts-td-pr4 { padding-right: 4px !important; }
        
        .ts-compact-row > td {
            font-size: 11px !important;
            line-height: 1.1 !important;
            padding: 3px 8px 3px 0 !important;
            border: none !important;
            color: var(--navy-600);
            opacity: 0.8;
            white-space: nowrap;
        }
        .ts-compact-row > td + td {
            padding-left: 8px !important;
            min-width: 24px !important;
        }
        .ts-compact-row > td:first-child {
            padding-left: 12px !important;
        }
        .ts-compact-row > td:last-child {
            padding-right: 0 !important;
            text-align: right;
            font-weight: 500;
        }
        .ts-compact-row.ts-compact-last > td {
            padding-bottom: 8px !important;
        }
        .ts-compact-row.ts-compact-divider > td {
            padding-bottom: 8px !important;
            border-bottom: 1px solid var(--border-color) !important;
        }
        /* Совместимость — форматы без ts-compact-row */
        .ts-minmax-label {
            font-size: 11px !important;
            line-height: 1.1 !important;
            padding: 4px 8px 4px 12px !important;
            border: none !important;
            color: var(--navy-600);
            opacity: 0.8;
            white-space: nowrap;
        }
        .ts-minmax-currency {
            font-size: 11px !important;
            line-height: 1.1 !important;
            padding: 4px 4px 4px 0 !important;
            border: none !important;
            color: var(--navy-600);
            opacity: 0.8;
            white-space: nowrap;
            text-align: right;
        }
        .ts-minmax-val {
            font-size: 11px !important;
            line-height: 1.1 !important;
            padding: 4px 0 4px 4px !important;
            border: none !important;
            color: var(--navy-600);
            font-weight: 500;
            opacity: 0.8;
            white-space: nowrap;
            text-align: right;
        }
        .ts-td-border-b-none { border-bottom: none !important; }
        .ts-compact-percent-row > td {
            padding-bottom: 1px !important;
            border-bottom: none !important;
        }
        
        .ts-card-control {
            display: block;
            margin-top: 16px;
            padding-top: 16px;
            border-top: 1px dashed var(--border-color);
        }
        .ts-toggle-label {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            margin-bottom: 12px;
            font-weight: 500;
        }
        .ts-warn-msg {
            display: block;
            color: var(--gold-primary);
            font-size: 0.85rem;
            margin-top: 4px;
        }
        .ts-op-90 { opacity: 0.9; }
        .ts-mr-6 { margin-right: 6px; }

        /* ──────────── Новые классы Этапа 5 ──────────── */

        /* Типографика */
        .ts-h2-calc       { font-size: 24px; margin-bottom: 10px; }
        .ts-h2-card-title { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
        .ts-h3-calc-section { color: var(--navy-900); margin-bottom: 16px; }
        .ts-result-label  { opacity: 0.9; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-gold); }
        .ts-result-number {
            font-family: var(--font-main);
            font-size: 48px;
            font-weight: 900;
            color: var(--bg-surface);
            text-shadow: var(--shadow-text);
        }

        /* Информационная строка (замок + текст) */
        .ts-info-text {
            font-size: 14px;
            color: var(--navy-800);
            margin-bottom: 32px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        /* Сообщения об ошибках в формах */
        .ts-err-msg { color: var(--color-error); font-size: 12px; }

        /* Мелкий приглушённый текст */
        .ts-text-muted-sm { margin-bottom: 24px; font-size: 13px; color: var(--navy-800); opacity: 0.8; }

        /* iframe */
        .ts-iframe-full { width: 100%; height: 80vh; border: none; border-radius: 4px; }

        /* Meta-строки в deduction_detail */
        .ts-meta-row   { color: var(--navy-800); font-size: 15px; }
        .ts-meta-label { opacity: 0.6; font-weight: 500; }
        .ts-meta-value { font-weight: 600; color: var(--navy-900); }

        /* deduction_detail: блок "In development" */
        .ts-gradient-bar {
            position: absolute; top: 0; left: 0;
            width: 100%; height: 4px;
            background: var(--gradient-gold);
        }
        .ts-icon-wrapper {
            margin: 0 auto 24px auto;
            width: 56px; height: 56px;
            display: flex; align-items: center;
            justify-content: center; border-radius: 14px;
        }
        .ts-muted-text { color: var(--navy-800); opacity: 0.7; max-width: 480px; margin: 0 auto; font-size: 16px; }

        /* Утилиты */
        .ts-text-center     { text-align: center; }
        .ts-overflow-hidden { overflow: hidden; }
        .ts-z-content       { z-index: var(--z-content); }
        .ts-mb-56           { margin-bottom: 56px; }
        .ts-form-field-narrow { max-width: 400px; margin-bottom: 32px; margin-top: 24px; }
        .ts-form-w-calc     { max-width: var(--form-w-calc); }
        .ts-section-text-sm { font-size: 13px; margin-top: 12px; opacity: 0.7; }

        /* Footer Tools Dropdown */
        .footer-details-item {
            margin: 8px 0;
        }
        .footer-tools-summary {
            list-style: none;
            cursor: pointer;
            color: var(--text-muted);
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 4px;
            transition: color 0.2s ease;
        }
        .footer-tools-summary::-webkit-details-marker {
            display: none;
        }
        .footer-tools-summary:hover {
            color: var(--accent-gold);
        }
        .footer-tools-summary i {
            transition: transform 0.3s ease;
        }
        details[open] .footer-tools-summary i {
            transform: rotate(180deg);
        }
        .footer-sublinks {
            list-style: none;
            padding-left: 16px;
            margin: 8px 0;
            border-left: 1px solid rgba(212, 175, 55, 0.2);
            animation: slideDown 0.3s ease-out;
        }
        .footer-sublinks li {
            margin: 6px 0;
        }
        .footer-sublinks a {
            font-size: 13px !important;
            color: var(--text-muted) !important;
            opacity: 0.8;
            padding: 0 !important; /* Убираем лишние отступы */
        }
        .footer-sublinks a:hover {
            opacity: 1;
            color: var(--accent-gold) !important;
        }
        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-5px); }
            to { opacity: 1; transform: translateY(0); }
        }
