/* BelegBridge — self-hosted design system (zero external fonts, CDNs or trackers; DSGVO / § 25 TDDDG). */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --c-bg: #f7f8fb;
  --c-surface: #ffffff;
  --c-muted-bg: #f1f4f9;
  --c-ink: #0b1324;
  --c-ink-2: #2a364b;
  --c-ink-3: #5b6880;
  --c-line: #e3e8f0;
  --c-line-strong: #cbd3e1;
  --c-brand: #1f4fd8;
  --c-brand-ink: #173ea9;
  --c-brand-soft: #eaf0ff;
  --c-accent: #0f9f6e;
  --c-success: #12784f;
  --c-success-bg: #ecfaf3;
  --c-success-line: #b7ebd2;
  --c-warning: #9a5b00;
  --c-warning-bg: #fff7e6;
  --c-warning-line: #fbdc9b;
  --c-danger: #b42318;
  --c-danger-bg: #fef1f0;
  --c-danger-line: #f9c7c2;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(11, 19, 36, .06);
  --shadow: 0 6px 24px -8px rgba(11, 19, 36, .14), 0 2px 6px rgba(11, 19, 36, .05);
  --shadow-lg: 0 24px 60px -20px rgba(11, 19, 36, .35);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--c-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: var(--font-mono); font-size: .9em; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--c-ink); margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid rgba(31, 79, 216, .45); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

/* Utilities */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
.muted { color: var(--c-ink-3); }
.small { font-size: .875rem; }
.xsmall { font-size: .78rem; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.stack > * + * { margin-top: .75rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--c-ink); color: #fff; padding: .5rem .9rem; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }

/* Layout */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 1.25rem; }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-tight { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section-alt { background: var(--c-surface); border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); }
.section-head { max-width: 720px; margin: 0 auto 2.5rem; text-align: center; }
.section-head .lead { margin-left: auto; margin-right: auto; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-brand); margin-bottom: .6rem; }
.lead { font-size: 1.125rem; color: var(--c-ink-2); max-width: 680px; }
.grid-2 { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 1.5rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.2rem; font: inherit; font-size: .95rem; font-weight: 650; line-height: 1.2;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--c-brand); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, var(--shadow-sm); }
.btn-primary:hover { background: var(--c-brand-ink); }
.btn-secondary { background: var(--c-surface); color: var(--c-ink); border-color: var(--c-line-strong); }
.btn-secondary:hover { border-color: var(--c-ink-3); }
.btn-ghost { background: transparent; color: var(--c-ink-2); }
.btn-ghost:hover { background: var(--c-muted-bg); }
.btn-dark { background: var(--c-ink); color: #fff; }
.btn-dark:hover { background: #1c2740; }
.btn-sm { padding: .5rem .85rem; font-size: .875rem; }
.btn-lg { padding: .9rem 1.5rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.htmx-request { opacity: .7; cursor: progress; }

/* Badges & chips */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; font-size: .76rem; font-weight: 650; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.badge-info { background: var(--c-brand-soft); color: var(--c-brand-ink); border-color: #cddafc; }
.badge-success { background: var(--c-success-bg); color: var(--c-success); border-color: var(--c-success-line); }
.badge-warning { background: var(--c-warning-bg); color: var(--c-warning); border-color: var(--c-warning-line); }
.badge-danger { background: var(--c-danger-bg); color: var(--c-danger); border-color: var(--c-danger-line); }
.badge-neutral { background: var(--c-muted-bg); color: var(--c-ink-2); border-color: var(--c-line); }
.chip-list { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding-left: 1.6rem; margin: .45rem 0; color: var(--c-ink-2); }
.check-list li::before { content: ""; position: absolute; left: 0; top: .42em; width: 1rem; height: 1rem; border-radius: 50%; background: var(--c-success-bg); border: 1px solid var(--c-success-line); }
.check-list li::after { content: ""; position: absolute; left: .34rem; top: .62em; width: .32rem; height: .55rem; border: solid var(--c-success); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Cards */
.card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); padding: 1.75rem; box-shadow: var(--shadow-sm); }
.card-muted { background: var(--c-muted-bg); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1.25rem; }
.feature-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); padding: 1.6rem; box-shadow: var(--shadow-sm); height: 100%; }
.feature-card h3 { margin-top: .9rem; }
.feature-card p { color: var(--c-ink-3); margin: 0; }
.icon-tile { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--c-brand-soft); color: var(--c-brand); font-weight: 800; font-size: 1.05rem; }
.icon-tile svg { width: 22px; height: 22px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--c-line); }
.nav-row { display: flex; align-items: center; gap: 1.25rem; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--c-ink); font-weight: 800; font-size: 1.08rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--c-brand), #3a7bfd); color: #fff; font-size: .78rem; font-weight: 800; letter-spacing: .02em; }
.brand-badge { font-size: .7rem; font-weight: 650; color: var(--c-success); background: var(--c-success-bg); border: 1px solid var(--c-success-line); border-radius: 999px; padding: .12rem .5rem; }
.nav-main { display: flex; align-items: center; justify-content: center; gap: .25rem; flex: 1; }
.nav-main a { color: var(--c-ink-2); font-size: .93rem; font-weight: 550; padding: .45rem .7rem; border-radius: var(--radius-sm); white-space: nowrap; }
.nav-main a:hover { background: var(--c-muted-bg); color: var(--c-ink); text-decoration: none; }
.nav-main a[aria-current="page"] { color: var(--c-brand); background: var(--c-brand-soft); }
.nav-main .nav-mobile-only { display: none; }
.nav-actions { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.lang-switch { display: inline-flex; padding: 3px; border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-muted-bg); }
.lang-switch a { font-size: .78rem; font-weight: 700; color: var(--c-ink-3); padding: .22rem .55rem; border-radius: 6px; letter-spacing: .04em; }
.lang-switch a:hover { text-decoration: none; color: var(--c-ink); }
.lang-switch a.active { background: var(--c-surface); color: var(--c-ink); box-shadow: var(--shadow-sm); }
.nav-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-surface); cursor: pointer; padding: 0; align-items: center; justify-content: center; flex-direction: column; gap: 4px; }
.nav-toggle-bar { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--c-ink); }
@media (max-width: 1060px) {
  .nav-row { gap: .75rem; }
  .nav-main a { padding: .4rem .5rem; font-size: .88rem; }
  .brand-badge { display: none; }
}
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav-cta { display: none; }
  .nav-main {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: .75rem 1.25rem 1.25rem;
    background: var(--c-surface); border-bottom: 1px solid var(--c-line); box-shadow: var(--shadow);
  }
  .nav-main a { padding: .8rem .5rem; font-size: 1rem; border-bottom: 1px solid var(--c-line); border-radius: 0; }
  .nav-main .nav-mobile-only { display: block; margin-top: .9rem; border: 0; text-align: center; border-radius: var(--radius-sm); color: #fff; }
  .site-header[data-open="true"] .nav-main { display: flex; }
}

/* Hero */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); background: radial-gradient(1200px 400px at 50% -120px, #dfe8ff 0%, rgba(223, 232, 255, 0) 70%); }
.hero-inner { max-width: 860px; margin: 0 auto; text-align: center; }
.hero h1 { margin-bottom: 1rem; }
.hero .lead { margin: 0 auto 1.75rem; font-size: 1.2rem; }
.hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.trust-row { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; padding: 0; list-style: none; color: var(--c-ink-3); font-size: .9rem; }
.trust-row li { display: inline-flex; align-items: center; gap: .45rem; }
.trust-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent); }

/* Validator */
.validator-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .validator-grid { grid-template-columns: 1fr; } }
.validator-card { padding: 1.5rem; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .35rem;
  min-height: 190px; padding: 2rem 1.25rem; border: 2px dashed var(--c-line-strong); border-radius: var(--radius);
  background: var(--c-muted-bg); cursor: pointer; transition: border-color .15s ease, background-color .15s ease;
}
.dropzone:hover, .dropzone.is-dragover, .dropzone:focus-within { border-color: var(--c-brand); background: var(--c-brand-soft); }
.dropzone-title { font-weight: 700; font-size: 1.08rem; color: var(--c-ink); }
.dropzone-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dropzone-icon { width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--c-surface); color: var(--c-brand); border: 1px solid var(--c-line); margin-bottom: .4rem; }
.file-chip { display: inline-flex; align-items: center; gap: .5rem; margin-top: .4rem; font-size: .88rem; font-weight: 600; color: var(--c-brand-ink); background: var(--c-surface); border: 1px solid #cddafc; padding: .25rem .65rem; border-radius: 999px; }
.validator-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.spinner { display: none; align-items: center; gap: .5rem; color: var(--c-ink-3); font-size: .9rem; }
.spinner::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--c-line-strong); border-top-color: var(--c-brand); animation: spin .8s linear infinite; }
.htmx-request .spinner, .htmx-request.spinner { display: inline-flex; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-area { margin-top: 1.5rem; }
.result-area:empty { display: none; }

/* Verdict & violations */
.verdict { border-radius: var(--radius-lg); border: 1px solid var(--c-line); background: var(--c-surface); padding: 1.4rem 1.5rem; box-shadow: var(--shadow-sm); }
.verdict-head { display: flex; gap: 1rem; align-items: flex-start; }
.verdict-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.15rem; }
.verdict h3 { margin: 0 0 .25rem; font-size: 1.2rem; }
.verdict p { margin: 0; color: var(--c-ink-2); }
.verdict-valid { border-color: var(--c-success-line); background: linear-gradient(180deg, var(--c-success-bg), var(--c-surface) 70%); }
.verdict-valid .verdict-icon { background: var(--c-success); color: #fff; }
.verdict-invalid { border-color: var(--c-danger-line); background: linear-gradient(180deg, var(--c-danger-bg), var(--c-surface) 70%); }
.verdict-invalid .verdict-icon { background: var(--c-danger); color: #fff; }
.verdict-warning { border-color: var(--c-warning-line); background: linear-gradient(180deg, var(--c-warning-bg), var(--c-surface) 70%); }
.verdict-warning .verdict-icon { background: #d98a00; color: #fff; }
.verdict-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.verdict-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
.violations { margin-top: 1.25rem; display: grid; gap: .75rem; }
.violation { border: 1px solid var(--c-line); border-left-width: 4px; border-radius: var(--radius); padding: .9rem 1rem; background: var(--c-surface); }
.violation-fatal { border-left-color: var(--c-danger); }
.violation-warning { border-left-color: #d98a00; }
.violation-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .3rem; }
.violation-title { font-weight: 700; color: var(--c-ink); }
.violation-fix { margin: .2rem 0 0; color: var(--c-ink-2); font-size: .94rem; }
.violation details { margin-top: .5rem; font-size: .82rem; color: var(--c-ink-3); }
.violation summary { cursor: pointer; }
.violation code { word-break: break-all; }
.rule-id { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; color: var(--c-ink-2); background: var(--c-muted-bg); border: 1px solid var(--c-line); padding: .08rem .45rem; border-radius: 5px; }
.preview-wrap { margin-top: 1.5rem; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.preview-head h3 { margin: 0; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; counter-reset: step; position: relative; list-style: none; padding: 0; margin: 0; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }
.step-card { position: relative; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); padding: 1.6rem; box-shadow: var(--shadow-sm); }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--c-ink); color: #fff; font-weight: 800; margin-bottom: .9rem; }
.step-card h3 { margin-bottom: .4rem; }
.step-card p { color: var(--c-ink-3); margin: 0 0 .9rem; }
.step-tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.step-arrow { display: none; }
@media (min-width: 901px) {
  .step-card:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -1.05rem; width: .6rem; height: .6rem; border-top: 2px solid var(--c-line-strong); border-right: 2px solid var(--c-line-strong); transform: translateY(-50%) rotate(45deg); }
}

/* Pricing */
.pricing-toggle { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--c-surface); border: 1px solid var(--c-line); box-shadow: var(--shadow-sm); }
.pricing-toggle button { border: 0; background: transparent; font: inherit; font-size: .9rem; font-weight: 650; color: var(--c-ink-3); padding: .5rem 1rem; border-radius: 999px; cursor: pointer; }
.pricing-toggle button[aria-pressed="true"] { background: var(--c-ink); color: #fff; }
.pricing-toggle .save { margin-left: .35rem; font-size: .72rem; color: var(--c-accent); font-weight: 750; }
.pricing-toggle button[aria-pressed="true"] .save { color: #7ff0c3; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin-top: 2rem; align-items: stretch; }
@media (max-width: 960px) { .pricing-grid { grid-template-columns: 1fr; max-width: 520px; margin-left: auto; margin-right: auto; } }
.plan-card { position: relative; display: flex; flex-direction: column; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); padding: 1.8rem; box-shadow: var(--shadow-sm); }
.plan-card.featured { border: 2px solid var(--c-brand); box-shadow: var(--shadow); }
.plan-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); }
.plan-name { font-size: 1.25rem; font-weight: 800; margin: 0; }
.plan-audience { color: var(--c-ink-3); font-size: .92rem; margin: .3rem 0 1.2rem; min-height: 2.9em; }
.plan-price { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.plan-amount { font-size: 2.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.plan-period { color: var(--c-ink-3); font-size: .95rem; }
.plan-sub { color: var(--c-ink-3); font-size: .85rem; margin-top: .4rem; min-height: 1.4em; }
.plan-meta { list-style: none; padding: 1rem 0; margin: 1.2rem 0 .4rem; border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); display: grid; gap: .4rem; font-weight: 650; color: var(--c-ink); font-size: .94rem; }
.plan-features { flex: 1; margin: .6rem 0 1.4rem; }
.plan-extra { font-size: .82rem; color: var(--c-ink-3); margin: -.6rem 0 1.2rem; }
.plan-cta { margin-top: auto; }
.pricing-notes { margin-top: 1.75rem; text-align: center; color: var(--c-ink-3); font-size: .88rem; }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: .75rem; }
.faq details { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--c-ink-3); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: .75rem 0 0; color: var(--c-ink-2); }

/* CTA band */
.cta-band { background: linear-gradient(135deg, #0f1d3d, #1f4fd8); color: #fff; border-radius: var(--radius-lg); padding: clamp(2rem, 5vw, 3rem); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; box-shadow: var(--shadow-lg); }
.cta-band h2 { color: #fff; margin: 0 0 .35rem; }
.cta-band p { color: #cfdbff; margin: 0; max-width: 560px; }
.cta-band .btn-secondary { border-color: transparent; }

/* Callouts & alerts */
.callout { border-radius: var(--radius); border: 1px solid #cddafc; border-left: 4px solid var(--c-brand); background: var(--c-brand-soft); padding: 1rem 1.2rem; margin: 1.25rem 0; color: var(--c-ink-2); }
.callout > :last-child { margin-bottom: 0; }
.callout-success { border-color: var(--c-success-line); border-left-color: var(--c-success); background: var(--c-success-bg); }
.callout-warning { border-color: var(--c-warning-line); border-left-color: #d98a00; background: var(--c-warning-bg); }
.callout-danger { border-color: var(--c-danger-line); border-left-color: var(--c-danger); background: var(--c-danger-bg); }
.alert { border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1rem; font-size: .92rem; }
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert-error { background: var(--c-danger-bg); color: var(--c-danger); border: 1px solid var(--c-danger-line); }
.alert-success { background: var(--c-success-bg); color: var(--c-success); border: 1px solid var(--c-success-line); }
.config-notice { background: var(--c-warning-bg); border-bottom: 1px solid var(--c-warning-line); color: var(--c-warning); font-size: .86rem; padding: .55rem 0; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-surface); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .7rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--c-line); }
.table th { background: var(--c-muted-bg); font-weight: 700; color: var(--c-ink); font-size: .84rem; }
.table tr:last-child td { border-bottom: 0; }

/* Page hero & prose (sub-pages, legal documents, API docs) */
.page-hero { padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 4vw, 2.5rem); background: radial-gradient(900px 300px at 50% -100px, #e4ebff 0%, rgba(228, 235, 255, 0) 70%); border-bottom: 1px solid var(--c-line); }
.page-hero h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin-bottom: .6rem; }
.page-hero .lead { margin-bottom: 0; }
.page-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.page-body { padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 7vw, 5rem); }
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 2.5rem; align-items: start; }
@media (max-width: 900px) { .doc-layout { grid-template-columns: 1fr; } .toc { position: static !important; } }
.toc { position: sticky; top: calc(var(--header-h) + 20px); font-size: .9rem; }
.toc h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--c-ink-3); margin-bottom: .6rem; }
.toc ol, .toc ul { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--c-line); }
.toc li a { display: block; padding: .3rem .8rem; color: var(--c-ink-2); }
.toc li a:hover { color: var(--c-brand); text-decoration: none; }
.prose { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: var(--shadow-sm); color: var(--c-ink-2); }
.prose h2 { font-size: 1.3rem; margin: 2.2rem 0 .7rem; color: var(--c-ink); scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; color: var(--c-ink); }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1rem; }
.prose li { margin: .35rem 0; }
.prose address { font-style: normal; line-height: 1.7; }
.prose dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0 0 1rem; }
.prose dt { font-weight: 700; color: var(--c-ink); }
.prose dd { margin: 0; }
@media (max-width: 600px) { .prose dl { grid-template-columns: 1fr; } .prose dd { margin-bottom: .5rem; } }
.prose code { background: var(--c-muted-bg); border: 1px solid var(--c-line); padding: .05rem .35rem; border-radius: 4px; }
.doc-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.25rem; }
.lang-note { font-size: .88rem; color: var(--c-ink-3); font-style: italic; }

/* API docs */
pre.code { background: #0e1729; color: #dbe4ff; border-radius: var(--radius); padding: 1rem 1.2rem; overflow-x: auto; font-size: .84rem; line-height: 1.55; margin: 0 0 1.25rem; }
pre.code code { background: none; border: 0; padding: 0; color: inherit; }
.endpoint { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: .95rem; font-weight: 700; color: var(--c-ink); margin: 0 0 .6rem; }
.method { font-family: var(--font-sans); font-size: .72rem; font-weight: 800; letter-spacing: .06em; padding: .18rem .5rem; border-radius: 5px; color: #fff; }
.method-post { background: #12784f; }
.method-get { background: var(--c-brand); }

/* Modal (native <dialog>) */
.modal { border: 0; padding: 0; background: transparent; max-width: min(520px, calc(100vw - 2rem)); width: 100%; }
.modal::backdrop { background: rgba(11, 19, 36, .55); backdrop-filter: blur(2px); }
.modal-card { position: relative; background: var(--c-surface); border-radius: var(--radius-lg); padding: 1.9rem; box-shadow: var(--shadow-lg); }
.modal-close { position: absolute; top: .8rem; right: .8rem; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--c-line); background: var(--c-surface); font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--c-ink-2); }
.modal h2 { font-size: 1.45rem; margin-bottom: .35rem; padding-right: 2rem; }

/* Forms */
.form-grid { display: grid; gap: .9rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.field label { display: block; font-size: .86rem; font-weight: 650; color: var(--c-ink); margin-bottom: .3rem; }
.field input, .field select, .field textarea { width: 100%; font: inherit; font-size: .95rem; padding: .62rem .75rem; border: 1px solid var(--c-line-strong); border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-ink); }
.field input:focus, .field select:focus { border-color: var(--c-brand); outline: 3px solid rgba(31, 79, 216, .18); }
.checkbox { display: flex; gap: .6rem; align-items: flex-start; font-size: .86rem; color: var(--c-ink-2); }
.checkbox input { margin-top: .25rem; width: 16px; height: 16px; flex: 0 0 auto; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.fineprint { font-size: .78rem; color: var(--c-ink-3); margin: .25rem 0 0; }
.success-state { text-align: center; padding: .5rem 0; }
.success-state .verdict-icon { margin: 0 auto 1rem; background: var(--c-success); color: #fff; }

/* Footer */
.site-footer { background: #0b1324; color: #b7c3da; margin-top: 0; padding: 3.5rem 0 2rem; font-size: .92rem; }
.site-footer a { color: #dbe4f5; }
.site-footer a:hover { color: #fff; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; padding-bottom: 2rem; margin-bottom: 2rem; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.footer-top .brand { color: #fff; }
.footer-tagline { max-width: 420px; margin: .75rem 0 0; color: #93a1bd; }
.footer-trust { display: flex; flex-wrap: wrap; gap: .5rem; }
.footer-trust .badge { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: #dbe4f5; }
.footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h2 { color: #fff; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .9rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.footer-grid button.linklike { background: none; border: 0; padding: 0; font: inherit; color: #dbe4f5; cursor: pointer; }
.footer-grid button.linklike:hover { color: #fff; text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .1); color: #8391ad; font-size: .84rem; }

/* Scoped invoice preview wrapper (visualizer fragment provides its own .bb-invoice styles) */
.bb-invoice-frame { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--c-line); background: var(--c-muted-bg); }

/* Print */
@media print {
  .site-header, .site-footer, .config-notice, .doc-actions, .toc, .modal, .skip-link, .nav-toggle { display: none !important; }
  body { background: #fff; }
  .prose { border: 0; box-shadow: none; padding: 0; }
  .doc-layout { grid-template-columns: 1fr; }
  .page-hero { background: none; border: 0; padding: 0 0 1rem; }
}
