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

        :root {
            --primary: #818cf8;
            --primary-light: #a5b4fc;
            --secondary: #f472b6;
            --accent: #fbbf24;
            --bg: #0a0b14;
            --surface: #12131f;
            --surface2: #1a1c2c;
            --border: rgba(245,241,232,0.08);
            --text: #ede8d8;
            --text-muted: #8b8fa8;
            --rule: rgba(245,241,232,0.14);
            --gradient: linear-gradient(135deg, #818cf8 0%, #f472b6 100%);
            --grad-warm: linear-gradient(135deg, #fbbf24 0%, #f472b6 100%);
            --display: 'Unbounded', 'Onest', system-ui, sans-serif;
            --body: 'Onest', system-ui, -apple-system, sans-serif;
            --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
            --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
        }
        html.theme-light {
            --bg: #faf6ee;
            --surface: #ffffff;
            --surface2: #f0ebdc;
            --border: rgba(11,13,26,0.10);
            --text: #1a1d2e;
            --text-muted: #6b6e87;
            --rule: rgba(11,13,26,0.14);
            --primary: #4f46e5;
            --primary-light: #6366f1;
            --secondary: #db2777;
            --accent: #d97706;
            --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.025 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
        }
        html.theme-light ::-webkit-scrollbar-track { background: #e5e0d2; }

        html { scroll-behavior: smooth; }
        body {
            font-family: var(--body);
            background: var(--bg);
            color: var(--text);
            line-height: 1.65;
            overflow-x: hidden;
            font-feature-settings: "ss01", "cv11";
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }
        /* Subtle grain overlay across whole page (decorative, no interaction) */
        body::before {
            content: "";
            position: fixed; inset: 0;
            pointer-events: none;
            background-image: var(--grain);
            opacity: 1;
            z-index: 1;
            mix-blend-mode: overlay;
        }
        /* All page sections sit above the grain layer */
        nav, header, section, article, footer, main, .modal, .cta-modal { position: relative; z-index: 2; }
        /* Display family for headings & display text */
        h1, h2, h3, h4, .display, .hero-title, .section-title, .post-title,
        .page-title, .about-title, .contact-title, .cta-title,
        .footer-brand, .nav-logo {
            font-family: var(--display);
            letter-spacing: -0.02em;
            line-height: 1.1;
        }
        /* Editorial selection */
        ::selection { background: var(--accent); color: var(--bg); }

        /* Accessibility — skip link + visible focus */
        .skip-link {
            position: absolute; left: -9999px; top: 0;
            padding: 12px 18px;
            background: var(--accent); color: var(--bg);
            font-weight: 600;
            border-radius: 0 0 6px 0;
            text-decoration: none;
            z-index: 9999;
        }
        .skip-link:focus { left: 0; top: 0; outline: none; }
        :focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
            border-radius: 4px;
        }
        button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 3px;
        }
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
        }

        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: var(--bg); }
        ::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

        .container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

        .g-text {
            background: var(--gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        /* ─── Navigation ─── */
        .nav {
            position: fixed;
            top: 0; left: 0; right: 0;
            z-index: 100;
            padding: 20px 0;
            transition: all 0.3s;
        }
        /* Nav имеет solid-фон ВЕЗДЕ кроме главной (там hero перекрывает) */
        .nav.scrolled,
        body:not(.page-home) .nav {
            background: rgba(10,11,20,0.78);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
            border-bottom: 1px solid var(--rule);
        }
        html.theme-light body:not(.page-home) .nav,
        html.theme-light .nav.scrolled { background: rgba(250,246,238,0.85); }
        .nav.scrolled { padding: 12px 0; }
        .nav-inner {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .nav-logo {
            font-size: 1.32rem;
            font-weight: 700;
            letter-spacing: -0.02em;
            text-decoration: none;
            background: var(--gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .nav-company {
            font-family: var(--mono);
            font-size: 0.65rem;
            font-weight: 500;
            color: var(--text-muted);
            letter-spacing: 0.18em;
            text-transform: uppercase;
        }
        .nav-links {
            display: flex;
            align-items: center;
            gap: 32px;
            list-style: none;
        }
        .nav-links a {
            color: var(--text-muted);
            text-decoration: none;
            font-size: 0.88rem;
            font-weight: 500;
            position: relative;
            transition: color 0.2s;
        }
        .nav-links a:not(.nav-cta):hover { color: var(--text); }
        .nav-links a.active:not(.nav-cta) { color: var(--text); }
        .nav-links a.active:not(.nav-cta)::after {
            content: ""; position: absolute;
            left: 0; right: 0; bottom: -8px;
            height: 2px;
            background: var(--accent);
        }
        .nav .nav-links .nav-cta,
        nav.nav .nav-links .nav-cta,
        header.nav .nav-links .nav-cta {
            background: var(--gradient) !important;
            color: #ffffff !important;
            padding: 10px 24px !important;
            border-radius: 50px;
            font-weight: 800 !important;
            font-size: 1rem !important;
            text-decoration: none;
            transition: opacity 0.2s;
            letter-spacing: 0.01em;
            box-shadow: 0 2px 12px rgba(99,102,241,0.3);
        }
        .nav-cta:hover { opacity: 0.85; color: white; }
        .nav-toggle {
            display: none; background: none; border: none; cursor: pointer;
            padding: 10px; margin: -10px; border-radius: 8px;
            color: var(--text);
            transition: background 0.15s;
        }
        .nav-toggle:hover { background: var(--surface2); }
        .nav-toggle svg { fill: none; stroke: currentColor; display: block; }

        @media (max-width: 1024px) {
            .nav-inner { position: relative; }
            .nav-links {
                display: none;
                position: absolute;
                top: calc(100% + 1px); left: -24px; right: -24px;
                background: var(--bg);
                flex-direction: column;
                align-items: stretch;
                padding: 18px 24px 24px;
                gap: 4px;
                border-bottom: 1px solid var(--rule);
                box-shadow: 0 24px 48px rgba(0,0,0,0.4);
                z-index: 1000;
                animation: navOpen 0.22s ease-out;
            }
            @keyframes navOpen {
                from { opacity: 0; transform: translateY(-8px); }
                to { opacity: 1; transform: translateY(0); }
            }
            .nav-links.open { display: flex; }
            .nav-toggle { display: block; }
            .nav-company { display: none; }
            /* Mobile-menu items become rows with separators */
            .nav-links li {
                width: 100%;
                border-bottom: 1px solid var(--rule);
            }
            .nav-links li:last-child { border-bottom: none; }
            .nav-links a:not(.nav-cta) {
                display: block;
                padding: 14px 0;
                font-family: var(--display);
                font-size: 1.05rem;
                font-weight: 500;
                color: var(--text);
            }
            .nav-links a.active:not(.nav-cta)::after {
                left: 0; right: auto;
                bottom: auto; top: 50%;
                transform: translateY(-50%);
                width: 3px; height: 22px;
                background: var(--accent);
            }
            .nav-links a.active:not(.nav-cta) { padding-left: 14px; }
            .nav-links a:not(.nav-cta):hover { color: var(--accent); }
            /* Search expands to full width */
            .nav-search-wrap { padding: 14px 0; }
            .nav-search { min-width: 100%; padding: 10px 16px; }
            .nav-search input { font-size: 0.95rem; }
            .search-results { left: -24px; right: -24px; min-width: 0; max-height: 60vh; }
            /* Theme + CTA on a single row, opposite corners */
            .nav-links li.nav-row {
                width: 100%;
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 14px 0 4px;
                border-bottom: none;
                gap: 14px;
            }
            .nav-row .theme-toggle {
                padding: 8px 14px;
                font-size: 0.85rem;
                width: auto;
                justify-content: center;
            }
            .nav-row .nav-cta {
                padding: 12px 22px !important;
                font-size: 0.92rem !important;
                width: auto;
                white-space: nowrap;
            }
        }
        /* Desktop: theme + cta sit nicely side-by-side inside the same li */
        .nav-row { display: inline-flex; align-items: center; gap: 14px; }
        /* Force burger color visible on dark surface even after scroll */
        @media (max-width: 1024px) {
            .nav-toggle { color: var(--text); }
        }

        /* ─── Hero ─── */
        .hero {
            min-height: 95vh;
            display: flex;
            align-items: center;
            padding: 120px 0 80px;
            position: relative;
            overflow: hidden;
        }
        .hero::before {
            content: '';
            position: absolute;
            top: -200px;
            left: 50%;
            transform: translateX(-50%);
            width: 900px;
            height: 900px;
            background: radial-gradient(ellipse, rgba(99,102,241,0.1) 0%, transparent 65%);
            pointer-events: none;
        }
        .hero-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 80px;
            align-items: center;
        }
        .hero-badge {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            background: transparent;
            border: 1px solid var(--rule);
            padding: 6px 14px 6px 12px;
            border-radius: 4px;
            font-family: var(--mono);
            font-size: 0.72rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: var(--text-muted);
            margin-bottom: 28px;
            white-space: nowrap;
            max-width: 100%;
        }
        @media (max-width: 600px) {
            .hero-badge {
                font-size: 0.62rem;
                letter-spacing: 0.08em;
                padding: 5px 10px 5px 9px;
                gap: 8px;
            }
        }
        @media (max-width: 380px) {
            .hero-badge {
                white-space: normal;
                font-size: 0.6rem;
                line-height: 1.3;
            }
        }
        .hero-badge-dot {
            width: 6px;
            height: 6px;
            background: #10b981;
            border-radius: 50%;
            animation: pulse 2s infinite;
        }
        @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

        .hero-label {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: var(--secondary);
            margin-bottom: 16px;
        }
        .hero-title {
            font-size: clamp(2.6rem, 5.5vw, 4.8rem);
            font-weight: 700;
            line-height: 0.98;
            letter-spacing: -0.035em;
            margin-bottom: 14px;
        }
        .hero-title .g-text {
            font-style: italic;
            font-weight: 600;
        }
        .hero-company {
            font-family: var(--mono);
            font-size: 0.78rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.2em;
            color: var(--text-muted);
            margin-bottom: 26px;
            display: inline-flex;
            align-items: center;
            gap: 10px;
        }
        .hero-company::before {
            content: "—";
            color: var(--accent);
        }
        .hero-desc {
            font-size: 1.08rem;
            color: var(--text-muted);
            line-height: 1.7;
            max-width: 520px;
            margin-bottom: 42px;
        }
        .hero-actions {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
        }
        .btn-primary {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            background-image: var(--gradient);
            color: #ffffff;
            padding: 14px 28px;
            border-radius: 6px;
            font-family: var(--display);
            font-weight: 600;
            font-size: 0.92rem;
            letter-spacing: 0.01em;
            text-decoration: none;
            border: none;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.25s, background-image 0.3s, filter 0.3s;
        }
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 32px rgba(244,114,182,0.30);
            background-image: var(--grad-warm);
            color: #ffffff;
            filter: brightness(1.05);
        }
        .btn-secondary {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: transparent;
            color: var(--text);
            padding: 14px 26px;
            border-radius: 6px;
            font-family: var(--display);
            font-weight: 500;
            font-size: 0.92rem;
            letter-spacing: 0.01em;
            text-decoration: none;
            border: 1px solid var(--rule);
            transition: all 0.2s;
        }
        .btn-secondary:hover {
            border-color: var(--accent);
            color: var(--accent);
            background: rgba(251,191,36,0.04);
        }
        .hero-visual {
            position: relative;
            display: flex;
            justify-content: center;
        }
        .hero-img-wrap {
            position: relative;
            width: 100%;
            max-width: 500px;
        }
        .hero-img-glow {
            position: absolute;
            inset: -30px;
            background: var(--gradient);
            opacity: 0.12;
            filter: blur(70px);
            border-radius: 50%;
        }
        .hero-img {
            position: relative;
            width: 100%;
            border-radius: 24px;
            object-fit: cover;
            aspect-ratio: 4/5;
            border: 1px solid var(--border);
        }
        .hero-float {
            position: absolute;
            background: rgba(18,19,31,0.92);
            color: var(--text);
            border: 1px solid var(--border);
            border-radius: 14px;
            padding: 12px 16px;
            font-size: 0.78rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 10px;
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            box-shadow: 0 8px 24px rgba(0,0,0,0.25);
            animation: float 3s ease-in-out infinite;
            z-index: 5;
        }
        html.theme-light .hero-float {
            background: rgba(255,255,255,0.94);
            border: 1px solid rgba(11,13,26,0.10);
            color: #1a1d2e;
            box-shadow: 0 8px 24px rgba(11,13,26,0.10);
        }
        .hero-float-1 { top: 10%; right: -15px; animation-delay: 0s; }
        .hero-float-2 { bottom: 20%; left: -20px; animation-delay: 1.5s; }
        .hero-float-3 { bottom: 5%; right: 10%; animation-delay: 0.8s; }
        .hero-float-4 { top: 40%; left: -10%; animation-delay: 2.2s; }
        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }

        @media (max-width: 900px) {
            .hero-grid { grid-template-columns: 1fr; gap: 48px; }
            .hero-visual { order: -1; }
            .hero-img-wrap { max-width: 320px; }
        }

        /* ─── About strip ─── */
        .about-strip {
            border-top: 1px solid var(--border);
            border-bottom: 1px solid var(--border);
            background: var(--surface);
            padding: 60px 0;
        }
        .about-grid {
            display: grid;
            grid-template-columns: 1fr 1.5fr;
            gap: 80px;
            align-items: center;
        }
        .about-label {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: var(--primary);
            margin-bottom: 12px;
        }
        .about-title {
            font-size: 1.8rem;
            font-weight: 800;
            line-height: 1.2;
            letter-spacing: -0.02em;
        }
        .about-text {
            color: var(--text-muted);
            font-size: 1rem;
            line-height: 1.8;
        }
        .about-text p { margin-bottom: 16px; }
        .about-text strong { color: var(--text); }

        /* ─── Expertise ─── */
        .expertise { padding: 100px 0; }
        /* Editorial section label — uppercase + animated rule */
        .section-label {
            display: inline-flex;
            align-items: center;
            gap: 14px;
            font-family: var(--mono);
            font-size: 0.72rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.18em;
            color: var(--accent);
            margin-bottom: 16px;
        }
        .section-label::before {
            content: "";
            width: 28px; height: 1px;
            background: var(--accent);
            opacity: 0.7;
        }
        .section-title {
            font-size: clamp(1.9rem, 3.4vw, 3.1rem);
            font-weight: 700;
            letter-spacing: -0.025em;
            line-height: 1.05;
            margin-bottom: 18px;
        }
        .section-sub {
            color: var(--text-muted);
            font-size: 1.05rem;
            max-width: 560px;
        }
        .exp-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            margin-top: 56px;
        }
        .exp-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 32px 28px;
            transition: all 0.3s;
            position: relative;
            overflow: hidden;
        }
        .exp-card::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0;
            height: 2px;
            background: var(--gradient);
            opacity: 0;
            transition: opacity 0.3s;
        }
        .exp-card:hover { transform: translateY(-4px); border-color: rgba(99,102,241,0.25); }
        .exp-card:hover::before { opacity: 1; }
        .exp-icon {
            width: 52px;
            height: 52px;
            border-radius: 14px;
            background: rgba(99,102,241,0.08);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.4rem;
            margin-bottom: 20px;
        }
        .exp-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
        .exp-desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

        @media (max-width: 1100px) { .exp-grid { grid-template-columns: repeat(2, 1fr); } }
        @media (max-width: 600px) { .exp-grid { grid-template-columns: 1fr; } }

        /* ─── Blog ─── */
        .blog-section { background: var(--surface); padding: 80px 0; }
        .blog-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            margin-bottom: 48px;
        }
        .blog-link {
            color: var(--primary-light);
            text-decoration: none;
            font-weight: 500;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: gap 0.2s;
        }
        .blog-link:hover { gap: 10px; color: var(--primary-light); }
        .blog-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
        }
        .blog-card {
            background: var(--surface2);
            border: 1px solid var(--border);
            border-radius: 6px;
            overflow: hidden;
            text-decoration: none;
            color: inherit;
            display: block;
            transition: transform 0.3s, border-color 0.25s, box-shadow 0.3s;
        }
        .blog-card:hover {
            transform: translateY(-3px);
            border-color: var(--accent);
            box-shadow: 0 14px 32px rgba(0,0,0,0.25);
        }
        .blog-card-img,
        .blog-card-img-wrap { width: 100%; height: 200px; object-fit: cover; display: block; overflow: hidden; position: relative; }
        .blog-card-img-wrap::after {
            content: ""; position: absolute; inset: 0;
            background: linear-gradient(180deg, transparent 60%, rgba(10,11,20,0.3) 100%);
            pointer-events: none;
        }
        .blog-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
        .blog-card:hover .blog-card-img-wrap img { transform: scale(1.06); }
        .blog-card-body { padding: 22px 22px 24px; }
        .blog-card-date {
            font-family: var(--mono);
            font-size: 0.72rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: var(--text-muted);
            margin-bottom: 10px;
        }
        .blog-card-title {
            font-family: var(--display);
            font-weight: 600;
            font-size: 1.08rem;
            line-height: 1.25;
            letter-spacing: -0.015em;
            margin-bottom: 10px;
            color: var(--text);
        }
        .blog-card-excerpt { font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; }
        .blog-card:hover .blog-card-title { color: var(--accent); transition: color 0.2s; }
        @media (max-width: 900px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
        @media (max-width: 600px) { .blog-grid { grid-template-columns: 1fr; } .blog-header { flex-direction: column; align-items: flex-start; gap: 16px; } }

        /* ─── CTA ─── */
        .cta { padding: 100px 0; }
        .cta-box {
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
            border-radius: 32px;
            padding: 80px 60px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }
        .cta-box::before {
            content: '';
            position: absolute;
            top: -100px; right: -100px;
            width: 400px; height: 400px;
            background: rgba(255,255,255,0.04);
            border-radius: 50%;
        }
        .cta-title { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; margin-bottom: 16px; position: relative; }
        .cta-sub { font-size: 1.05rem; opacity: 0.85; margin-bottom: 32px; position: relative; }
        .cta-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: white;
            color: #4f46e5;
            padding: 16px 36px;
            border-radius: 50px;
            font-weight: 700;
            font-size: 1rem;
            text-decoration: none;
            transition: transform 0.2s, box-shadow 0.2s;
            position: relative;
        }
        .cta-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.3); color: #4f46e5; }
        @media (max-width: 600px) { .cta-box { padding: 48px 24px; } }

        /* ─── Contact ─── */
        .contact { padding: 100px 0; }
        .contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
        .contact-title { font-size: 2rem; font-weight: 800; margin-bottom: 16px; letter-spacing: -0.02em; }
        .contact-sub { color: var(--text-muted); font-size: 1rem; line-height: 1.7; margin-bottom: 12px; }
        .contact-link { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 600; text-decoration: none; padding: 12px 20px; background: rgba(99,102,241,0.1); border-radius: 12px; transition: all 0.2s; margin-top: 8px; }
        .contact-link:hover { background: rgba(99,102,241,0.2); transform: translateY(-1px); }
        .max-channel-btn { display: inline-flex; align-items: center; gap: 10px; background: var(--gradient); color: white; padding: 14px 28px; border-radius: 50px; font-weight: 700; font-size: 1rem; text-decoration: none; border: none; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; margin-top: 12px; box-shadow: 0 4px 16px rgba(99,102,241,0.25); }
        .max-channel-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(99,102,241,0.4); color: white; }
        .contact-intro { font-size: 1rem; color: var(--text-muted); line-height: 1.8; margin-bottom: 40px; }
        .contact-intro strong { color: var(--text); }

        .contact-form {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 24px;
            padding: 36px;
        }
        .form-group { margin-bottom: 16px; }
        .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
        .form-label { display: block; font-size: 0.8rem; font-weight: 500; margin-bottom: 8px; color: var(--text-muted); }
        .form-input {
            width: 100%;
            background: var(--surface2);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 12px 16px;
            color: var(--text);
            font-size: 0.95rem;
            font-family: inherit;
            transition: border-color 0.2s, box-shadow 0.2s;
            outline: none;
        }
        .form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
        .form-input::placeholder { color: var(--text-muted); }
        select.form-input { cursor: pointer; }
        textarea.form-input { resize: vertical; min-height: 120px; }
        .form-submit {
            width: 100%;
            background: var(--gradient);
            color: white;
            border: none;
            padding: 14px;
            border-radius: 12px;
            font-weight: 600;
            font-size: 1rem;
            cursor: pointer;
            transition: opacity 0.2s, transform 0.2s;
            font-family: inherit;
        }
        .form-submit:hover { opacity: 0.85; transform: translateY(-1px); }
        .form-msg { margin-top: 14px; font-size: 0.9rem; padding: 12px; border-radius: 10px; display: none; }
        .form-msg.error { background: rgba(239,68,68,0.1); color: #f87171; display: block; }
        .form-msg.success { background: rgba(16,185,129,0.1); color: #34d399; display: block; }

        @media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; gap: 48px; } }
        @media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }

        /* ─── Footer ─── */
        footer { border-top: 1px solid var(--border); padding: 60px 0 40px; background: var(--surface); }
        .footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
        .footer-brand { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 14px; }
        .footer-desc { color: var(--text-muted); font-size: 0.92rem; line-height: 1.65; }
        .footer-title {
            font-family: var(--mono);
            font-weight: 500;
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.18em;
            color: var(--accent);
            margin-bottom: 18px;
        }
        .footer-links { list-style: none; }
        .footer-links li { margin-bottom: 10px; }
        .footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
        .footer-links a:hover { color: var(--primary-light); }
        .footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap; gap: 12px; }
        .footer-meta-notice { font-size: 0.72rem; line-height: 1.5; color: var(--text-muted); opacity: 0.7; margin: 12px 0 0; }
        .footer-min .footer-meta-notice { width: 100%; text-align: center; }
        .footer-socials { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
        .footer-social {
            display: inline-flex; align-items: center; gap: 8px;
            padding: 6px 12px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 50px;
            color: var(--text-muted);
            font-size: 0.82rem;
            text-decoration: none;
            transition: all 0.15s;
        }
        .footer-social:hover { color: var(--text); border-color: rgba(99,102,241,0.4); }
        .footer-social--tg:hover { color: #29b6f6; border-color: rgba(41,182,246,0.4); }
        .footer-social--vk:hover { color: #0077FF; border-color: rgba(0,119,255,0.4); }
        .footer-social--max:hover { color: #FF5C28; border-color: rgba(255,92,40,0.4); }
        .footer-min .footer-socials .footer-social { padding: 4px; }
        .footer-min .footer-socials .footer-social svg,
        .footer-min .footer-socials .footer-social img { display: block; }
        @media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
        @media (max-width: 600px) {
            footer { padding-top: 32px; padding-bottom: 24px; }
            .footer-grid { grid-template-columns: 1fr; gap: 24px; margin-bottom: 24px; }
            .footer-grid > div:nth-child(2),
            .footer-grid > div:nth-child(3),
            .footer-grid > div:nth-child(4) { display: none; }
            .footer-bottom { flex-direction: column; gap: 8px; text-align: center; padding-top: 18px; font-size: 0.74rem; }
            .footer-brand { font-size: 1.2rem; margin-bottom: 8px; }
            .footer-desc { font-size: 0.86rem; }
        }

        @media (max-width: 768px) {
            .about-grid { grid-template-columns: 1fr; gap: 40px; }
            .section { padding: 64px 0; }
            .hero { min-height: auto; padding: 100px 0 60px; }
            .hero-title { font-size: clamp(2.2rem, 8vw, 3rem); }
        }

        /* ═══════════════════════════════════════════════════════ */
        /* === Blog list page (/blog) =========================== */
        /* ═══════════════════════════════════════════════════════ */
        .page-header { padding: 140px 0 48px; text-align: center; position: relative; overflow: hidden; background: linear-gradient(180deg, rgba(99,102,241,0.10) 0%, rgba(99,102,241,0.02) 60%, transparent 100%), var(--surface); border-bottom: 1px solid var(--border); }
        body.theme-light .page-header { background: linear-gradient(180deg, rgba(99,102,241,0.10) 0%, rgba(99,102,241,0.02) 60%, transparent 100%), #ffffff; }
        .page-header::before {
            content: '';
            position: absolute;
            top: -100px; left: 50%;
            transform: translateX(-50%);
            width: 600px; height: 600px;
            background: radial-gradient(ellipse, rgba(99,102,241,0.12) 0%, transparent 70%);
            pointer-events: none;
        }
        .page-title { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 900; letter-spacing: -0.03em; margin-bottom: 16px; line-height: 1.15; }
        .page-sub { color: var(--text-muted); font-size: 1.1rem; max-width: 500px; margin: 0 auto; }
        .blog-section--list { background: var(--bg); padding: 60px 0 100px; }
        .blog-section--list .blog-grid { grid-template-columns: repeat(3, 1fr); }
        @media (max-width: 1100px) { .blog-section--list .blog-grid { grid-template-columns: repeat(2, 1fr); } }
        .blog-section--list .blog-card-img,
        .blog-section--list .blog-card-img-wrap { height: 200px; }
        .blog-section--list .blog-card-body { padding: 20px 20px 24px; }
        .blog-section--list .blog-card-title { font-size: 1.05rem; word-break: break-word; line-height: 1.4; margin-bottom: 12px; }
        .blog-section--list .blog-card-excerpt { font-size: 0.95rem; line-height: 1.6; }
        @media (max-width: 600px) {
            .blog-section--list .page-header,
            body.page-blog .page-header { padding: 110px 0 32px; }
            .blog-section--list .blog-card-img-wrap { height: 160px; }
            .blog-section--list { padding: 40px 0 60px; }
            .page-title { font-size: clamp(1.8rem, 7vw, 2.5rem); }
            .blog-section--list .blog-grid { grid-template-columns: 1fr; }
        }

        /* ═══════════════════════════════════════════════════════ */
        /* === Single post page (/blog/:slug) =================== */
        /* ═══════════════════════════════════════════════════════ */
        body.page-post .container { max-width: 1200px; }
        body.page-post .post-body { max-width: 760px; margin-left: auto; margin-right: auto; }
        @media (min-width: 1100px) {
            body.page-post .post-layout:has(.post-toc:not([hidden])) .post-body { max-width: none; margin: 0; }
        }
        body.page-post { line-height: 1.55; }
        .post-header { padding: 140px 0 56px; position: relative; overflow: hidden; }
        .post-header::before {
            content: '';
            position: absolute;
            top: -100px; left: 50%;
            transform: translateX(-50%);
            width: 600px; height: 600px;
            background: radial-gradient(ellipse, rgba(99,102,241,0.08) 0%, transparent 70%);
            pointer-events: none;
        }
        .post-title {
            font-size: clamp(2rem, 4.5vw, 3.4rem);
            font-weight: 700;
            letter-spacing: -0.035em;
            line-height: 1.05;
            margin-bottom: 32px;
            max-width: 24ch;
        }
        .post-meta {
            display: flex; align-items: center; gap: 20px;
            font-family: var(--mono);
            color: var(--text-muted);
            font-size: 0.78rem;
            font-weight: 400;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            flex-wrap: wrap;
            padding-top: 18px;
            border-top: 1px solid var(--rule);
        }
        .post-meta span { display: flex; align-items: center; gap: 6px; }
        /* Post hero — preserve natural image proportions, no cropping.
           If image too tall (portrait) — cap at 75vh and letterbox via contain. */
        .post-hero-img {
            margin-top: 40px;
            border-radius: 6px;
            overflow: hidden;
            border: 1px solid var(--border);
            background: var(--surface2);
        }
        .post-hero-img img {
            width: 100%;
            height: auto;
            max-height: 75vh;
            object-fit: contain;
            display: block;
            margin: 0 auto;
        }
        .post-content { padding: 56px 0 32px; font-size: 1.08rem; line-height: 1.75; }
        .post-content h2 {
            font-size: 1.7rem; font-weight: 600;
            margin: 2.6rem 0 1rem;
            letter-spacing: -0.02em;
            line-height: 1.2;
            color: var(--text);
        }
        .post-content h3 {
            font-size: 1.25rem; font-weight: 600;
            margin: 1.8rem 0 0.75rem;
            letter-spacing: -0.01em;
            color: var(--text);
        }
        .post-content p { margin-bottom: 1.4rem; }
        .post-content > p:first-child::first-letter {
            font-family: var(--display);
            font-size: 3.6rem;
            font-weight: 600;
            float: left;
            line-height: 0.9;
            margin: 0.1em 0.12em 0 0;
            color: var(--accent);
        }
        .post-content ul, .post-content ol { margin: 1rem 0 1.6rem 1.5rem; }
        .post-content li { margin-bottom: 0.5rem; }
        .post-content strong { font-weight: 600; color: var(--text); }
        .post-content em { font-style: italic; color: var(--text); }
        .post-content a {
            color: var(--text);
            text-decoration: underline;
            text-decoration-color: var(--accent);
            text-decoration-thickness: 2px;
            text-underline-offset: 4px;
            transition: color 0.15s, text-decoration-color 0.15s;
        }
        .post-content a:hover { color: var(--accent); }
        .post-content blockquote {
            border-left: 3px solid var(--accent);
            padding: 8px 0 8px 1.6rem;
            margin: 2rem 0;
            color: var(--text-muted);
            font-style: italic;
            font-size: 1.12rem;
            line-height: 1.6;
        }

        /* AI-value вставка — обязательный блок в каждом посте Креативии:
           конкретные сценарии применения ИИ-агента к теме поста + мягкий CTA.
           Визуально отличается от основного текста, но не агрессивно — это
           часть контента, а не баннер. См. SKILL.md publish-post. */
        .post-content .post-ai-aside {
            margin: 2.4rem 0;
            padding: 18px 22px;
            background: color-mix(in srgb, var(--accent) 5%, var(--surface));
            border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--rule));
            border-left: 3px solid var(--accent);
            border-radius: 10px;
            font-size: 0.98rem;
            line-height: 1.6;
        }
        .post-content .post-ai-aside p { margin: 0 0 0.8rem; }
        .post-content .post-ai-aside p:last-child { margin-bottom: 0; }
        .post-content .post-ai-aside ul,
        .post-content .post-ai-aside ol {
            margin: 0.4rem 0 0.8rem 1.4rem;
        }
        .post-content .post-ai-aside li { margin-bottom: 0.3rem; }
        .post-content .post-ai-aside a {
            color: var(--text);
            font-weight: 600;
            text-decoration: underline;
            text-decoration-color: var(--accent);
            text-decoration-thickness: 2px;
            text-underline-offset: 4px;
        }
        .post-content .post-ai-aside a:hover { color: var(--accent); }
        .post-content code {
            font-family: var(--mono);
            font-size: 0.92em;
            padding: 2px 6px;
            background: var(--surface2);
            border-radius: 4px;
            border: 1px solid var(--rule);
        }
        .post-content pre {
            font-family: var(--mono);
            background: var(--surface);
            border: 1px solid var(--rule);
            border-radius: 6px;
            padding: 16px 18px;
            overflow-x: auto;
            margin: 1.6rem 0;
            font-size: 0.88rem;
            line-height: 1.6;
        }
        .post-content pre code { background: transparent; border: none; padding: 0; }

        /* Заголовки 4–6 уровней — на случай, если попадутся в посте */
        .post-content h4 {
            font-size: 1.08rem; font-weight: 600;
            margin: 1.4rem 0 0.6rem;
            color: var(--text);
        }
        .post-content h5, .post-content h6 {
            font-size: 1rem; font-weight: 600;
            margin: 1.2rem 0 0.5rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        /* Таблицы — фирменные границы, лёгкая зебра, акцентная подложка шапки */
        .post-content table {
            width: 100%;
            border-collapse: collapse;
            margin: 1.8rem 0;
            font-size: 0.96rem;
            line-height: 1.5;
            background: var(--surface);
            border: 1px solid var(--rule);
            border-radius: 8px;
            overflow: hidden;
        }
        .post-content thead { background: var(--surface2); }
        .post-content thead th {
            font-weight: 600;
            color: var(--text);
            text-align: left;
            padding: 10px 14px;
            border-bottom: 2px solid var(--accent);
            letter-spacing: -0.005em;
        }
        .post-content tbody td {
            padding: 10px 14px;
            border-bottom: 1px solid var(--rule);
            color: var(--text);
            vertical-align: top;
        }
        .post-content tbody tr:last-child td { border-bottom: none; }
        .post-content tbody tr:nth-child(even) td { background: var(--surface2); }
        .post-content tbody tr:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
        .post-content td.num, .post-content th.num {
            text-align: right;
            font-variant-numeric: tabular-nums;
        }
        .post-content table caption {
            caption-side: bottom;
            color: var(--text-muted);
            font-size: 0.88rem;
            padding-top: 8px;
            text-align: left;
            font-style: italic;
        }

        /* Разделитель */
        .post-content hr {
            border: none;
            height: 1px;
            background: var(--rule);
            margin: 2.4rem 0;
        }

        /* Картинки и подписи внутри тела поста */
        .post-content img {
            max-width: 100%;
            height: auto;
            display: block;
            margin: 1.6rem auto;
            border-radius: 8px;
            border: 1px solid var(--rule);
        }
        .post-content figure { margin: 1.8rem 0; }
        .post-content figcaption {
            text-align: center;
            color: var(--text-muted);
            font-size: 0.9rem;
            margin-top: 0.5rem;
            font-style: italic;
        }

        /* Inline-семантика: подсветка, клавиши, зачёркнутое */
        .post-content mark {
            background: color-mix(in srgb, var(--accent) 22%, transparent);
            color: var(--text);
            padding: 0 4px;
            border-radius: 3px;
        }
        .post-content kbd {
            font-family: var(--mono);
            font-size: 0.85em;
            padding: 2px 6px;
            background: var(--surface2);
            border: 1px solid var(--rule);
            border-bottom-width: 2px;
            border-radius: 4px;
            color: var(--text);
        }
        .post-content del { color: var(--text-muted); }
        .post-content sub, .post-content sup { font-size: 0.75em; line-height: 0; }

        @media (max-width: 600px) {
            .post-header { padding: 120px 0 32px; }
            .post-content h2 { font-size: 1.3rem; }
            /* Длинные таблицы скроллим горизонтально, а не ломаем верстку */
            .post-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
        }

        /* ═══════════════════════════════════════════════════════ */
        /* === Reactions (Telegram-style) ======================= */
        /* ═══════════════════════════════════════════════════════ */
        .reactions-wrap { display: flex; align-items: center; gap: 8px; padding: 16px 0; flex-wrap: wrap; position: relative; }
        .reaction {
            display: inline-flex; align-items: center; gap: 4px;
            background: var(--surface);
            border: 1px solid var(--border);
            padding: 6px 12px;
            border-radius: 50px;
            font-size: 1.1rem;
            cursor: pointer;
            transition: all 0.2s;
            opacity: 0.6;
        }
        .reaction:hover { transform: scale(1.1); border-color: var(--primary); opacity: 1; }
        .reaction.active { opacity: 1; border-color: var(--primary); background: rgba(99,102,241,0.15); }
        .reaction .count { font-size: 0.75rem; color: var(--text-muted); margin-left: 1px; }
        .reaction-picker {
            display: none; position: absolute;
            bottom: calc(100% + 8px); left: 0;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 10px;
            gap: 6px;
            flex-wrap: wrap;
            max-width: 280px;
            z-index: 100;
            box-shadow: 0 8px 32px rgba(0,0,0,0.4);
            backdrop-filter: blur(12px);
        }
        .reaction-picker.open { display: flex; }
        .picker-emoji {
            background: none; border: none; font-size: 1.5rem;
            cursor: pointer; padding: 6px 8px; border-radius: 10px;
            transition: all 0.15s;
        }
        .picker-emoji:hover { background: var(--border); transform: scale(1.2); }
        /* Add-reaction pill: same height as reaction chips, with smiley + plus + label */
        .reaction-add {
            display: inline-flex; align-items: center; gap: 4px;
            background: var(--surface); border: 1px solid var(--border);
            color: var(--text-muted);
            padding: 6px 12px;
            border-radius: 50px;
            font-size: 0.85rem; font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
            opacity: 0.85;
        }
        .reaction-add:hover {
            opacity: 1;
            color: var(--primary-light);
            border-color: rgba(99,102,241,0.4);
            background: rgba(99,102,241,0.08);
        }
        .reaction-add-icon { display: block; flex-shrink: 0; }
        .reaction-add-plus {
            font-weight: 700; font-size: 1rem;
            line-height: 1; margin-right: 2px;
            color: var(--primary-light);
        }
        .reaction-add-label {
            max-width: 0; overflow: hidden; white-space: nowrap;
            transition: max-width 0.2s ease, margin-left 0.2s ease;
            margin-left: 0;
        }
        .reaction-add:hover .reaction-add-label,
        .reaction-add:focus-visible .reaction-add-label {
            max-width: 80px;
            margin-left: 2px;
        }
        @media (max-width: 600px) {
            /* Always show label on mobile (no hover) */
            .reaction-add-label { max-width: 80px; margin-left: 2px; }
        }

        /* ═══════════════════════════════════════════════════════ */
        /* === Comments ========================================= */
        /* ═══════════════════════════════════════════════════════ */
        .comments-section { padding: 48px 0; }
        .comments-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 24px; }
        .comment { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 16px; }
        .comment-author { font-weight: 600; margin-bottom: 8px; }
        .comment-content { line-height: 1.6; }
        .no-comments { color: var(--text-muted); font-style: italic; }
        .comment-form { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px; margin-top: 32px; }
        .comment-form-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 20px; }
        .form-note { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px; font-style: italic; }
        body.page-post .form-submit { width: auto; padding: 14px 28px; }

        /* ═══════════════════════════════════════════════════════ */
        /* === Footer (minimal variant for /blog & /blog/:slug) ===*/
        /* ═══════════════════════════════════════════════════════ */
        .footer-min { border-top: 1px solid var(--border); padding: 48px 0; background: var(--surface); }
        .footer-min .footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
        .footer-links-inline { display: flex; gap: 24px; list-style: none; margin: 0; }
        .footer-links-inline li { margin: 0; }
        .footer-links-inline a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; transition: color 0.2s; }
        .footer-links-inline a:hover { color: var(--primary-light); }
        @media (max-width: 600px) {
            .footer-min { padding: 24px 0; }
            .footer-min .footer-inner { flex-direction: column; gap: 12px; text-align: center; justify-content: center; }
            .footer-min .footer-links-inline { display: none; }
            .footer-min .footer-copy { font-size: 0.74rem; }
        }

        /* ═══════════════════════════════════════════════════════ */
        /* === Inquiries page (/inquiries) ====================== */
        /* ═══════════════════════════════════════════════════════ */
        body.page-inquiries .container { max-width: 1200px; }
        .inquiries-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
        .inquiries-counter { font-size: 0.85rem; color: var(--text-muted); letter-spacing: 0.02em; }
        .btn-primary-sm { padding: 10px 22px; font-size: 0.9rem; }

        .inquiries-list { display: grid; gap: 16px; }
        .inquiry-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px; transition: border-color 0.2s; }
        .inquiry-card:hover { border-color: rgba(99,102,241,0.25); }
        .inquiry-card--pending { background: rgba(251,191,36,0.04); border-color: rgba(251,191,36,0.18); border-style: dashed; }
        .inquiry-pending-note { margin-top: 12px; padding: 10px 14px; border-left: 3px solid rgba(251,191,36,0.6); background: rgba(251,191,36,0.06); border-radius: 8px; color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; }
        .inquiry-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; font-size: 0.78rem; color: var(--text-muted); }
        .inquiry-status { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 50px; border: 1px solid var(--border); font-weight: 500; letter-spacing: 0.02em; }
        .inquiry-status--pending  { color: #fbbf24; border-color: rgba(251,191,36,0.25); background: rgba(251,191,36,0.08); }
        .inquiry-status--approved { color: #34d399; border-color: rgba(52,211,153,0.25); background: rgba(52,211,153,0.08); }
        .inquiry-status--rejected { color: #f87171; border-color: rgba(248,113,113,0.25); background: rgba(248,113,113,0.08); }
        .inquiry-author { font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
        .inquiry-content { color: var(--text); font-size: 0.95rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
        .inquiry-reply {
            margin-top: 16px;
            padding: 16px 18px 18px;
            background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(236,72,153,0.06));
            border: 1px solid rgba(99,102,241,0.18);
            border-radius: 14px;
        }
        .inquiry-reply-author { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 0.85rem; font-weight: 600; }
        .inquiry-reply-avatar {
            width: 26px; height: 26px; border-radius: 50%;
            background: var(--gradient);
            color: #fff; font-weight: 800;
            display: inline-flex; align-items: center; justify-content: center;
            font-size: 0.8rem;
        }
        .inquiry-reply-content { color: var(--text); font-size: 0.95rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

        /* ═══════════════════════════════════════════════════════ */
        /* === Reading progress bar (top) ======================= */
        /* ═══════════════════════════════════════════════════════ */
        .reading-progress {
            position: fixed; top: 0; left: 0;
            height: 3px; width: 0%;
            background: var(--gradient);
            z-index: 200;
            transition: width 0.08s linear;
            pointer-events: none;
        }

        /* ═══════════════════════════════════════════════════════ */
        /* === Tag cloud + chips ================================ */
        /* ═══════════════════════════════════════════════════════ */
        .tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; align-items: center; }
        .tag-cloud-overflow { display: none; gap: 8px; flex-wrap: wrap; align-items: center; }
        .tag-cloud-overflow.tag-cloud-overflow--open { display: contents; }
        .tag-chip--toggle {
            background: transparent;
            border: 1px dashed var(--border);
            color: var(--text-muted);
            cursor: pointer;
            font-family: inherit;
            font-size: 0.78rem;
        }
        .tag-chip--toggle:hover { color: var(--primary-light); border-color: rgba(99,102,241,0.4); border-style: solid; }
        .tag-chip {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 6px 14px;
            border-radius: 50px;
            background: var(--surface);
            border: 1px solid var(--border);
            color: var(--text-muted);
            font-size: 0.82rem;
            text-decoration: none;
            transition: all 0.15s;
        }
        .tag-chip:hover { color: var(--primary-light); border-color: rgba(99,102,241,0.3); }
        .tag-chip--active { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.4); color: var(--primary-light); }
        .tag-chip-count { font-size: 0.7rem; opacity: 0.7; padding: 1px 6px; background: rgba(255,255,255,0.05); border-radius: 50px; }

        .post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
        .post-tag {
            font-size: 0.78rem; color: var(--text-muted);
            background: var(--surface); border: 1px solid var(--border);
            padding: 4px 10px; border-radius: 50px;
            text-decoration: none; transition: color 0.15s, border-color 0.15s;
        }
        .post-tag:hover { color: var(--primary-light); border-color: rgba(99,102,241,0.3); }

        /* ═══════════════════════════════════════════════════════ */
        /* === Blog toolbar + push button ======================= */
        /* ═══════════════════════════════════════════════════════ */
        .blog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
        .blog-toolbar-info { color: var(--text-muted); font-size: 0.85rem; }
        .push-subscribe-btn {
            display: inline-flex; align-items: center; gap: 8px;
            padding: 8px 16px; border-radius: 50px;
            background: var(--surface); border: 1px solid var(--border);
            color: var(--text); font-size: 0.85rem; font-family: inherit;
            cursor: pointer; transition: all 0.2s;
        }
        .push-subscribe-btn:hover { border-color: rgba(99,102,241,0.3); color: var(--primary-light); }
        .push-subscribe-btn--on { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: #34d399; }
        .push-subscribe-btn--on:hover { background: rgba(16,185,129,0.15); color: #6ee7b7; }

        /* ═══════════════════════════════════════════════════════ */
        /* === Pagination ======================================= */
        /* ═══════════════════════════════════════════════════════ */
        .pagination {
            display: flex; align-items: center; justify-content: center;
            gap: 12px; margin: 60px 0 0; flex-wrap: wrap;
        }
        .pagination-pages { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
        .pagination-btn {
            display: inline-flex; align-items: center; justify-content: center;
            gap: 6px; min-width: 40px; height: 40px; padding: 0 14px;
            border-radius: 10px; background: var(--surface);
            border: 1px solid var(--border); color: var(--text);
            font-size: 0.9rem; font-weight: 500; text-decoration: none;
            transition: all 0.2s; cursor: pointer;
        }
        .pagination-btn:hover:not(.pagination-btn--disabled):not(.pagination-btn--active) {
            border-color: rgba(99,102,241,0.4); color: var(--primary-light);
            transform: translateY(-1px);
        }
        .pagination-btn--active {
            background: var(--primary); border-color: var(--primary);
            color: #fff; cursor: default;
        }
        .pagination-btn--disabled {
            opacity: 0.4; cursor: not-allowed;
        }
        .pagination-btn--nav { padding: 0 16px; }
        .pagination-ellipsis {
            color: var(--text-muted); padding: 0 6px;
            user-select: none;
        }
        @media (max-width: 600px) {
            .pagination { gap: 8px; margin-top: 40px; }
            .pagination-btn { min-width: 36px; height: 36px; padding: 0 10px; font-size: 0.85rem; }
            .pagination-btn--nav .pagination-btn-label,
            .pagination-btn--nav { padding: 0 10px; }
        }

        /* ═══════════════════════════════════════════════════════ */
        /* === Skeleton loaders ================================= */
        /* ═══════════════════════════════════════════════════════ */
        @keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
        .blog-card--skeleton { pointer-events: none; }
        .skeleton-shimmer, .skeleton-line {
            background: linear-gradient(90deg, var(--surface) 0%, var(--surface2) 40%, var(--surface) 80%);
            background-size: 800px 100%;
            animation: shimmer 1.4s infinite linear;
            border-radius: 6px;
        }
        .skeleton-shimmer { width: 100%; height: 100%; min-height: 180px; }
        .skeleton-line { height: 12px; margin-bottom: 10px; }
        .skeleton-line--xs { width: 30%; height: 9px; }
        .skeleton-line--md { width: 70%; }
        .skeleton-line--lg { width: 90%; height: 18px; }

        /* ═══════════════════════════════════════════════════════ */
        /* === Share bar ======================================== */
        /* ═══════════════════════════════════════════════════════ */
        .share-bar { display: flex; align-items: center; gap: 8px; padding: 12px 0 4px; flex-wrap: wrap; }
        .share-label { color: var(--text-muted); font-size: 0.82rem; margin-right: 4px; }
        .share-btn {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 7px 14px;
            border-radius: 50px;
            background: var(--surface);
            border: 1px solid var(--border);
            color: var(--text-muted);
            font-size: 0.82rem;
            text-decoration: none;
            cursor: pointer;
            transition: all 0.15s;
            font-family: inherit;
        }
        .share-btn:hover { color: var(--text); border-color: rgba(99,102,241,0.3); transform: translateY(-1px); }
        .share-btn--tg:hover { color: #29b6f6; border-color: rgba(41,182,246,0.4); }
        .share-btn--max:hover { color: #00a8ff; border-color: rgba(0,168,255,0.4); }
        .share-btn--vk:hover { color: #4a76a8; border-color: rgba(74,118,168,0.4); }
        .share-btn--ok:hover { color: #ee8208; border-color: rgba(238,130,8,0.4); }
        .share-btn--wa:hover { color: #25d366; border-color: rgba(37,211,102,0.4); }
        .share-btn--viber:hover { color: #7360f2; border-color: rgba(115,96,242,0.4); }
        .share-btn--x:hover { color: #ffffff; border-color: rgba(255,255,255,0.4); }
        .share-btn--mail:hover { color: #f59e0b; border-color: rgba(245,158,11,0.4); }
        .share-btn--copy:hover { color: #34d399; border-color: rgba(52,211,153,0.4); }
        @media (max-width: 600px) {
            .share-btn { padding: 7px 10px; }
            .share-btn-label { display: none; }
            .share-label { width: 100%; margin-bottom: 4px; }
        }

        /* ═══════════════════════════════════════════════════════ */
        /* === Post navigation (prev / next) ==================== */
        /* ═══════════════════════════════════════════════════════ */
        .post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 32px 0 8px; }
        .post-nav-link {
            display: flex; flex-direction: column; gap: 6px;
            padding: 18px 22px;
            background: var(--surface); border: 1px solid var(--border);
            border-radius: 16px;
            text-decoration: none;
            transition: all 0.2s;
        }
        .post-nav-link:hover { transform: translateY(-2px); border-color: rgba(99,102,241,0.3); }
        .post-nav-link--next { text-align: right; }
        .post-nav-dir { color: var(--text-muted); font-size: 0.78rem; letter-spacing: 0.02em; text-transform: uppercase; font-weight: 600; }
        .post-nav-title { color: var(--text); font-size: 0.95rem; font-weight: 600; line-height: 1.4; }
        @media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } .post-nav-link--next { text-align: left; } }

        /* ═══════════════════════════════════════════════════════ */
        /* === 404 / error page ================================= */
        /* ═══════════════════════════════════════════════════════ */
        .error-page { min-height: 80vh; display: flex; align-items: center; padding: 140px 0 80px; position: relative; overflow: hidden; }
        .error-page .container { text-align: center; }
        .error-glow {
            position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
            width: 700px; height: 700px;
            background: radial-gradient(ellipse, rgba(99,102,241,0.12) 0%, transparent 70%);
            pointer-events: none; z-index: 0;
        }
        .error-page > * { position: relative; z-index: 1; }
        .error-code { font-size: clamp(5rem, 18vw, 12rem); font-weight: 900; letter-spacing: -0.05em; line-height: 1; }
        .error-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin-top: 16px; letter-spacing: -0.02em; }
        .error-sub { color: var(--text-muted); font-size: 1rem; max-width: 480px; margin: 16px auto 32px; line-height: 1.7; }
        .error-actions { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

        /* ═══════════════════════════════════════════════════════ */
        /* === Comment threading + reply banner ================= */
        /* ═══════════════════════════════════════════════════════ */
        .comment-author-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
        .comment-author-badge {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 2px 8px;
            border-radius: 50px;
            background: rgba(99,102,241,0.12);
            color: var(--primary-light);
            font-size: 0.7rem; font-weight: 600;
            letter-spacing: 0.02em;
        }
        .comment-actions { margin-top: 10px; }
        .comment-reply-btn {
            background: none; border: none; padding: 0;
            color: var(--text-muted); font-size: 0.8rem;
            cursor: pointer; font-family: inherit;
            transition: color 0.15s;
        }
        .comment-reply-btn:hover { color: var(--primary-light); }
        .comment-children { margin-top: 14px; padding-left: 20px; border-left: 2px solid var(--border); display: grid; gap: 14px; }
        .comment--author {
            background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(236,72,153,0.04));
            border-color: rgba(99,102,241,0.18);
        }

        .reply-banner {
            display: none;
            align-items: center; justify-content: space-between;
            gap: 12px;
            padding: 10px 14px;
            background: rgba(99,102,241,0.08);
            border: 1px solid rgba(99,102,241,0.2);
            border-radius: 10px;
            margin-bottom: 12px;
            font-size: 0.85rem;
        }
        .reply-banner-clear {
            background: none; border: none; cursor: pointer;
            color: var(--text-muted); font-size: 1.1rem;
            font-family: inherit;
        }
        .reply-banner-clear:hover { color: var(--text); }

        /* ═══════════════════════════════════════════════════════ */
        /* === Admin panel (/admin) ============================= */
        /* ═══════════════════════════════════════════════════════ */
        body.page-admin .container { max-width: 980px; }
        .admin-stats { margin-bottom: 28px; }
        .stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
        @media (max-width: 800px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
        .stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; text-align: left; }
        .stat-card--warn { background: linear-gradient(135deg, rgba(251,191,36,0.08), rgba(236,72,153,0.06)); border-color: rgba(251,191,36,0.25); }
        .stat-num { font-size: 1.6rem; font-weight: 800; }
        .stat-label { color: var(--text-muted); font-size: 0.78rem; margin-top: 4px; }
        .stat-top { margin-top: 16px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; font-size: 0.9rem; }
        .stat-top ol { margin: 8px 0 0 1.2rem; color: var(--text-muted); }
        .stat-top a { color: var(--primary-light); text-decoration: none; }

        .admin-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
        .admin-tab {
            background: var(--surface); border: 1px solid var(--border);
            color: var(--text-muted); font-family: inherit; font-size: 0.9rem;
            padding: 8px 18px; border-radius: 50px; cursor: pointer;
            transition: all 0.15s;
        }
        .admin-tab:hover { color: var(--text); }
        .admin-tab--active { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.4); color: var(--primary-light); }

        .admin-list { display: grid; gap: 14px; }
        .moderation-card { background: var(--surface); border: 1px solid rgba(251,191,36,0.18); border-radius: 16px; padding: 18px 20px; }
        .moderation-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; font-size: 0.78rem; color: var(--text-muted); }
        .moderation-meta a { color: var(--primary-light); }
        .moderation-reply { margin-top: 12px; }
        .moderation-reply-text { min-height: 80px; }
        .moderation-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
        .moderation-actions .form-submit, .moderation-actions .btn-secondary { width: auto; padding: 10px 18px; font-size: 0.88rem; }
        .moderation-reject { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-family: inherit; }
        .moderation-reject:hover { color: #f87171; border-color: rgba(248,113,113,0.3); }

/* ─── Admin login ─── */
.admin-login-section { min-height: 80vh; display: flex; align-items: center; padding: 80px 0; }
.container--narrow { max-width: 440px; }
.admin-login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 36px 32px; }
.admin-login-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 6px; }
.admin-login-sub { color: var(--text-muted); margin-bottom: 24px; font-size: 0.92rem; }
.admin-login-form { display: flex; flex-direction: column; gap: 14px; }
.form-label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.form-error { color: #f87171; padding: 10px 14px; background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.25); border-radius: 8px; font-size: 0.9rem; }

/* ─── Admin nav и shared ─── */
.admin-nav .nav-user { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.admin-nav .nav-user-name { color: var(--text); font-size: 0.85rem; font-weight: 600; }
.admin-nav .nav-logout { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 0.8rem; font-family: inherit; }
.admin-nav .nav-logout:hover { color: var(--text); border-color: rgba(248,113,113,0.4); }
.admin-nav .nav-links a.active { color: var(--primary-light); }

.admin-toast-host { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.admin-toast { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 18px; color: var(--text); font-size: 0.9rem; max-width: 360px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); animation: toastIn 0.2s ease-out; }
.admin-toast--success { border-color: rgba(52,211,153,0.4); }
.admin-toast--error { border-color: rgba(248,113,113,0.4); }
.admin-toast--out { opacity: 0; transform: translateY(8px); transition: all 0.2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.admin-h2 { font-size: 1.2rem; font-weight: 700; margin: 32px 0 16px; }
.admin-log { list-style: none; display: flex; flex-direction: column; gap: 8px; padding: 0; }
.admin-log-item { display: grid; grid-template-columns: auto auto 1fr auto; gap: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 0.85rem; align-items: center; }
.admin-log-time { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-log-kind { font-family: monospace; font-size: 0.78rem; padding: 2px 8px; border-radius: 6px; background: rgba(99,102,241,0.1); color: var(--primary-light); white-space: nowrap; }
.admin-log-kind--login { background: rgba(52,211,153,0.1); color: #34d399; }
.admin-log-kind--post { background: rgba(99,102,241,0.1); color: var(--primary-light); }
.admin-log-kind--comment { background: rgba(236,72,153,0.1); color: var(--secondary); }
.admin-log-kind--inquiry { background: rgba(251,191,36,0.1); color: #fbbf24; }
.admin-log-summary { color: var(--text); }
.admin-log-user { color: var(--text-muted); font-size: 0.78rem; }
.admin-log-empty { color: var(--text-muted); padding: 14px; text-align: center; }
.admin-quick-links { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.page-header--compact { padding: 100px 0 30px; }
@media (max-width: 768px) {
  .admin-log-item { grid-template-columns: 1fr; gap: 4px; }
  .admin-nav .nav-user { margin-left: 0; }
}

/* === Admin control center extensions === */
.stat-card .stat-num { font-family: var(--display); font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-top: 6px; }
.stat-card .stat-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; opacity: 0.8; }
.stat-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 24px; }
@media (max-width: 800px) { .stat-cols { grid-template-columns: 1fr; } }
.stat-block { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px; }
.stat-block strong { font-family: var(--display); font-size: 0.95rem; display: block; margin-bottom: 10px; color: var(--text); }
.stat-block ul, .stat-block ol { margin: 0; padding-left: 20px; }
.stat-block li { font-size: 0.86rem; line-height: 1.6; color: var(--text-muted); }
.stat-block li a { color: var(--text); text-decoration: none; }
.stat-block li a:hover { color: var(--accent); }
.stat-block li small { color: var(--text-muted); font-family: var(--mono); font-size: 0.72rem; opacity: 0.7; }
.stat-block li.muted { color: var(--text-muted); list-style: none; }

.admin-cron { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.cron-row { display: grid; grid-template-columns: 14px 1.5fr 2fr; align-items: center; gap: 14px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; font-size: 0.88rem; }
.cron-status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); }
.cron-row--ok .cron-status-dot { background: #22c55e; }
.cron-row--err .cron-status-dot { background: #ef4444; }
.cron-row--err { border-color: rgba(239,68,68,0.4); }
.cron-row--stale .cron-status-dot { background: #f59e0b; }
.cron-row--disabled .cron-status-dot { background: #6b7280; }
.cron-row--disabled { opacity: 0.6; }
.cron-name { font-weight: 600; color: var(--text); }
.cron-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.78rem; color: var(--text-muted); align-items: center; }
.cron-meta code { font-family: var(--mono); font-size: 0.78rem; padding: 2px 6px; background: var(--surface2); border-radius: 4px; }
.cron-err { color: #fca5a5; cursor: help; }
.cron-disabled { color: var(--text-muted); font-style: italic; }
@media (max-width: 768px) {
  .cron-row { grid-template-columns: 14px 1fr; gap: 8px; }
  .cron-meta { grid-column: 2; }
}

.admin-queue { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.queue-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; align-items: center; }
.queue-kind { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.queue-kind--inquiry { color: var(--accent); }
.queue-kind--comment { color: var(--primary-light); }
.queue-meta { font-size: 0.85rem; margin-bottom: 6px; }
.queue-meta a { color: var(--primary-light); }
.queue-meta small { color: var(--text-muted); margin-left: 6px; font-family: var(--mono); font-size: 0.74rem; }
.queue-content { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; }
.queue-actions { display: flex; gap: 6px; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
@media (max-width: 768px) {
  .queue-row { grid-template-columns: 1fr; }
  .queue-actions { justify-content: flex-end; }
}

.admin-tools { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.tool-row { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; font-size: 0.88rem; }
.tool-row-icon { font-size: 1.2rem; }
.tool-row-name { color: var(--text); text-decoration: none; font-weight: 500; }
.tool-row-name:hover { color: var(--accent); }
.tool-row-usage { font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); }
.tool-row-usage strong { color: var(--text); }
.tool-row-badge { font-family: var(--mono); font-size: 0.66rem; text-transform: uppercase; padding: 2px 6px; background: var(--surface2); border: 1px solid var(--rule); border-radius: 4px; color: var(--text-muted); }
.tool-row--draft { opacity: 0.6; }

.muted { color: var(--text-muted); }

/* ─── Admin posts list ─── */
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.btn-primary-sm { padding: 8px 18px !important; font-size: 0.85rem !important; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-danger { background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.3); padding: 10px 18px; border-radius: 50px; cursor: pointer; font-weight: 600; font-family: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.btn-danger:hover { background: rgba(248,113,113,0.2); color: #f87171; }
.admin-filters { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-filters .form-input { flex: 1; min-width: 200px; }
.admin-filters select.form-input { flex: 0 0 200px; }

.admin-posts-list { display: flex; flex-direction: column; gap: 8px; }
.admin-post-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; align-items: center; }
.admin-post-row:hover { border-color: rgba(99,102,241,0.3); }
.admin-post-main { min-width: 0; flex: 1; }
.admin-post-title { font-size: 1rem; font-weight: 600; color: var(--text); text-decoration: none; }
.admin-post-title:hover { color: var(--primary-light); }
.admin-post-meta { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.78rem; margin-top: 4px; flex-wrap: wrap; }
.admin-post-slug { font-family: monospace; padding: 1px 6px; background: rgba(255,255,255,0.04); border-radius: 4px; }
.admin-post-tag { padding: 1px 8px; background: rgba(99,102,241,0.1); color: var(--primary-light); border-radius: 50px; font-size: 0.72rem; }
.admin-post-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.no-comments { color: var(--text-muted); padding: 20px; text-align: center; }

.admin-drafts-list { display: flex; flex-direction: column; gap: 6px; }
.admin-draft-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 10px 14px; background: var(--surface2); border: 1px dashed var(--border); border-radius: 10px; }
.admin-draft-row code { font-size: 0.78rem; color: var(--text-muted); }
.admin-draft-title { color: var(--text); font-size: 0.92rem; }

.form-input { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 10px 14px; border-radius: 10px; font-size: 0.92rem; font-family: inherit; }
.form-input:focus { outline: none; border-color: rgba(99,102,241,0.5); }

@media (max-width: 768px) {
  .admin-post-row { flex-direction: column; align-items: stretch; }
  .admin-post-actions { flex-wrap: wrap; }
  .admin-draft-row { grid-template-columns: 1fr auto; }
  .admin-draft-row code, .admin-draft-row .admin-draft-title { grid-column: 1 / -1; }
}

/* ─── Admin post editor ─── */
.admin-breadcrumb { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 8px; }
.admin-breadcrumb a { color: var(--primary-light); text-decoration: none; margin-right: 8px; }
.admin-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.admin-edit-form { display: flex; flex-direction: column; gap: 14px; }
.admin-edit-preview { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; max-height: 80vh; overflow-y: auto; position: sticky; top: 80px; }
.admin-edit-preview-h { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 16px; }
.admin-preview-body { color: var(--text); }
.admin-preview-body h1 { font-size: 2rem; font-weight: 800; margin-bottom: 16px; line-height: 1.2; }
.admin-preview-body h2 { font-size: 1.4rem; margin: 24px 0 12px; font-weight: 700; }
.admin-preview-body h3 { font-size: 1.15rem; margin: 18px 0 10px; font-weight: 700; }
.admin-preview-body p { margin: 12px 0; line-height: 1.7; }
.admin-preview-body ul, .admin-preview-body ol { margin: 12px 0; padding-left: 24px; }
.admin-preview-body li { margin: 4px 0; }
.admin-preview-body blockquote { border-left: 3px solid var(--primary); padding-left: 16px; color: var(--text-muted); margin: 16px 0; }
.admin-preview-body code { background: var(--surface2); padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 0.9em; }
.admin-preview-body a { color: var(--primary-light); }

.form-input--code { font-family: 'Fira Code', Consolas, monospace; font-size: 0.85rem; line-height: 1.5; min-height: 320px; }
.form-hint { color: var(--text-muted); font-size: 0.75rem; font-weight: normal; }
.admin-toolbar-mini { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.admin-toolbar-mini button { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 4px 10px; border-radius: 6px; font-family: monospace; font-size: 0.78rem; cursor: pointer; }
.admin-toolbar-mini button:hover { border-color: rgba(99,102,241,0.4); color: var(--primary-light); }

.admin-image-preview { max-width: 240px; max-height: 140px; border-radius: 8px; margin-top: 8px; object-fit: cover; }
.admin-toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 1024px) {
  .admin-edit-grid { grid-template-columns: 1fr; }
  .admin-edit-preview { position: static; max-height: none; }
}

/* ─── Admin comments + inquiries ─── */
.admin-mode-tabs { display: flex; gap: 8px; margin-top: 16px; }
.admin-comments-feed { display: flex; flex-direction: column; gap: 14px; }
.tree-group { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 12px; }
.tree-group summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.tree-group summary a { color: var(--primary-light); margin-right: 8px; text-decoration: none; }
.muted { color: var(--text-muted); font-size: 0.85rem; }
.tree-body { margin-top: 12px; }
.tree-node { padding: 8px 0; border-left: 2px solid rgba(99,102,241,0.15); padding-left: 12px; margin-top: 8px; }
.tree-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.88rem; }
.tree-content { color: var(--text); margin: 6px 0; font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; }
.tree-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tree-actions button { padding: 3px 10px; font-size: 0.78rem; cursor: pointer; border-radius: 6px; font-family: inherit; }
.moderation-existing-reply { padding: 8px 12px; margin: 8px 0; background: rgba(99,102,241,0.08); border-left: 3px solid var(--primary); border-radius: 6px; font-size: 0.88rem; color: var(--text-muted); }
.moderation-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; }
.moderation-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; font-size: 0.78rem; color: var(--text-muted); }
.moderation-meta a { color: var(--primary-light); text-decoration: none; }
.moderation-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.moderation-reply { margin-top: 10px; }
.moderation-reply-text { width: 100%; min-height: 70px; resize: vertical; }

        /* ═══════════════════════════════════════════════════════ */
        /* === Post layout with TOC ============================= */
        /* ═══════════════════════════════════════════════════════ */
        .post-layout { display: block; }
        .post-toc { display: none; }
        .post-toc[hidden] { display: none !important; }
        @media (min-width: 1100px) {
            .post-layout:has(.post-toc:not([hidden])) {
                display: grid;
                grid-template-columns: 240px 1fr;
                gap: 48px;
                align-items: start;
            }
            .post-toc:not([hidden]) {
                display: block;
                position: sticky;
                top: 90px;
                background: var(--surface);
                border: 1px solid var(--border);
                border-radius: 14px;
                padding: 16px;
                font-size: 0.86rem;
                max-height: calc(100vh - 110px);
                overflow-y: auto;
            }
            .post-toc-header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                color: var(--text-muted);
                font-weight: 600;
                text-transform: uppercase;
                font-size: 0.72rem;
                letter-spacing: 0.05em;
                margin-bottom: 12px;
                padding-bottom: 12px;
                border-bottom: 1px solid var(--border);
            }
            .post-toc-toggle {
                background: none; border: none; color: var(--text-muted);
                font-size: 1.1rem; cursor: pointer; line-height: 1; padding: 0 6px;
            }
            .post-toc-toggle:hover { color: var(--primary-light); }
            .post-toc--collapsed .post-toc-list { display: none; }
            .post-toc-list { display: flex; flex-direction: column; gap: 4px; }
            .post-toc-item {
                color: var(--text-muted);
                text-decoration: none;
                padding: 6px 8px;
                border-radius: 6px;
                border-left: 2px solid transparent;
                line-height: 1.4;
                transition: all 0.15s;
            }
            .post-toc-item--h3 { padding-left: 20px; font-size: 0.82rem; }
            .post-toc-item:hover { color: var(--text); background: var(--surface2); }
            .post-toc-item--active {
                color: var(--primary-light);
                border-left-color: var(--primary);
                background: rgba(99,102,241,0.08);
            }
        }

        /* ═══════════════════════════════════════════════════════ */
        /* === Sticky CTA + Modal =============================== */
        /* ═══════════════════════════════════════════════════════ */
        .post-sticky-cta {
            position: fixed;
            bottom: 24px;
            right: 24px;
            z-index: 50;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 14px 22px;
            background: var(--gradient);
            color: #fff;
            border: none;
            border-radius: 50px;
            font-weight: 600;
            font-size: 0.95rem;
            cursor: pointer;
            box-shadow: 0 10px 32px rgba(99,102,241,0.4);
            transition: all 0.25s;
            font-family: inherit;
        }
        .post-sticky-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(99,102,241,0.55); }
        @media (max-width: 600px) {
            .post-sticky-cta { bottom: 16px; right: 16px; padding: 12px 16px; font-size: 0.85rem; }
            .post-sticky-cta span { display: none; }
        }

        .cta-modal {
            position: fixed; inset: 0; z-index: 100;
            display: flex; align-items: center; justify-content: center;
            padding: 20px;
        }
        .cta-modal[hidden] { display: none; }
        .cta-modal-overlay {
            position: absolute; inset: 0;
            background: rgba(0,0,0,0.7);
            backdrop-filter: blur(6px);
        }
        .cta-modal-card {
            position: relative;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 18px;
            padding: 32px;
            max-width: 540px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            animation: modalIn 0.25s ease-out;
        }
        @keyframes modalIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
        .cta-modal-close {
            position: absolute; top: 12px; right: 12px;
            width: 36px; height: 36px;
            background: transparent; border: none;
            color: var(--text-muted);
            font-size: 1.5rem; cursor: pointer;
            border-radius: 50%; transition: all 0.15s;
        }
        .cta-modal-close:hover { background: var(--surface2); color: var(--text); }
        .cta-modal-header { margin-bottom: 20px; }
        .cta-modal-header h3 { font-size: 1.4rem; margin: 6px 0 8px; }
        .cta-modal-sub { color: var(--text-muted); font-size: 0.9rem; }
        .contact-form--compact .form-row { grid-template-columns: 1fr; }

        /* ═══════════════════════════════════════════════════════ */
        /* === Theme toggle button ============================== */
        /* ═══════════════════════════════════════════════════════ */
        .theme-toggle {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 6px 12px;
            background: var(--surface2);
            border: 1px solid var(--border);
            color: var(--text-muted);
            border-radius: 50px;
            font-size: 0.82rem;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.15s;
        }
        .theme-toggle:hover { color: var(--text); border-color: rgba(99,102,241,0.4); }
        .theme-toggle .theme-toggle-icon-light,
        .theme-toggle .theme-toggle-icon-dark { display: none; }
        html.theme-light .theme-toggle .theme-toggle-icon-dark { display: inline-block; }
        html:not(.theme-light) .theme-toggle .theme-toggle-icon-light { display: inline-block; }

        /* ═══════════════════════════════════════════════════════ */
        /* === Bookmarks ======================================== */
        /* ═══════════════════════════════════════════════════════ */
        .bookmark-btn {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 7px 14px;
            background: var(--surface);
            border: 1px solid var(--border);
            color: var(--text-muted);
            border-radius: 50px;
            font-size: 0.82rem;
            cursor: pointer;
            transition: all 0.15s;
            font-family: inherit;
        }
        .bookmark-btn:hover { color: var(--text); border-color: rgba(99,102,241,0.3); }
        .bookmark-btn--on { color: #fbbf24; border-color: rgba(251,191,36,0.4); background: rgba(251,191,36,0.06); }
        .bookmark-btn--on:hover { color: #fcd34d; }
        .bookmark-count {
            display: inline-block;
            min-width: 18px;
            padding: 0 5px;
            background: var(--accent);
            color: var(--bg);
            border-radius: 9px;
            font-family: var(--mono);
            font-size: 0.66rem;
            font-weight: 600;
            line-height: 18px;
            text-align: center;
            margin-left: 6px;
            vertical-align: middle;
        }
        .bookmark-count[hidden] { display: none !important; }
        .bookmarks-empty {
            text-align: center;
            color: var(--text-muted);
            padding: 60px 20px;
            font-size: 0.95rem;
        }

        /* ═══════════════════════════════════════════════════════ */
        /* === Related posts ==================================== */
        /* ═══════════════════════════════════════════════════════ */
        .related-posts {
            margin: 48px 0 16px;
            padding: 32px 0 8px;
            border-top: 1px solid var(--border);
        }
        .related-posts .section-label { margin-bottom: 16px; }
        .related-posts .blog-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
        @media (max-width: 800px) { .related-posts .blog-grid { grid-template-columns: 1fr; } }

        /* ═══════════════════════════════════════════════════════ */
        /* === Search box in nav ================================ */
        /* ═══════════════════════════════════════════════════════ */
        .nav-search {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background: var(--surface2);
            border: 1px solid var(--border);
            border-radius: 50px;
            min-width: 180px;
            transition: all 0.15s;
        }
        .nav-search:focus-within { border-color: rgba(99,102,241,0.4); }
        .nav-search input {
            background: transparent;
            border: none;
            outline: none;
            color: var(--text);
            font-family: inherit;
            font-size: 0.86rem;
            width: 100%;
        }
        .nav-search-icon { color: var(--text-muted); flex-shrink: 0; }
        .search-results {
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 14px;
            min-width: 360px;
            max-height: 480px;
            overflow-y: auto;
            box-shadow: 0 16px 48px rgba(0,0,0,0.5);
            z-index: 50;
            padding: 8px;
        }
        .search-results[hidden] { display: none; }
        .search-result-item {
            display: block;
            padding: 10px 12px;
            border-radius: 8px;
            text-decoration: none;
            color: var(--text);
            transition: background 0.1s;
        }
        .search-result-item:hover { background: var(--surface2); }
        .search-result-title { font-size: 0.92rem; font-weight: 500; margin-bottom: 4px; }
        .search-result-snippet { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
        .search-result-snippet mark { background: rgba(99,102,241,0.25); color: var(--text); padding: 0 2px; border-radius: 2px; }
        .search-empty { padding: 16px 12px; color: var(--text-muted); font-size: 0.86rem; text-align: center; }
        .search-section { margin-bottom: 6px; }
        .search-section + .search-section { padding-top: 6px; border-top: 1px solid var(--rule); }
        .search-section-label {
            font-family: var(--mono);
            font-size: 0.7rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            color: var(--accent);
            padding: 8px 12px 4px;
        }
        .search-section-footer {
            padding: 8px 12px;
            font-family: var(--mono);
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: var(--text-muted);
            text-align: center;
            border-top: 1px solid var(--rule);
            margin-top: 6px;
        }

        /* ═══════════════════════════════════════════════════════ */
        /* === Ask Креативия chat =============================== */
        /* ═══════════════════════════════════════════════════════ */
        .ask-creativia {
            margin: 40px 0;
            padding: 24px;
            background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(236,72,153,0.06));
            border: 1px solid rgba(99,102,241,0.18);
            border-radius: 16px;
        }
        .ask-creativia-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
        .ask-creativia-avatar {
            width: 36px; height: 36px;
            background: var(--gradient);
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            color: #fff; font-size: 1.1rem;
        }
        .ask-creativia-title { font-weight: 600; font-size: 1rem; }
        .ask-creativia-sub { color: var(--text-muted); font-size: 0.84rem; }
        .ask-creativia-input-wrap { display: flex; gap: 8px; }
        .ask-creativia-input {
            flex: 1;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 10px 14px;
            color: var(--text);
            font-family: inherit;
            font-size: 0.92rem;
            outline: none;
            transition: border-color 0.15s;
        }
        .ask-creativia-input:focus { border-color: rgba(99,102,241,0.4); }
        .ask-creativia-send {
            padding: 10px 18px;
            background: var(--primary);
            color: #fff;
            border: none;
            border-radius: 10px;
            font-family: inherit;
            font-size: 0.9rem;
            cursor: pointer;
            transition: background 0.15s;
        }
        .ask-creativia-send:hover { background: var(--primary-light); }
        .ask-creativia-send:disabled { opacity: 0.5; cursor: wait; }
        .ask-creativia-msgs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
        .ask-creativia-msg {
            padding: 10px 14px;
            border-radius: 10px;
            max-width: 90%;
            line-height: 1.5;
            font-size: 0.92rem;
        }
        .ask-creativia-msg--user {
            background: var(--surface2);
            align-self: flex-end;
        }
        .ask-creativia-msg--bot {
            background: rgba(99,102,241,0.1);
            border: 1px solid rgba(99,102,241,0.18);
            align-self: flex-start;
        }
        .ask-creativia-msg--typing { color: var(--text-muted); font-style: italic; }

        /* ═══════════════════════════════════════════════════════ */
        /* === Tools (mini-apps) =============================== */
        /* ═══════════════════════════════════════════════════════ */
        .tools-toolbar {
            display: flex;
            flex-direction: column;
            gap: 16px;
            margin-bottom: 28px;
        }
        .tools-filter-search {
            display: flex; align-items: center; gap: 8px;
            padding: 10px 16px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 50px;
            max-width: 360px;
        }
        .tools-filter-search:focus-within { border-color: rgba(99,102,241,0.4); }
        .tools-filter-search input {
            flex: 1; background: transparent; border: none; outline: none;
            color: var(--text); font-family: inherit; font-size: 0.9rem;
        }
        .tools-filter-search .nav-search-icon { color: var(--text-muted); flex-shrink: 0; }
        .tools-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 18px;
            margin-bottom: 48px;
        }
        .tool-card {
            display: grid;
            grid-template-columns: auto 1fr auto;
            gap: 18px;
            align-items: center;
            padding: 22px;
            background: var(--surface2);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: inherit;
            text-decoration: none;
            transition: transform 0.25s, border-color 0.2s, box-shadow 0.3s;
        }
        .tool-card:hover {
            transform: translateY(-2px);
            border-color: var(--accent);
            box-shadow: 0 12px 28px rgba(0,0,0,0.22);
        }
        .tool-card-icon {
            width: 56px; height: 56px;
            background: linear-gradient(135deg, rgba(129,140,248,0.18), rgba(244,114,182,0.18));
            border: 1px solid rgba(129,140,248,0.25);
            border-radius: 6px;
            display: flex; align-items: center; justify-content: center;
            font-size: 1.7rem;
            flex-shrink: 0;
        }
        .tool-card-title {
            font-family: var(--display);
            font-weight: 600;
            font-size: 1.08rem;
            letter-spacing: -0.015em;
            margin-bottom: 4px;
            color: var(--text);
        }
        .tool-card:hover .tool-card-title { color: var(--accent); transition: color 0.2s; }
        .tool-card-desc { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px; }
        .tool-card-meta {
            display: flex; gap: 12px; align-items: center;
            font-family: var(--mono);
            font-size: 0.7rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: var(--text-muted);
        }
        .tool-card-cat {
            padding: 2px 8px;
            border: 1px solid var(--rule);
            border-radius: 4px;
        }
        .tool-card-arrow { color: var(--text-muted); transition: color 0.2s, transform 0.2s; }
        .tool-card:hover .tool-card-arrow { color: var(--accent); transform: translateX(4px); }
        .tools-cta {
            text-align: center;
            padding: 32px 0;
            color: var(--text-muted);
            border-top: 1px solid var(--rule);
        }
        .tools-cta a { color: var(--primary-light); }

        /* Tool detail page */
        body.page-tool .container { max-width: 1200px; }
        .tool-back {
            display: inline-block;
            font-family: var(--mono);
            font-size: 0.78rem;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: var(--text-muted);
            text-decoration: none;
            margin-bottom: 18px;
            transition: color 0.2s;
        }
        .tool-back:hover { color: var(--accent); }
        .tool-section { padding: 20px 0 80px; }

        /* ═══════════════════════════════════════════════════════ */
        /* === TL;DR auto-summary =============================== */
        /* ═══════════════════════════════════════════════════════ */
        .post-tldr {
            /* Блок живёт внутри .post-body, поэтому ширину наследует от родителя
               (760px без TOC, шире — с TOC). max-width не нужен. */
            margin: 0 0 24px;
            background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.05));
            border: 1px solid rgba(99,102,241,0.2);
            border-radius: 12px;
            padding: 16px 20px;
        }
        .post-tldr[hidden] { display: none !important; }
        .post-tldr-header {
            display: flex; align-items: center; gap: 8px;
            margin-bottom: 8px;
        }
        .post-tldr-icon { font-size: 1.1rem; }
        .post-tldr-label {
            font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
            letter-spacing: 0.05em; color: var(--primary-light);
        }
        .post-tldr-generated {
            font-size: 0.72rem; color: var(--text-muted);
        }
        .post-tldr-text {
            margin: 0; font-size: 0.92rem; line-height: 1.5;
            color: var(--text); font-style: italic;
        }
        /* Mobile: блок наследует ширину post-body, никаких отдельных margin не нужно. */

/* ── Gate modal ── */
.gate-modal { position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center; }
.gate-modal[hidden] { display:none; }
.gate-modal__backdrop { position:absolute; inset:0; background:rgba(0,0,0,0.65); backdrop-filter: blur(4px); }
.gate-modal__inner { position:relative; background:var(--bg, #fff); color:var(--text, #111); max-width:440px; width:calc(100% - 32px); padding:28px 24px 24px; border-radius:16px; box-shadow:0 20px 60px rgba(0,0,0,0.35); text-align:center; }
.gate-modal__close { position:absolute; top:8px; right:12px; background:none; border:none; font-size:24px; cursor:pointer; color:var(--text-muted, #666); }
.gate-modal__icon { font-size:48px; margin-bottom:12px; }
.gate-modal__title { margin:0 0 8px; font-size:1.4rem; }
.gate-modal__sub { margin:0 0 20px; color:var(--text-muted); font-size:0.95rem; }
.gate-modal__channels { display:flex; flex-direction:column; gap:10px; margin-bottom:14px; }
.gate-channel-btn { display:block; padding:12px 18px; border-radius:10px; background:var(--primary, #6366f1); color:#fff; text-decoration:none; font-weight:600; transition:transform 0.15s; }
.gate-channel-btn:hover { transform:translateY(-1px); }
.gate-channel-btn--telegram { background:#229ED9; }
.gate-channel-btn--max { background:#FF6633; }
.gate-channel-btn--vk { background:#0077FF; }
.gate-modal__note { font-size:0.82rem; color:var(--text-muted); margin:0; }
.gate-modal__meta-notice { font-size:0.7rem; line-height:1.45; color:var(--text-muted); opacity:0.65; margin:8px 0 0; }
.gate-spinner { width:48px; height:48px; border:4px solid rgba(99,102,241,0.2); border-top-color:var(--primary, #6366f1); border-radius:50%; animation:gate-spin 1s linear infinite; margin:0 auto 16px; }
@keyframes gate-spin { to { transform: rotate(360deg); } }
.gate-verifying__phase { font-size:1.1rem; margin:0 0 6px; }
.gate-verifying__hint { font-size:0.85rem; color:var(--text-muted); margin:0; }
.gate-success__icon { font-size:48px; margin-bottom:8px; }

/* ── Tool form layout ── */
.tool-section { padding: 32px 0; }
.tool-layout { margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.tool-form { background: var(--surface, #fff); padding: 24px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.tool-form-title { margin: 0 0 16px; }
.form-radio-group { display: flex; flex-wrap: wrap; gap: 12px; }
.form-radio { display: inline-flex; align-items: center; gap: 6px; }
.form-error { display: block; color: var(--error, #dc2626); margin-top: 4px; font-size: 0.84rem; }
.form-error[hidden] { display: none; }
.form-note { margin: 14px 0 0; color: var(--text-muted, #666); font-size: 0.82rem; text-align: center; }
.form-optional { color: var(--text-muted); font-size: 0.78rem; font-weight: normal; }
.tool-result, .tool-error, .tool-rate-limit { background: var(--surface, #fff); padding: 20px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.tool-error { border-left: 3px solid var(--error, #dc2626); }
.tool-rate-limit { border-left: 3px solid var(--warning, #d97706); }
.tool-result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 12px; }
.tool-result-actions { display: flex; gap: 8px; }

/* ── Tool output ── */
.tool-output { margin-top: 16px; line-height: 1.6; }
.tool-output--markdown h1, .tool-output--markdown h2, .tool-output--markdown h3 { margin: 1em 0 0.4em; }
.tool-output--markdown ul { padding-left: 1.4em; }
.tool-output--markdown code { background: rgba(0,0,0,0.06); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.tool-output--list { padding-left: 1.6em; }
.tool-output--list li { margin: 0.4em 0; }
.tool-output--table { width: 100%; border-collapse: collapse; }
.tool-output--table th, .tool-output--table td { padding: 8px 12px; border: 1px solid var(--border, rgba(0,0,0,0.1)); text-align: left; }
.tool-output--table th { background: rgba(99,102,241,0.08); font-weight: 600; }

/* HTML-формат: фирменные стили для всего контента, который вернул AI.
   Зеркалим то же, что у .post-content в постах — таблицы с акцентной
   шапкой и зеброй, аккуратные h2/h3, blockquote, код, hr, картинки. */
.tool-output--html { font-size: 1rem; line-height: 1.65; color: var(--text); }
.tool-output--html h1, .tool-output--html h2 {
    font-size: 1.45rem; font-weight: 600;
    margin: 1.6rem 0 0.6rem; letter-spacing: -0.015em; color: var(--text);
}
.tool-output--html h2:first-child, .tool-output--html h1:first-child { margin-top: 0; }
.tool-output--html h3 {
    font-size: 1.15rem; font-weight: 600;
    margin: 1.4rem 0 0.5rem; letter-spacing: -0.01em; color: var(--text);
}
.tool-output--html h4 { font-size: 1.02rem; font-weight: 600; margin: 1.1rem 0 0.4rem; }
.tool-output--html h5, .tool-output--html h6 {
    font-size: 0.95rem; font-weight: 600; margin: 1rem 0 0.4rem;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.tool-output--html p { margin: 0 0 1rem; }
.tool-output--html ul, .tool-output--html ol { margin: 0.6rem 0 1rem 1.4rem; }
.tool-output--html li { margin-bottom: 0.35rem; }
.tool-output--html li > ul, .tool-output--html li > ol { margin-top: 0.35rem; margin-bottom: 0.3rem; }
.tool-output--html strong, .tool-output--html b { font-weight: 600; color: var(--text); }
.tool-output--html em, .tool-output--html i { font-style: italic; }
.tool-output--html a {
    color: var(--text); text-decoration: underline;
    text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px;
    transition: color 0.15s, text-decoration-color 0.15s;
}
.tool-output--html a:hover { color: var(--accent); }
.tool-output--html blockquote {
    border-left: 3px solid var(--accent);
    padding: 6px 0 6px 1.4rem; margin: 1.2rem 0;
    color: var(--text-muted); font-style: italic;
}
.tool-output--html code {
    font-family: var(--mono); font-size: 0.92em;
    padding: 2px 6px; background: var(--surface2); border: 1px solid var(--rule); border-radius: 4px;
}
.tool-output--html pre {
    font-family: var(--mono); background: var(--surface);
    border: 1px solid var(--rule); border-radius: 6px;
    padding: 14px 16px; overflow-x: auto; margin: 1.2rem 0; font-size: 0.88rem; line-height: 1.55;
}
.tool-output--html pre code { background: transparent; border: none; padding: 0; }
.tool-output--html hr { border: none; height: 1px; background: var(--rule); margin: 1.8rem 0; }
.tool-output--html img {
    max-width: 100%; height: auto; display: block;
    margin: 1.2rem auto; border-radius: 8px; border: 1px solid var(--rule);
}
.tool-output--html figure { margin: 1.4rem 0; }
.tool-output--html figcaption {
    text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-top: 0.4rem; font-style: italic;
}
.tool-output--html mark {
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    color: var(--text); padding: 0 4px; border-radius: 3px;
}
.tool-output--html kbd {
    font-family: var(--mono); font-size: 0.85em; padding: 2px 6px;
    background: var(--surface2); border: 1px solid var(--rule); border-bottom-width: 2px;
    border-radius: 4px; color: var(--text);
}
.tool-output--html del { color: var(--text-muted); }
.tool-output--html sub, .tool-output--html sup { font-size: 0.75em; line-height: 0; }

.tool-output--html table {
    width: 100%; border-collapse: collapse; margin: 1.4rem 0; font-size: 0.95rem; line-height: 1.5;
    background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden;
}
.tool-output--html thead { background: var(--surface2); }
.tool-output--html thead th {
    font-weight: 600; color: var(--text); text-align: left;
    padding: 10px 14px; border-bottom: 2px solid var(--accent); letter-spacing: -0.005em;
}
.tool-output--html tbody td {
    padding: 10px 14px; border-bottom: 1px solid var(--rule); color: var(--text); vertical-align: top;
}
.tool-output--html tbody tr:last-child td { border-bottom: none; }
.tool-output--html tbody tr:nth-child(even) td { background: var(--surface2); }
.tool-output--html tbody tr:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.tool-output--html td.num, .tool-output--html th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tool-output--html tfoot td, .tool-output--html tr.total td {
    font-weight: 700; background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-top: 2px solid var(--accent);
}
.tool-output--html table caption {
    caption-side: bottom; color: var(--text-muted); font-size: 0.88rem;
    padding-top: 8px; text-align: left; font-style: italic;
}
@media (max-width: 600px) {
    .tool-output--html table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── Ad block ── */
/* CTA в подвале результата — НЕ карточка-в-карточке, а тонкий разделитель.
   .tool-result уже сама карточка с фоном и тенью; здесь — только верхняя
   граница, центрирование и приглушённый текст. */
.tool-ad-block {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}
.tool-ad-block p { margin: 0; }
.tool-ad-block a {
    color: var(--text);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    transition: color 0.15s, text-decoration-color 0.15s;
}
.tool-ad-block a:hover { color: var(--accent); }

/* —— Tools list —— empty state —— */
.tools-empty { padding: 48px 24px; text-align: center; background: var(--surface, #fff); border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.tools-empty h2 { margin: 0 0 12px; font-size: 1.4rem; }
.tools-empty p { margin: 0; color: var(--text-muted); }

/* ── Admin: tools list & edit ── */
.admin-section { padding: 28px 0; }
.admin-section h1 { margin-bottom: 16px; }
.admin-back { display: inline-block; margin-bottom: 8px; color: var(--text-muted); font-size: 0.9rem; }
.admin-back:hover { color: var(--primary, #6366f1); }

.admin-table { width: 100%; border-collapse: collapse; background: var(--surface2, #1a1d2b); border: 1px solid var(--border, rgba(255,255,255,0.08)); border-radius: 10px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--border, rgba(255,255,255,0.06)); text-align: left; vertical-align: middle; font-size: 0.92rem; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table th { background: rgba(99,102,241,0.08); font-weight: 600; font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.admin-table code { font-family: 'Fira Code', Consolas, monospace; font-size: 0.84rem; background: rgba(99,102,241,0.1); padding: 2px 6px; border-radius: 4px; }
.admin-table a { color: var(--primary, #6366f1); }
.admin-table--sortable th a { color: inherit; text-decoration: none; display: inline-block; }
.admin-table--sortable th a:hover { color: var(--primary, #6366f1); }

.status-badge { display: inline-block; font-size: 0.74rem; font-weight: 600; padding: 3px 9px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.status-badge--published { background: rgba(16,185,129,0.16); color: #10b981; }
.status-badge--testing   { background: rgba(245,158,11,0.16); color: #f59e0b; }
.status-badge--draft     { background: rgba(148,163,184,0.16); color: #94a3b8; }
.status-badge--archived  { background: rgba(239,68,68,0.16); color: #ef4444; }

.admin-form { max-width: 760px; }
.admin-form .form-group { margin-bottom: 18px; }
.form-textarea { resize: vertical; min-height: 120px; font-family: 'Fira Code', Consolas, monospace; font-size: 0.88rem; line-height: 1.5; }
.form-select { cursor: pointer; }

/* ── A/B Test: CTA variant B ── */
.post-sticky-cta.ab-variant-b { background: linear-gradient(135deg, #ff6b6b, #ee5a24); }

/* Post engagement CTA — soft nudge after share buttons */
.post-engagement-cta {
  background: var(--surface2);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.post-engagement-cta__icon { font-size: 1.5em; line-height: 1; }
.post-engagement-cta__body { flex: 1; min-width: 200px; }
.post-engagement-cta__title { margin: 0; font-weight: 600; color: var(--text); }
.post-engagement-cta__hint { margin: 4px 0 0; font-size: 0.9em; color: var(--text-muted); }

/* ============================================================
   /tools — алиасы для классов, которые Креативия генерит
   в своих кастомных tool-templates (views/pages/tools/{slug}.ejs).
   Канонический шаблон использует .tool-form/.form-group/.form-input,
   а Креативия пишет .tool-card/.field/.required/.lead/.result-* —
   эти стили приводят оба варианта к единому виду.
   ============================================================ */

.tool-card, .tool-container {
  display: block;
  max-width: 760px;
  margin: 0 auto 24px;
  background: var(--surface);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  box-sizing: border-box;
}
.tool-card *, .tool-container * { box-sizing: border-box; }
/* Принудительно растягиваем все блок-элементы на ширину родителя */
.tool-card > form, .tool-card > div,
.tool-container > form, .tool-container > div { width: 100% !important; }
/* Когда tool-карточка идёт без page-header выше (Креативия часто так делает),
   нужен отступ сверху, чтобы заголовок не пролезал под sticky-навигацию.
   Используем padding главного контейнера, чтобы избежать margin-collapsing. */
main > .tool-card:first-child,
main > .tool-container:first-child { padding-top: 96px; }

.tool-card form, .tool-container form { display: flex; flex-direction: column; gap: 0; }

.tool-desc, p.lead {
  color: var(--text-muted);
  margin: 0 0 16px;
  font-size: 1rem;
  line-height: 1.5;
}

/* === УНИВЕРСАЛЬНЫЕ ПРАВИЛА для body.page-tool ===
   Сервер ставит class="page-tool" на body для ВСЕХ tool-страниц
   (server.js: bodyClass: 'page-tool'). Это позволяет стилизовать
   формы независимо от того, как Креативия их обернула:
   - <div class="tool-card">
   - <div class="tool-container">
   - просто <form> прямо в <main>
*/

/* Карточка-обёртка для ЛЮБОЙ формы на tool-странице (Креативия использует
   десятки разных обёрток: .tool-card, .tool-container, .tool-form-container,
   .tool-form.glass-card, .tool-content, или просто form/div в main).
   Стилизуем как form, так и div-обёртки которые содержат .form-group. */
body.page-tool main form,
body.page-tool main > .tool-content,
body.page-tool main > .tool-form-container,
body.page-tool main > div:has(> .form-group),
body.page-tool main > div:has(> .field) {
  max-width: 760px;
  margin: 24px auto;
  background: var(--surface);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Tools без page-header — отодвинуть карточку от sticky-nav */
body.page-tool main > form:first-child,
body.page-tool main > div:first-child > form,
body.page-tool main > section:first-child > form,
body.page-tool main > .tool-content:first-child,
body.page-tool main > .tool-form-container:first-child { margin-top: 96px; }

/* tool-form-row — Креативия использует как контейнер строки полей.
   Не оборачивать карточкой (это внутренний контейнер). */
body.page-tool .tool-form-row,
body.page-tool .form-row { display: flex; gap: 16px; margin-bottom: 0; flex-wrap: wrap; }
body.page-tool .tool-form-row > .form-group,
body.page-tool .form-row > .form-group { flex: 1; min-width: 200px; }
body.page-tool .tool-form-row > .form-group.full-width,
body.page-tool .form-row > .form-group.full-width { flex: 1 0 100%; }
body.page-tool .tool-actions,
body.page-tool .form-actions { margin-top: 8px; }

/* Если form ВНУТРИ уже-карточного контейнера (.tool-card, .tool-container,
   .tool-content, .tool-form-container) — снять с form стиль карточки,
   чтобы не было двойной обёртки. */
body.page-tool .tool-card form,
body.page-tool .tool-container form,
body.page-tool .tool-content form,
body.page-tool .tool-form-container form {
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0;
  max-width: none;
  border-radius: 0;
  width: 100% !important;
  display: block;
}

/* form по умолчанию shrink-to-fit — растягиваем на ширину родителя */
body.page-tool form { width: 100%; box-sizing: border-box; }

/* ============================================================
   МАССОВЫЙ ФИКС антипаттернов Креативии (2026-05-24, раунд 3).
   Юзер словил ~50 проблем — CSS закрывает массовые случаи.
   ============================================================ */

/* 1. Креативия часто кладёт <main class="tool-page container"> ВНУТРЬ
      серверного <main id="main"> — двойной main + двойной h1.
      Сбрасываем внутренний main: делаем его флекс-карточкой, скрываем
      дубль-h1 (он повторяет тот что в page-header). */
body.page-tool main main.tool-page,
body.page-tool main main.tool-page.container {
  display: block;
  max-width: 760px;
  margin: 24px auto;
  padding: 24px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  box-sizing: border-box;
}
/* Дубль h1 внутри второго main — скрываем (в header.page-header уже есть) */
body.page-tool main main.tool-page > h1,
body.page-tool main main.tool-page > .tool-hero-title { display: none; }
/* Описание-дубль тоже */
body.page-tool main main.tool-page > .tool-hero-desc { display: none; }

/* 2. Пустые .form-error — невидимы (Креативия рендерит их без hidden) */
body.page-tool .form-error:empty { display: none !important; }
body.page-tool .form-error { color: #ef4444; font-size: 0.8rem; margin-top: 4px; }

/* 3. ВСЕ input/select/textarea внутри .form-group или .field — на полную
      ширину родителя. !important потому что inline-стили Креативии
      переопределяют. */
body.page-tool .form-group > input,
body.page-tool .form-group > select,
body.page-tool .form-group > textarea,
body.page-tool .field > input,
body.page-tool .field > select,
body.page-tool .field > textarea,
body.page-tool form > input,
body.page-tool form > select,
body.page-tool form > textarea { width: 100% !important; box-sizing: border-box !important; }

/* 4. UNWRAPPED_FULL_WIDTH: прямой ребёнок main (div, не header/section/footer/script/style),
      если он не уже-стилизованная обёртка, должен иметь max-width и центровку. */
body.page-tool main > div:not(.tool-card):not(.tool-container):not(.tool-content):not(.tool-form-container):not(.tool-section):not(.container):not(footer) {
  max-width: 760px;
  margin: 16px auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* 5. FORM_TOO_NARROW: form должен быть min 320px (на десктопе обычно — 760px).
      Креативия делает form внутри узкого div'а — растягиваем. */
body.page-tool main form { min-width: min(320px, 100%); width: 100%; }

/* 6. FontAwesome не подключён — теперь и не нужен (удалили из шаблонов).
      На всякий случай прячем любые орфаны <i class="fa-*">. */
body.page-tool i[class^="fa-"],
body.page-tool i[class*=" fa-"],
body.page-tool i.fa,
body.page-tool i.fas,
body.page-tool i.far,
body.page-tool i.fab { display: none; }

/* 7. info-box (Креативия часто оборачивает информационный текст) — стилизуем как «note» */
body.page-tool .info-box {
  background: rgba(99,102,241,0.08);
  border-left: 3px solid #6366f1;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 12px 0;
  font-size: 0.9rem;
  color: var(--text);
}

/* 8. .tool-header (Креативия использует как hero) — стилизуем как page-header.
   ВАЖНО: padding-top вместо margin-top — margin collapse с main схлопывал отступ.
   !important чтобы перебивать кешированный inline или Креативииный override. */
body.page-tool .tool-header {
  text-align: center;
  margin: 0 auto 24px !important;
  padding-top: 120px !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  max-width: 760px;
}
body.page-tool .tool-header h1,
body.page-tool .tool-header h2 { font-size: 1.8rem; color: var(--text); margin: 0 0 8px; }
body.page-tool .tool-header p { color: var(--text-muted); margin: 0; }

/* main должен иметь min-height чтобы padding ребёнка не схлопывался */
body.page-tool main { padding-top: 1px; }

/* 9. .calc-grid (Креативия использует 2-колоночный grid) — на мобайле в одну */
body.page-tool .calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 760px;
  margin: 24px auto;
  padding: 0 16px;
}
@media (max-width: 700px) {
  body.page-tool .calc-grid { grid-template-columns: 1fr; }
}

/* 10. .tool-body (Креативия использует как контент-обёртку) — карточка */
body.page-tool .tool-body {
  max-width: 760px;
  margin: 24px auto;
  background: var(--surface);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* 11. .ad-block (Креативия добавляет блок CTA "Больше инструментов") — стилизуем */
body.page-tool .ad-block {
  max-width: 760px;
  margin: 16px auto;
  background: var(--surface2);
  padding: 16px 20px;
  border-radius: 12px;
  text-align: center;
  font-size: 0.95rem;
}

/* 12. Радиокнопки (Креативия часто кладёт без обёртки) — нормальный inline view */
body.page-tool .form-group input[type="radio"],
body.page-tool .field input[type="radio"],
body.page-tool .form-group input[type="checkbox"],
body.page-tool .field input[type="checkbox"] {
  width: auto !important;
  margin-right: 6px;
  vertical-align: middle;
}
body.page-tool .form-group label[for]:has(+ input[type="radio"]),
body.page-tool .form-group input[type="radio"] + label,
body.page-tool .form-radio,
body.page-tool .radio-option { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; }

/* 13. .info-table (Креативия использует для таблиц с инфо) — карточка */
body.page-tool .info-table {
  max-width: 760px;
  margin: 16px auto;
  background: var(--surface2);
  padding: 16px;
  border-radius: 12px;
  font-size: 0.9rem;
}

/* 14. AB-tests dashboard и подобные дашборды */
body.page-tool #ab-dashboard {
  max-width: 900px;
  margin: 24px auto;
  padding: 24px;
}
body.page-tool .ab-tests-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
body.page-tool .ab-test-card {
  background: var(--surface);
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
body.page-tool .ab-test-header { font-size: 1rem; margin-bottom: 8px; color: var(--text); }
body.page-tool .ab-test-meta { color: var(--text-muted); font-size: 0.85rem; margin-left: 8px; font-weight: normal; }
body.page-tool .ab-bar-chart { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
body.page-tool .ab-bar { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text); }
body.page-tool .ab-bar-fill { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #6366f1, #ec4899); }
body.page-tool .ab-test-footer { color: var(--text-muted); font-size: 0.85rem; margin-top: 6px; }
body.page-tool .empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: 12px;
  max-width: 600px;
  margin: 24px auto;
}
body.page-tool .alert.alert-error {
  background: rgba(239,68,68,0.1);
  border-left: 3px solid #ef4444;
  color: #ef4444;
  padding: 12px 16px;
  border-radius: 8px;
  max-width: 760px;
  margin: 16px auto;
}

/* 15. work-report и подобные tools со списками в полях — placeholder может содержать <br/HTML>
   Креативия иногда кладёт literal HTML в плейсхолдер — он отрисуется как текст.
   Не CSS-фикс, но стилизуем .form-help/.field-hint */
body.page-tool .form-help, body.page-tool .field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 16. break-even, instruction-generator — h2 ВНУТРИ form. Если он сразу после form open —
   стилизуем как заголовок секции */
body.page-tool form > h2:first-child,
body.page-tool form > h3:first-child {
  margin: 0 0 16px;
  font-size: 1.25rem;
  color: var(--text);
}

/* 17. Дополнительные классы Креативии — встречаются в разных tools */
body.page-tool .form-hint,
body.page-tool .input-hint,
body.page-tool .help-text { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; display: block; }

body.page-tool .form-actions, body.page-tool .button-row {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* 18. Радио-группы Креативии (varios names) */
body.page-tool .radio-group,
body.page-tool .checkbox-group { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
body.page-tool .radio-group label,
body.page-tool .checkbox-group label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* Группа поля (любая обёртка label+input) */
body.page-tool .field,
body.page-tool .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

body.page-tool .field > label,
body.page-tool .form-group > label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

body.page-tool .required { color: #ef4444; margin-left: 2px; }

/* ВСЕ input/select/textarea на tool-странице — единый стиль.
   Не привязано к родительской обёртке — работает и при голой форме. */
body.page-tool input[type="text"],
body.page-tool input[type="number"],
body.page-tool input[type="email"],
body.page-tool input[type="date"],
body.page-tool input[type="url"],
body.page-tool input[type="tel"],
body.page-tool input[type="search"],
body.page-tool input:not([type]),
body.page-tool select,
body.page-tool textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

/* Исключение: input внутри nav (search box) — не трогать */
body.page-tool nav input { width: auto; }

body.page-tool input:focus,
body.page-tool select:focus,
body.page-tool textarea:focus {
  outline: none;
  border-color: rgba(99,102,241,0.5);
}

body.page-tool textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

/* Заголовок инструмента, если он голым h1/h2 в начале main без page-header */
body.page-tool main > h1:first-child,
body.page-tool main > h2:first-child,
body.page-tool main > h1.first,
body.page-tool .tool-container > h2:first-child,
body.page-tool .tool-card > h2:first-child {
  margin: 0 auto 8px;
  max-width: 760px;
  padding: 96px 24px 0;
  font-size: 1.8rem;
  color: var(--text);
}

/* Submit-кнопка — на всю ширину */
body.page-tool .tool-card button[type="submit"],
body.page-tool .tool-container button[type="submit"],
body.page-tool main > form button[type="submit"] {
  margin-top: 6px;
  width: 100%;
}

.btn-lg { padding: 12px 24px; font-size: 1rem; }

.result-block {
  background: var(--surface);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  max-width: 760px;
  margin: 16px auto;
}

.result-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.result-content { margin-top: 12px; line-height: 1.65; color: var(--text); }

.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 1.2em 0 0.5em; color: var(--text); }
.markdown-body h2 { font-size: 1.25rem; }
.markdown-body h3 { font-size: 1.1rem; }
.markdown-body p { margin: 0 0 1em; }
.markdown-body ul, .markdown-body ol { margin: 0.6rem 0 1rem 1.4rem; }
.markdown-body li { margin-bottom: 0.35rem; }
.markdown-body strong, .markdown-body b { font-weight: 600; }
.markdown-body em, .markdown-body i { font-style: italic; }
.markdown-body code {
  background: rgba(99,102,241,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Fira Code', Consolas, monospace;
}
.markdown-body pre {
  background: var(--surface2);
  padding: 12px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1em 0;
}
.markdown-body pre code { background: transparent; padding: 0; }
.markdown-body blockquote {
  border-left: 3px solid var(--accent, #ec4899);
  padding: 4px 14px;
  margin: 1em 0;
  color: var(--text-muted);
  font-style: italic;
}
.markdown-body table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.markdown-body th, .markdown-body td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }
.markdown-body th { background: var(--surface2); font-weight: 600; }

.tool-card p.error { color: #ef4444; }

/* Калькулятор почасовой ставки фрилансера — кастомный результат */
.calc-rate-result {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  text-align: center;
}
.calc-rate-result .rate-label { font-size: 1rem; opacity: 0.9; margin-bottom: 4px; }
.calc-rate-result .rate { font-size: 2.8rem; font-weight: 800; letter-spacing: -1px; }
.calc-rate-result .rate-unit { font-size: 0.9rem; opacity: 0.8; margin-bottom: 16px; }
.calc-rate-result .rate-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  text-align: left;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 16px;
}
.calc-rate-result .rate-breakdown-item small { opacity: 0.85; font-size: 0.75rem; display: block; }
.calc-rate-result .rate-breakdown-item strong { display: block; font-size: 1.1rem; }
.calc-rate-result .formula-note {
  margin-top: 16px;
  padding: 12px;
  background: rgba(254, 243, 199, 0.95);
  color: #92400e;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: left;
}
.calc-rate-result .formula-note strong { display: block; margin-bottom: 4px; }
.post-sticky-cta.ab-variant-b:hover { background: linear-gradient(135deg, #ee5a24, #d44000); }
