*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: var(--base-size, 16px); scroll-behavior: smooth; }

body {
    font-family: var(--font-family, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif);
    font-size: max(var(--min-size, 14px), 1rem);
    background: var(--bg, #f8fafc);
    color: var(--text, #0f172a);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 {
    color: var(--heading, #0f172a);
    margin-bottom: 0.75rem;
    font-size: max(var(--min-size, 14px), 1.25rem);
    font-family: var(--font-family, inherit);
}
h1 { font-size: max(var(--min-size, 14px), var(--heading-size, 1.75rem)); }

p, li { color: var(--text, #0f172a); }
label { color: inherit; font-weight: 600; }
.muted, .text-muted, .hint { color: var(--text-muted, #475569); }

a { color: var(--link, #2563eb); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* Cards remap page tokens to card palette (same pattern as TE) */
.card,
.product-card,
.purchase-box,
.stat-card {
    --text: var(--card-text, #111827);
    --text-muted: var(--card-muted, #4b5563);
    --heading: var(--card-heading, #111827);
    --link: var(--card-link, var(--primary, #2563eb));
}

.site-header {
    background: var(--menu-bg, var(--primary, #1e40af));
    color: var(--menu-text, #ffffff);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border, #cbd5e1);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}
.site-header a { color: var(--menu-text, #ffffff); text-decoration: none; }
.site-header a:hover { color: var(--menu-link, #e0e7ff); text-decoration: none; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand-block { display: flex; flex-direction: column; gap: 0.1rem; text-decoration: none; line-height: 1.2; }
.brand-block:hover { text-decoration: none; }
.brand { font-weight: 700; font-size: 1.2rem; color: var(--menu-text, #ffffff); }
.brand-tagline {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--menu-link, #e0e7ff);
    opacity: 0.92;
    max-width: 16rem;
}
.site-nav { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; font-size: .95rem; }
.site-nav a:hover { color: var(--menu-link, #e0e7ff); }

.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-family: var(--menu-font-family, inherit);
    font-size: var(--menu-font-size, inherit);
}
.nav-dropdown-parent,
.nav-dropdown-toggle {
    color: var(--menu-text, #ffffff);
    font-family: var(--menu-font-family, inherit);
    font-size: var(--menu-font-size, .95rem);
    text-decoration: none;
}
.nav-dropdown-parent:hover,
.nav-dropdown-toggle:hover { color: var(--menu-link, #e0e7ff); }
.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: inherit;
}
.nav-dropdown-toggle-only { padding: 0; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    margin-top: 0.35rem;
    background: var(--menu-dropdown-bg, #ffffff);
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    z-index: 50;
    overflow: hidden;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: 0.55rem 1rem;
    color: var(--text, #0f172a);
    white-space: nowrap;
    text-decoration: none;
}
.nav-dropdown-menu a:hover {
    background: var(--surface, #f8fafc);
    color: var(--link, #2563eb);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin: 0.75rem 0 1rem;
    font-size: 0.95rem;
}
.footer-nav a { color: var(--footer-link, #93c5fd); }
.footer-nav .nav-dropdown-menu a { color: var(--text, #0f172a); }

@media (max-width: 640px) {
    .brand-tagline { display: none; }
}

.homepage-hero-banner {
    width: 100%;
    aspect-ratio: var(--hero-aspect, 1200 / 250);
    line-height: 0;
    background: var(--bg, #0f172a);
    overflow: hidden;
}
.homepage-hero-banner img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.site-header--below-hero {
    border-top: 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.site-header--compact {
    padding: 0.65rem 0;
}
.site-header--compact .header-inner {
    justify-content: center;
}
.site-nav--centered {
    justify-content: center;
    width: 100%;
}

.home-cms-body .card { margin-bottom: 1.25rem; }
.home-cms-body .card:last-child { margin-bottom: 0; }

.homepage-hero-preview {
    width: 100%;
    max-width: 720px;
    aspect-ratio: var(--hero-aspect, 1200 / 250);
    margin: 0.75rem 0 1rem;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}
.homepage-hero-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.site-main { padding: 2rem 0 3rem; flex: 1; }

.site-footer {
    background: var(--footer-bg, #0f172a);
    color: var(--footer-text, #cbd5e1);
    padding: 2rem 0;
    margin-top: auto;
}
.site-footer a { color: var(--footer-link, #93c5fd); }
.site-footer .muted { color: var(--footer-text, #cbd5e1); opacity: 0.85; }

.card {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #cbd5e1);
    border-radius: var(--card-radius, 12px);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    color: var(--card-text, #111827);
}
.card h2, .card h3 { color: var(--card-heading, #111827); }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }

.hero-sales {
    background: linear-gradient(135deg, var(--secondary, #1e40af), var(--primary, #2563eb));
    color: #e2e8f0;
    border-radius: var(--card-radius, 14px);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 0;
}
.hero-sales h1 { color: #fff; font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 1rem; }
.hero-sales .lead { color: #cbd5e1; margin-bottom: .75rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: #93c5fd; margin-bottom: .5rem; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }

.btn {
    display: inline-block;
    border: 0;
    border-radius: var(--btn-radius, 8px);
    padding: .65rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}
.btn-primary { background: var(--primary, #2563eb); color: var(--on-primary, #fff); }
.btn-primary:hover { background: var(--secondary, #1e40af); color: var(--on-primary, #fff); text-decoration: none; }
.btn-secondary { background: var(--text-muted, #475569); color: #fff; }
.btn-secondary:hover { text-decoration: none; color: #fff; }
.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: .35rem .65rem; font-size: .85rem; }
.btn-danger { background: var(--danger, #dc2626); color: #fff; }

.check-list { list-style: none; padding: 0; }
.check-list li { padding: .35rem 0 .35rem 1.5rem; position: relative; color: var(--card-text, inherit); }
.check-list.positive li::before { content: "✓"; position: absolute; left: 0; color: var(--success, #059669); font-weight: 700; }
.check-list.negative li::before { content: "✕"; position: absolute; left: 0; color: var(--danger, #dc2626); font-weight: 700; }

.product-card {
    border: 1px solid var(--border, #cbd5e1);
    border-radius: var(--card-radius, 10px);
    padding: 1rem;
    background: var(--surface, #fff);
}
.product-card h3 { margin-bottom: .35rem; color: var(--card-heading, #111827); }
.price, .price-lg { font-weight: 700; color: var(--card-value, var(--primary, #2563eb)); }
.price-lg { font-size: 1.5rem; }
.badge { display: inline-block; background: #fef3c7; color: #92400e; padding: .2rem .5rem; border-radius: 999px; font-size: .8rem; }

.highlight { border-color: var(--primary, #2563eb); background: var(--surface, #f0f9ff); }

.serious-panel, .serious-card {
    border-color: var(--warning, #b45309);
    background: linear-gradient(180deg, #fffbeb, var(--surface, #fff));
}
.serious-panel h2, .serious-card h2 { color: #92400e; }
.price-note { font-size: .95rem; margin-top: .35rem; color: var(--card-muted, #64748b); }

.prose h2, .prose h3 { margin-top: 1rem; color: var(--heading, inherit); }
.prose ul, .prose ol { margin: .75rem 0 .75rem 1.25rem; }

.purchase-box hr { border: 0; border-top: 1px solid var(--border, #cbd5e1); margin: 1rem 0; }
.purchase-form label { display: block; font-weight: 600; margin: .5rem 0 .25rem; color: var(--card-text, inherit); }
.purchase-form input {
    width: 100%;
    padding: .55rem;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: var(--radius, 6px);
    margin-bottom: .5rem;
    background: var(--input-bg, #fff);
    color: var(--input-text, var(--card-text, #111827));
    font: inherit;
}

.alert { padding: .75rem 1rem; border-radius: var(--radius, 8px); margin-bottom: 1rem; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warn { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-ok { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    color: var(--table-text, #0f172a);
}
.data-table th {
    text-align: left;
    padding: .5rem;
    border-bottom: 1px solid var(--border, #cbd5e1);
    vertical-align: top;
    background: var(--table-header-bg, #f1f5f9);
    color: var(--table-heading, #0f172a);
    font-weight: 600;
}
.data-table td {
    text-align: left;
    padding: .5rem;
    border-bottom: 1px solid var(--border, #cbd5e1);
    vertical-align: top;
    color: var(--table-text, #0f172a);
}

code {
    background: var(--table-header-bg, #f1f5f9);
    padding: .1rem .35rem;
    border-radius: 4px;
    font-size: .9em;
    color: var(--card-text, inherit);
}

input, textarea, select {
    width: 100%;
    padding: .55rem;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: var(--radius, 6px);
    font: inherit;
    background: var(--input-bg, #fff);
    color: var(--input-text, var(--card-text, #111827));
}

.license-tier-box { margin-bottom: 1rem; }
.license-tier-box h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.form-inline-stack select, .form-inline-stack input { margin-bottom: .5rem; }
.help-search { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.help-search input { flex: 1; min-width: 200px; }

.stat-card strong { color: var(--card-value, var(--primary, #2563eb)); }
