:root {
    --bg: #edf6fb;
    --bg-strong: #dcebf7;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: rgba(255, 255, 255, 0.94);
    --line: rgba(65, 99, 140, 0.18);
    --text: #1a2940;
    --muted: #55657f;
    --accent: #2474c7;
    --accent-soft: #d7eafd;

    --success: #dff6dd;
    --success-strong: #2c7a42;

    --warning: #fff2d9;
    --warning-strong: #9a6500;

    --tip: #e8f4ff;
    --tip-strong: #1763aa;

    --next: #eef0ff;
    --next-strong: #4c55b5;

    --shadow: 0 18px 45px rgba(24, 58, 99, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --sidebar-width: 300px;
    --content-max: 1080px;
    --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(123, 194, 229, 0.18), transparent 30%),
        radial-gradient(circle at top right, rgba(133, 214, 175, 0.15), transparent 26%),
        linear-gradient(180deg, #f3f9fd 0%, var(--bg) 100%);
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

.site-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    background: linear-gradient(180deg, rgba(232, 244, 252, 0.96), rgba(226, 241, 251, 0.9));
    border-right: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 28px;
    height: 100%;
}

.brand {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
}

.hero h1,
.section-head h2 {
    margin: 10px 0 0;
    line-height: 1.05;
}

.brand p,
.hero p,
.section-head p,
.info-card p,
.callout p,
.faq-item p,
.hero-summary-item p {
    color: var(--muted);
    line-height: 1.65;
}

.brand p {
    margin: 14px 0 0;
}

.toc {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: auto;
    padding-right: 4px;
}

.toc a {
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 600;
    transition: 160ms ease;
}

.toc a:hover,
.toc a:focus-visible {
    color: var(--text);
    background: rgba(255, 255, 255, 0.72);
    outline: none;
}

.content {
    padding: 28px;
}

.hero,
.doc-section {
    max-width: var(--content-max);
    margin: 0 auto 24px;
}

.hero {
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72));
    box-shadow: var(--shadow);
}

.hero h1 {
    font-size: clamp(2.2rem, 4vw, 4rem);
}

.hero-lead {
    margin: 18px 0 10px;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    font-weight: 700;
    color: var(--text) !important;
    line-height: 1.45;
    max-width: 760px;
}

.hero-summary {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.hero-summary-item {
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.72);
}

.hero-summary-item strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.98rem;
}

.hero-summary-item p {
    margin: 0;
}

.hero-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 26px;
}

.product-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff, #f7fbfe);
    transition: 160ms ease;
}

.product-link:hover,
.product-link:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(24, 58, 99, 0.12);
    outline: none;
}

.product-link strong {
    display: block;
    margin-bottom: 4px;
}

.product-link small {
    display: block;
    color: var(--muted);
    line-height: 1.5;
}

.product-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    flex: 0 0 auto;
    overflow: hidden;
}

.product-link-icon svg {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    display: block;
    flex: none;
}

.product-link-icon img.ha-cta-logo {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    object-fit: contain;
    display: block;
    flex: none;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 20px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
}

.button:disabled {
    cursor: not-allowed;
}

.button.primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 16px 30px rgba(36, 116, 199, 0.24);
}

.button.secondary {
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    border-color: var(--line);
}

.doc-section {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
    scroll-margin-top: 20px;
}

.section-head {
    margin-bottom: 26px;
}

.section-head h2 {
    font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.section-body {
    display: grid;
    gap: 24px;
}

.section-body h3 {
    margin: 0 0 12px;
    font-size: 1.2rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.info-card,
.callout,
.faq-item {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.76);
}

.info-card h4 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.info-card p {
    margin: 0;
}

.bullet-list,
.step-list {
    margin: 0;
    padding-left: 22px;
    color: var(--muted);
    line-height: 1.7;
}

.bullet-list li + li,
.step-list li + li {
    margin-top: 6px;
}

.callout {
    background: linear-gradient(180deg, #f3f9ff, #eaf4ff);
}

.callout strong {
    display: block;
    margin-bottom: 10px;
}

.callout p {
    margin: 0;
}

.callout.tip {
    background: linear-gradient(180deg, #f3f9ff, #e7f3ff);
    border-color: rgba(36, 116, 199, 0.18);
}

.callout.tip strong {
    color: var(--tip-strong);
}

.callout.warning {
    background: linear-gradient(180deg, #fffaf0, #fff3df);
    border-color: rgba(154, 101, 0, 0.18);
}

.callout.warning strong {
    color: var(--warning-strong);
}

.callout.success {
    background: linear-gradient(180deg, #f4fcf2, #e8f8e5);
    border-color: rgba(44, 122, 66, 0.18);
}

.callout.success strong {
    color: var(--success-strong);
}

.callout.next-step {
    background: linear-gradient(180deg, #f5f6ff, #eceeff);
    border-color: rgba(76, 85, 181, 0.18);
}

.callout.next-step strong {
    color: var(--next-strong);
}

.faq-list {
    display: grid;
    gap: 14px;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item[open] {
    background: #fbfdff;
}

.faq-item p {
    margin: 12px 0 0;
}

.site-footer {
    max-width: var(--content-max);
    margin: 0 auto 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.site-footer p,
.muted-note {
    color: var(--muted);
    line-height: 1.6;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
}

.footer-links a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.link-button {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    color: var(--accent);
    font-weight: 700;
    font: inherit;
    cursor: pointer;
}

.link-button:hover,
.link-button:focus-visible,
.footer-links a:hover,
.footer-links a:focus-visible {
    text-decoration: underline;
    outline: none;
}

.stats-page {
    min-height: 100vh;
}

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

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

.metric {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
    margin: 10px 0 0;
    color: var(--accent);
    font-weight: 800;
}

.consent-banner {
    position: fixed;
    left: 22px;
    right: 22px;
    bottom: 22px;
    z-index: 40;
}

.consent-content {
    max-width: 1120px;
    margin: 0 auto;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 22px 48px rgba(22, 40, 68, 0.18);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.consent-content h3 {
    margin: 10px 0 8px;
}

.consent-content p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
    max-width: 760px;
}

.consent-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.consent-btn {
    min-width: 148px;
}

.nav-toggle {
    display: none;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    background: white;
    color: var(--text);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 700;
}

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

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

@media (max-width: 920px) {
    .site-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(86vw, 320px);
        transform: translateX(-100%);
        transition: transform 180ms ease;
        z-index: 20;
        box-shadow: var(--shadow);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .content {
        padding: 18px;
    }

    .stats-columns,
    .site-footer {
        grid-template-columns: 1fr;
        display: grid;
    }

    .hero,
    .doc-section,
    .site-footer {
        padding: 22px;
    }

    .hero-summary,
    .hero-links {
        grid-template-columns: 1fr;
    }

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

    .consent-banner {
        left: 14px;
        right: 14px;
        bottom: 14px;
    }

    .consent-content {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 640px) {
    .card-grid,
    .stats-grid,
    .stats-columns,
    .hero-links,
    .hero-summary {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .button {
        width: 100%;
    }

    .product-link {
        padding: 16px;
    }
}
