/* =====================================================
   369YAX – Automation & Design
   app-components.css (PRO UI – refined)
   Layout: header, hero, sections, portfolio, about,
   contact, footer, chat, floating CTA
   ===================================================== */

/* ==========
   GLOBAL LAYOUT HELPERS
   ========== */

.section {
    padding: 56px 0;
    background: var(--bg-main, #f7f7fb);
}

.section-alt {
    background: var(--bg-alt, #ffffff);
}

.section + .section {
    border-top: 1px solid rgba(15, 23, 42, 0.04);
}

.section-title {
    font-size: 1.6rem;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    position: relative;
}

/* акцентна підкреслююча смужка під заголовком секції */
.section-title::after {
    content: "";
    display: block;
    width: 54px;
    height: 3px;
    border-radius: 999px;
    margin-top: 6px;
    background: linear-gradient(90deg, #ff3b3b, #b01010);
}

.section-subtitle {
    max-width: 700px;
    color: var(--text-muted, #6b7280);
    font-size: 0.96rem;
    margin-bottom: 28px;
}

/* базова карточна сітка */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.card {
    background: var(--card-bg, #ffffff);
    border-radius: 18px;
    padding: 18px 18px 16px;
    border: 1px solid var(--border-soft, #e2e5f0);
    box-shadow: var(--shadow-soft, 0 10px 26px rgba(15, 23, 42, 0.06));
    display: flex;
    flex-direction: column;
    transition:
        transform 0.18s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    border-color: rgba(214, 0, 0, 0.65);
    background: #ffffff;
}

.card h3 {
    font-size: 1.02rem;
    margin-bottom: 8px;
}

.card p {
    font-size: 0.9rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 10px;
}

.card-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.card-list li {
    position: relative;
    font-size: 0.88rem;
    padding: 4px 0 4px 18px;
    color: var(--text-main, #111827);
}

.card-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 4px;
    font-size: 0.8rem;
    color: var(--accent, #d60000);
}

/* ==========
   HEADER
   ========== */

.top-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    gap: 16px;
}

/* Logo */

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease;
}

.logo:hover {
    transform: translateY(-1px);
}

.logo-hex {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 0, #ff3b3b, #931010);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px rgba(214, 0, 0, 0.45);
    transition:
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

.logo:hover .logo-hex {
    box-shadow: 0 14px 32px rgba(214, 0, 0, 0.6);
    transform: translateY(-1px);
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-main {
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
}

/* Nav (desktop) */

.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 0.9rem;
}

.main-nav a {
    color: var(--text-muted, #6b7280);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 500;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.1s ease,
        box-shadow 0.2s ease;
}

.main-nav a:hover {
    color: #0f172a;
    background: rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.main-nav .nav-cta {
    border: 1px solid rgba(214, 0, 0, 0.9);
    color: #ffffff;
    background: linear-gradient(135deg, #ff3b3b, #a01010);
    box-shadow: 0 8px 18px rgba(214, 0, 0, 0.5);
}

.main-nav .nav-cta:hover {
    background: linear-gradient(135deg, #ff5a5a, #c01212);
}

/* Header right controls (lang + theme) */

.header-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

/* Language pills */

.link-pill {
    border-radius: 999px;
    border: 1px solid var(--border-soft, rgba(148, 163, 184, 0.7));
    background: var(--chip-bg, #f9fafb);
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.1s ease;
}

.link-pill.is-active {
    background: var(--accent-soft, rgba(214, 0, 0, 0.1));
    border-color: rgba(214, 0, 0, 0.9);
    color: #991b1b;
    box-shadow: 0 2px 8px rgba(214, 0, 0, 0.35);
}

.link-pill:hover {
    transform: translateY(-1px);
}

/* Theme toggle */

.theme-toggle {
    font-size: 0.85rem;
}

/* ==========
   BURGER (MOBILE NAV TOGGLE)
   ========== */

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--text-main, #111827);
    transition:
        transform 0.2s ease,
        opacity 0.2s ease,
        background 0.2s ease;
}

.nav-toggle span + span {
    margin-top: 4px;
}

/* Burger to "X" */

body.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

body.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}

body.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ==========
   HERO
   ========== */

.hero {
    padding: 70px 0 60px;
    background: var(--bg-main, #f5f5f9);
}

.hero-inner {
    display: grid;
    gap: 32px;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr);
    align-items: center;
}

.hero-text h1 {
    font-size: clamp(2.2rem, 3vw, 2.8rem);
    line-height: 1.12;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.accent {
    color: var(--accent, #d60000);
}

.hero-sub {
    color: var(--text-muted, #6b7280);
    max-width: 640px;
    margin-bottom: 22px;
    font-size: 0.97rem;
}

/* hero buttons */

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

/* base button styles */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.1s ease,
        border-color 0.2s ease;
}

.btn.primary {
    background: linear-gradient(135deg, #ff3b3b, #b01010);
    border-color: rgba(148, 27, 27, 0.9);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(214, 0, 0, 0.45);
}

.btn.primary:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #ff5c5c, #d11212);
    box-shadow: 0 14px 30px rgba(214, 0, 0, 0.6);
}

.btn.ghost {
    background: transparent;
    border-color: rgba(15, 23, 42, 0.2);
    color: var(--text-main, #111827);
}

.btn.ghost:hover {
    background: rgba(15, 23, 42, 0.04);
}

/* hero metrics */

.hero-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.hero-metric {
    min-width: 120px;
    border-radius: 14px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.hero-metric-num {
    font-weight: 700;
    font-size: 0.95rem;
    display: block;
}

.hero-metric-label {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
}

/* hero tags */

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    margin-top: 6px;
}

.hero-tags span {
    border-radius: var(--radius-pill, 999px);
    padding: 6px 12px;
    background: #f0f0f3;
}
/* ==========
   HERO CAD GRID (додається зверху героя)
   ========== */

.hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;

    /* Світла CAD-сітка */
    background-image:
        linear-gradient(to right, rgba(15, 23, 42, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.35;
}

/* контент поверх сітки */
.hero > * {
    position: relative;
    z-index: 1;
}

/* ==========
   HERO CARD + PHOTOS
   ========== */

.hero-card {
    background: var(--card-bg, #f9f9fb);
    border-radius: 22px;
    padding: 22px 20px 18px;
    border: 1px solid var(--border-soft, #dde0eb);
    box-shadow: var(--shadow-soft, 0 14px 32px rgba(15, 23, 42, 0.16));
    transform: translateY(0);
    opacity: 1;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease;
}

.hero-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.32);
    border-color: rgba(214, 0, 0, 0.7);
    background: #ffffff;
}

.hero-photos {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 4 / 3;
    margin-bottom: 16px;
}

.hero-photo-frame {
    position: absolute;
    overflow: hidden;
    border-radius: 18px;
    background: transparent; /* було #000 */
    border: 1px solid rgba(214, 0, 0, 0.6);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
    transition:
        box-shadow 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

.hero-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;     /* замість contain */
    object-position: center;
    display: block;
    background: #f5f5f7;   /* дуже світлий нейтральний фон на випадок прозорих зон */
}

.hero-photo-main {
    width: 58%;
    height: 100%;
    left: 0;
    top: 0;
}

.hero-photo-workshop {
    width: 52%;
    height: 72%;
    right: 0;
    bottom: -8px;
}

.hero-card:hover .hero-photo-main,
.hero-card:hover .hero-photo-workshop {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    transform: translateY(-1px);
}

.hero-card h2 {
    font-size: 1.08rem;
    margin-bottom: 10px;
}

.hero-card ul {
    list-style: none;
    margin-bottom: 12px;
    padding-left: 0;
}

.hero-card li {
    font-size: 0.9rem;
    padding: 4px 0;
    color: var(--text-muted, #4b5563);
}

.hero-note {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    border-top: 1px solid rgba(15, 23, 42, 0.07);
    padding-top: 8px;
    margin-top: 6px;
}

/* ==========
   TRUST STRIP
   ========== */

.trust-strip {
    background: var(--bg-alt, #ffffff);
    border-top: 1px solid rgba(15, 23, 42, 0.04);
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
    padding: 14px 0;
}

.trust-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-muted, #6b7280);
}

.trust-pill {
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px dashed rgba(148, 163, 184, 0.7);
    font-size: 0.78rem;
}

/* ==========
   PORTFOLIO
   ========== */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.portfolio-item {
    background: var(--card-bg, #ffffff);
    border-radius: 18px;
    padding: 18px 18px 14px;
    border: 1px solid var(--border-soft, #e2e5f0);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
    transition:
        transform 0.16s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.portfolio-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
    border-color: rgba(214, 0, 0, 0.65);
}

.portfolio-item h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.portfolio-item p {
    font-size: 0.9rem;
    color: var(--text-muted, #4b5563);
    margin-bottom: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(214, 0, 0, 0.06);
    color: #991b1b;
}

/* ==========
   ABOUT
   ========== */

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr);
    gap: 28px;
}

/* accordion з досвідом */

.about-exp {
    margin: 12px 0 14px;
    border-radius: 14px;
    border: 1px solid var(--border-soft, #e2e5f0);
    background: #f9fafb;
    padding: 8px 10px 10px;
}

.about-exp > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main, #111827);
}

.about-exp > summary::-webkit-details-marker {
    display: none;
}

.about-exp > summary::before {
    content: "▾";
    display: inline-block;
    margin-right: 6px;
    font-size: 0.7rem;
    transform: translateY(-1px);
}

.about-exp[open] > summary::before {
    content: "▴";
}

/* список досвіду всередині акордеону – з власними маркерами */
.about-exp-list {
    margin: 8px 0 0;
    padding-left: 0;
    list-style: none;
    font-size: 0.86rem;
    color: var(--text-muted, #4b5563);
}

.about-exp-list li {
    position: relative;
    padding: 4px 0 4px 20px;
}

.about-exp-list li + li {
    margin-top: 6px;
}

.about-exp-list li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 0.9em;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--accent, #d60000);
    transform: translateY(-50%);
}

/* про мене – списки */

.about-list {
    list-style: none;
    margin: 10px 0 0;
    padding-left: 0;
}

/* красиві, вирівняні маркери перед рядками досвіду / фактів */
.about-list li {
    position: relative;
    font-size: 0.9rem;
    padding: 4px 0 4px 20px;
    color: var(--text-main, #111827);
}

.about-list li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 0.9em;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.9);
    transform: translateY(-50%);
}

/* бокова коробка */

.about-box {
    background: var(--card-bg, #ffffff);
    border-radius: 18px;
    padding: 16px 16px 14px;
    border: 1px solid var(--border-soft, #e2e5f0);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

/* ==========
   CONTACT
   ========== */

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr);
    gap: 26px;
}

.contact-line a {
    color: var(--accent, #d60000);
    text-decoration: none;
    border-bottom: 1px solid rgba(214, 0, 0, 0.5);
    padding-bottom: 1px;
}

.contact-line a:hover {
    border-bottom-color: #0f172a;
}

.contact-note {
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
    margin-top: 10px;
}

.contact-note.small {
    font-size: 0.8rem;
}

/* contact form */

.contact-form {
    margin-top: 24px;
    background: var(--card-bg, #ffffff);
    padding: 18px 18px 16px;
    border-radius: var(--radius-lg, 18px);
    border: 1px solid var(--border-soft, #e2e5f0);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.contact-form .form-row {
    margin-bottom: 16px;
}

.contact-form label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main, #111827);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    margin-top: 6px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #c6cad6;
    font-size: 0.9rem;
    box-sizing: border-box;
    background: #ffffff;
    color: #111111;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent, #d60000);
    box-shadow: 0 0 0 1px rgba(214, 0, 0, 0.2);
}

/* ==========
   FOOTER
   ========== */

.site-footer {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: #050816;
    color: #e5e7eb;
    padding: 14px 0;
    font-size: 0.8rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}

/* ==========
   FLOATING CTA (CHAT LAUNCHER)
   ========== */

.floating-cta {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff4747, #c40000);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    box-shadow:
        0 0 18px rgba(255, 40, 40, 0.6),
        0 10px 22px rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition:
        transform 0.2s ease,
        background 0.25s ease,
        box-shadow 0.25s ease,
        opacity 0.2s ease;
    cursor: pointer;
}

.floating-cta:hover {
    transform: translateY(-2px) scale(1.03);
    background: linear-gradient(135deg, #ff5c5c, #e00000);
    box-shadow:
        0 0 24px rgba(255, 60, 60, 0.75),
        0 12px 26px rgba(0, 0, 0, 0.55);
}

/* коли чат відкритий – чуть приглушаємо кнопку */
.floating-cta.is-active {
    opacity: 0.5;
}

/* ==========
   CHAT WIDGET – PANEL / FULLSCREEN
   ========== */

.chat-widget {
    position: fixed;
    right: 18px;
    bottom: 78px;
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: flex-end;
    pointer-events: none;
}

/* базовий відкритий стан */
.chat-widget.is-open {
    display: flex;
    pointer-events: auto;
}

/* РОЗГОРНУТЕ ВІКНО – з блюром фону і центруванням */
.chat-widget.is-large {
    inset: 0;
    right: 0;
    bottom: 0;
    align-items: center;
    justify-content: center;
}

/* напівпрозорий розмитий фон позаду чату */
.chat-widget.is-large::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 20, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: -1;
    pointer-events: none;
}

.chat-widget-inner {
    width: 380px;
    max-height: 560px;
    background: #f9f9fb;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* великий режим (desktop) – 2-колоночний layout */
.chat-widget.is-large .chat-widget-inner {
    width: min(1100px, 96vw);
    max-height: 92vh;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "header header"
        "qa     msgs"
        "footer footer";
}

.chat-widget.is-large .chat-header {
    grid-area: header;
}

.chat-widget.is-large .chat-quick-actions {
    grid-area: qa;
    border-right: 1px solid var(--border-soft, #dde0eb);
}

.chat-widget.is-large .chat-messages {
    grid-area: msgs;
}

.chat-widget.is-large .chat-footer {
    grid-area: footer;
}

/* мобільні – фуллскрін */

@media (max-width: 640px) {
    .chat-widget {
        inset: 0;
        right: 0;
        bottom: 0;
        align-items: stretch;
        justify-content: stretch;
        padding: 10px;
    }

    .chat-widget-inner {
        width: 100%;
        max-height: 100%;
        border-radius: 16px;
        display: flex;
        flex-direction: column;
    }

    .chat-widget.is-large .chat-widget-inner {
        width: 100%;
        max-height: 100%;
        display: flex;
        flex-direction: column;
    }

    .chat-quick-actions {
        border-right: none;
        max-height: 180px;
    }
}

/* Close button */

.chat-close-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    color: #777;
    padding: 4px 6px;
    z-index: 2;
}

.chat-close-btn:hover {
    color: #000;
}

/* Header */

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 10px 14px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(90deg, #f9f9fb, #f5e7e7);
}

.chat-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.chat-avatar-bot {
    background: radial-gradient(circle at 30% 0, #ff3b3b, #931010);
    color: #fff;
    box-shadow: 0 8px 18px rgba(214, 0, 0, 0.55);
}

.chat-title {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-width: 260px;
}

.chat-title strong {
    font-size: 0.9rem;
    color: var(--text-main, #111827);
}

.chat-title span {
    font-size: 0.78rem;
    color: var(--text-muted, #6b7280);
}

/* Header actions */

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-header-btn {
    border: none;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-muted, #6b7280);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
    transition:
        background 0.2s ease,
        transform 0.1s ease,
        box-shadow 0.2s ease,
        color 0.2s ease;
}

.chat-header-btn:hover {
    background: #ffffff;
    color: var(--text-main, #111827);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* Messages */

.chat-messages {
    flex: 1;
    padding: 8px 8px 6px;
    overflow-y: auto;
    background: linear-gradient(180deg, #f0f1f6, #f6f6fb);
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.7);
    border-radius: 999px;
}

/* Quick actions */

.chat-quick-actions {
    padding: 0.7rem 0.9rem 0.5rem;
    border-bottom: 1px solid var(--border-soft, #e0e3ec);
    background: var(--bg-alt, #f5f5f7);
    max-height: 200px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.chat-quick-actions__title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-muted, #6b7280);
}

.chat-quick-actions__group {
    margin-bottom: 0.55rem;
}

.chat-quick-actions__group-title {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-main, #111827);
    opacity: 0.85;
}

.chat-quick-actions__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.chat-quick-action {
    border: 1px solid var(--border-soft, #d0d3dd);
    background: var(--card-bg, #ffffff);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
    line-height: 1.3;
    cursor: pointer;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main, #111827);
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.05s ease,
        color 0.15s ease;
}

.chat-quick-action:hover {
    border-color: var(--accent, #d60000);
    background: var(--accent-soft, rgba(214, 0, 0, 0.1));
    color: var(--accent, #d60000);
    transform: translateY(-1px);
}

/* Chat messages */

.chat-message {
    display: flex;
    margin: 0.35rem 0.7rem;
}

.chat-message--user {
    justify-content: flex-end;
}

.chat-message--bot {
    justify-content: flex-start;
}

.chat-message__bubble {
    max-width: 80%;
    padding: 0.6rem 0.85rem;
    border-radius: 1rem;
    font-size: 0.87rem;
    line-height: 1.5;
    box-shadow: var(--shadow-soft, 0 10px 30px rgba(0, 0, 0, 0.08));
}

.chat-message--user .chat-message__bubble {
    background: var(--accent, #d60000);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}

.chat-message--bot .chat-message__bubble {
    background: var(--card-bg, #ffffff);
    color: var(--text-main, #111827);
    border-bottom-left-radius: 0.25rem;
}

.chat-message__bubble p + p {
    margin-top: 0.3rem;
}

.chat-message__bubble ul,
.chat-message__bubble ol {
    margin: 0.25rem 0 0.25rem 1.1rem;
    padding: 0;
}

.chat-message__bubble li {
    margin: 0.15rem 0;
}

.chat-message__bubble code {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.82em;
    padding: 0.1em 0.35em;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.06);
    color: inherit;
}

.chat-message__bubble pre {
    margin: 0.3rem 0;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.06);
    font-size: 0.8rem;
    overflow-x: auto;
}

/* Footer (chat) */

.chat-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 6px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f9f9fb;
}

.chat-hint {
    font-size: 0.72rem;
    color: #7a7f8c;
}

.chat-hint a {
    color: var(--accent, #d60000);
    text-decoration: none;
    border-bottom: 1px solid rgba(214, 0, 0, 0.5);
}

.chat-hint a:hover {
    border-bottom-color: #000;
}

/* Формочка (file + textarea + send) */

.chat-form {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 6px;
    align-items: flex-end;
}

/* File attach */

.chat-file-label {
    position: relative;
    font-size: 1rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 999px;
    background: #e4e7f2;
    color: var(--text-main, #111827);
}

.chat-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.chat-file-info {
    grid-column: 1 / 4;
    font-size: 0.74rem;
    color: var(--text-muted, #6b7280);
    min-height: 14px;
}

/* Textarea + send */

.chat-input {
    width: 100%;
    max-height: 96px;
    padding: 7px 10px 9px;
    border-radius: 14px;
    border: 1px solid #c6cad6;
    font-size: 0.86rem;
    background: #ffffff;
    color: #111111;
    resize: none;
    line-height: 1.4;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent, #d60000);
    box-shadow: 0 0 0 1px rgba(214, 0, 0, 0.2);
}

.chat-send-btn {
    border-radius: 999px;
    border: none;
    padding: 8px 12px;
    font-size: 0.95rem;
    cursor: pointer;
    background: linear-gradient(135deg, #ff3b3b, #b01010);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(214, 0, 0, 0.45);
    transition:
        transform 0.1s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.chat-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(214, 0, 0, 0.6);
    background: linear-gradient(135deg, #ff4d4d, #cc1010);
}

/* Email summary button */

.chat-email-btn {
    align-self: flex-end;
    margin-top: 2px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px dashed rgba(214, 0, 0, 0.7);
    background: transparent;
    color: var(--accent, #d60000);
    font-size: 0.74rem;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.1s ease,
        border-color 0.2s ease;
}

.chat-email-btn:hover {
    background: rgba(214, 0, 0, 0.06);
    transform: translateY(-1px);
    border-color: rgba(214, 0, 0, 0.9);
}

/* ==========
   RESPONSIVE TWEAKS
   ========== */

@media (max-width: 960px) {
    .hero-inner,
    .about-grid,
    .contact-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .cards-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .portfolio-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .top-bar-inner {
        flex-wrap: wrap;
    }

    .header-controls {
        margin-left: 0;
    }

    .main-nav {
        position: fixed;
        inset: 56px 0 auto 0;
        background: rgba(255, 255, 255, 0.98);
        padding: 10px 16px 12px;
        border-bottom: 1px solid rgba(15, 23, 42, 0.06);
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        transform: translateY(-140%);
        transition: transform 0.22s ease;
        z-index: 40;
    }

    body.nav-open .main-nav {
        transform: translateY(0);
    }

    .nav-toggle {
        display: inline-flex;
    }
}

@media (max-width: 640px) {
    .hero {
        padding-top: 60px;
    }

    .section {
        padding: 42px 0;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* =========================
   STAIR WIZARD – MODAL
   ========================= */

.stair-wizard {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
}

.stair-wizard.is-open {
    display: flex;
}

.stair-wizard__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 20, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.stair-wizard__panel {
    position: relative;
    z-index: 1;
    width: min(980px, 96vw);
    max-height: 92vh;
    border-radius: 22px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-soft, #dde0eb);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Close button */

.stair-wizard__close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    border-radius: 999px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    z-index: 2;
    transition:
        background 0.2s ease,
        transform 0.1s ease,
        color 0.2s ease;
}

.stair-wizard__close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-main, #111827);
    transform: translateY(-1px);
}

/* Header */

.stair-wizard__header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: linear-gradient(90deg, #f9f9fb, #f5e7e7);
}

.stair-wizard__header h2 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.stair-wizard__header p {
    font-size: 0.86rem;
    color: var(--text-muted, #6b7280);
}

/* Body layout */

.stair-wizard__body {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 320px;
    flex: 1 1 auto;
    overflow-y: auto;
}

.stair-wizard__steps {
    padding: 14px 14px 12px;
    border-right: 1px solid var(--border-soft, #dde0eb);
    background: var(--bg-alt, #f5f5f7);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stair-wizard__content {
    padding: 14px 18px 10px;
    overflow: visible;
}

/* Steps sidebar */

.stair-wizard__step-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 12px;
    font-size: 0.82rem;
    color: var(--text-muted, #6b7280);
}

.stair-wizard__step-indicator.is-active {
    background: var(--accent-soft, rgba(214, 0, 0, 0.1));
    color: var(--accent, #d60000);
}

.stair-wizard__step-num {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.7);
}

.stair-wizard__step-indicator.is-active .stair-wizard__step-num {
    border-color: rgba(214, 0, 0, 0.9);
}

/* Step content */

.stair-wizard__step {
    display: none;
}

.stair-wizard__step.is-active {
    display: block;
}

.stair-wizard__content h3 {
    font-size: 1.02rem;
    margin-bottom: 6px;
}

.stair-wizard__intro {
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 10px;
}

/* Grid helpers */

.stair-wizard__grid--two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
    gap: 18px;
    align-items: flex-start;
}

.stair-wizard__col {
    min-width: 0;
}

.stair-wizard__col--notes {
    font-size: 0.86rem;
}

.sw-step1-list {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 0.86rem;
    color: var(--text-muted, #4b5563);
}

/* Form fields */

.stair-wizard__field {
    margin-bottom: 12px;
}

.stair-wizard__field > label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main, #0f172a);
    margin-bottom: 3px;
}

.stair-wizard__field label span {
    font-weight: 400;
    color: var(--text-muted, #6b7280);
    font-size: 0.76rem;
}

.stair-wizard__field input[type="number"],
.stair-wizard__field input[type="text"],
.stair-wizard__field select {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 8px;
    font-size: 0.82rem;
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
    box-sizing: border-box;
}

.stair-wizard__field input:focus,
.stair-wizard__field select:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
    background: #ffffff;
}

.stair-wizard__hint {
    margin: 3px 0 0;
    font-size: 0.72rem;
    color: var(--text-muted, #6b7280);
}

.stair-wizard__hint-small {
    margin: 4px 0 0;
    font-size: 0.7rem;
    color: var(--text-muted, #6b7280);
}

/* STEP 2 – Geometry layout */

.sw-geom-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 8px 0 10px;
}

.sw-geom-note {
    font-size: 0.78rem;
    color: var(--text-muted, #6b7280);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.78rem;
    border-radius: 999px;
}

/* Табличка з усіма параметрами */

.sw-geom-grid {
    display: grid;
    grid-auto-rows: auto;
    gap: 10px;
    margin-bottom: 12px;
}

.sw-geom-row {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.8fr) minmax(0, 0.6fr);
    gap: 10px 14px;
    align-items: flex-start;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(249, 250, 251, 0.9);
}

.sw-geom-label {
    font-size: 0.8rem;
    color: var(--text-main, #0f172a);
}

.sw-geom-label-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 2px;
}

.sw-geom-input input[type="number"] {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(255, 255, 255, 0.96);
    padding: 6px 8px;
    font-size: 0.82rem;
    box-sizing: border-box;
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.sw-geom-input input[type="number"]:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
    background: #ffffff;
}

.sw-geom-input input[disabled] {
    background: rgba(249, 250, 251, 0.8);
    cursor: not-allowed;
}

/* Ліміти */

.sw-geom-limits {
    margin: 2px 0 0;
    font-size: 0.72rem;
    color: #4b5563;
}

/* Auto / Manual toggle */

.sw-geom-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.sw-geom-toggle--disabled {
    font-size: 0.76rem;
    color: var(--text-muted, #9ca3af);
}

.sw-geom-toggle-label {
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px dashed rgba(148, 163, 184, 0.7);
}

/* Кнопка авто */

.sw-toggle-auto {
    min-width: 72px;
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid rgba(148, 163, 184, 0.8);
    background: #ffffff;
    font-size: 0.78rem;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.sw-toggle-auto.is-auto {
    background: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.7);
    color: #b91c1c;
}

.sw-toggle-auto.is-manual {
    background: rgba(34, 197, 94, 0.06);
    border-color: rgba(34, 197, 94, 0.8);
    color: #15803d;
}

/* Маленькі статусні індикатори біля параметрів */

.sw-geom-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    line-height: 1;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid transparent;
}

/* neutral – сірий */
.sw-geom-status--neutral {
    background: rgba(148, 163, 184, 0.16);
    border-color: rgba(148, 163, 184, 0.6);
    color: #6b7280;
}

/* ok – зелений */
.sw-geom-status--ok {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(22, 163, 74, 0.9);
    color: #16a34a;
}

/* warn – жовтий */
.sw-geom-status--warn {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(217, 119, 6, 0.9);
    color: #d97706;
}

/* bad – червоний */
.sw-geom-status--bad {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(220, 38, 38, 0.9);
    color: #dc2626;
}

/* Notes + result */

.stair-wizard__notes-wrap {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border-soft, #e5e7eb);
    background: var(--bg-alt, #ffffff);
}

.stair-wizard__notes-box {
    font-size: 0.8rem;
    color: var(--text-main, #111827);
}

.stair-wizard__result {
    border-radius: 14px;
    border: 1px solid var(--border-soft, #e5e7eb);
    background: var(--bg-alt, #ffffff);
    padding: 12px 14px 14px;
    font-size: 0.9rem;
    margin-top: 10px;
}

.sw-result-header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    padding-bottom: 4px;
    margin-bottom: 4px;
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
}

.sw-result-main p {
    font-size: 0.84rem;
    margin: 2px 0;
}

/* Step 3 summary */

.stair-wizard__summary {
    border-radius: 14px;
    border: 1px solid var(--border-soft, #e5e7eb);
    background: var(--bg-alt, #ffffff);
    padding: 12px 14px 14px;
    font-size: 0.86rem;
    margin-bottom: 10px;
}

.stair-wizard__summary h4 {
    font-size: 0.94rem;
    margin-bottom: 4px;
}

.stair-wizard__summary ul {
    margin: 4px 0 4px;
    padding-left: 18px;
}

/* Message box */

.sw-message-box {
    width: 100%;
    margin-top: 8px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.8);
    padding: 8px 10px;
    font-size: 0.84rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

/* Footer */

.stair-wizard__footer {
    padding: 10px 16px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9f9fb;
}

.stair-wizard__footer-spacer {
    flex: 1;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 800px) {
    .stair-wizard__body {
        grid-template-columns: minmax(0, 1fr);
    }

    .stair-wizard__steps {
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-soft, #dde0eb);
    }

    .stair-wizard__step-indicator {
        flex: 1;
    }

    .stair-wizard__grid--two-col {
        grid-template-columns: minmax(0, 1fr);
    }

    .sw-geom-row {
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr);
    }

    .sw-geom-toggle {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .stair-wizard__panel {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* =========================
   DARK MODE
   ========================= */

body.dark-mode .stair-wizard__panel {
    background: #0c1018;
    border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .stair-wizard__header {
    background: linear-gradient(90deg, #191f2f, #241b1b);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .stair-wizard__steps {
    background: #101322;
    border-right-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .stair-wizard__content {
    background: transparent;
}

body.dark-mode .sw-geom-row {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(148, 163, 184, 0.4);
}

body.dark-mode .sw-geom-input input[type="number"] {
    background: #090c15;
    border-color: #2b3243;
    color: #f5f5f5;
}

body.dark-mode .stair-wizard__notes-wrap,
body.dark-mode .stair-wizard__result,
body.dark-mode .stair-wizard__summary {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .sw-message-box {
    background: #090c15;
    border-color: #374151;
    color: #f9fafb;
}
