:root {
    --bg: #050522;
    --bg-deep: #000115;
    --surface: #ffffff;
    --surface-soft: #fff8f2;
    --border: rgba(15, 23, 42, 0.12);
    --text: #1f2937;
    --muted: #64748b;
    --primary: #f6a868;
    --primary-dark: #ffbe86;
    --warning: #f59e0b;
    --critical: #f87171;
    --info: #60a5fa;
    --success: #34d399;
    --shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
}
* { box-sizing: border-box; }
html { background: linear-gradient(180deg, var(--bg-deep) 0%, #071122 48%, #0f172a 100%); }
body.bdb-body {
    margin: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, var(--bg-deep) 0%, #071122 48%, #0f172a 100%);
    position: relative;
    min-height: 100vh;
}

h1, h2, h3 {
    font-family: 'Baloo 2', Inter, Arial, sans-serif;
}
.bdb-world {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.bdb-world__glow {
    position: absolute;
    width: 38rem;
    height: 38rem;
    border-radius: 999px;
    filter: blur(60px);
    opacity: 0.18;
}
.bdb-world__glow--one {
    top: -8rem;
    left: -10rem;
    background: rgba(246, 168, 104, 0.9);
}
.bdb-world__glow--two {
    right: -12rem;
    top: 18rem;
    background: rgba(96, 165, 250, 0.75);
}
.bdb-world__grid {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(255,255,255,0.18) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 120px 120px, 60px 60px, 60px 60px;
    background-position: 0 0, 0 0, 0 0;
    opacity: 0.25;
}
.bdb-page {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
    padding: 40px 20px 72px;
}
.bdb-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin: 24px 0 22px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 242, 0.98));
    box-shadow: var(--shadow);
}
.bdb-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.3rem);
    line-height: 1.02;
}
.bdb-hero__copy {
    max-width: 760px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.65;
}
.bdb-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}
.bdb-content-shell {
    display: grid;
    gap: 20px;
}
.page-header, .section-title-row, .actions, .inline-meta, .section-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.page-header {
    margin-bottom: 8px;
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .78rem;
    color: #9a5a2d;
    margin: 0 0 10px;
}
.muted {
    color: var(--muted);
}
.badge, .pill {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid rgba(246, 168, 104, 0.55);
    background: rgba(246, 168, 104, 0.16);
    color: #9a5a2d;
    font-weight: 700;
}
.grid {
    display: grid;
    gap: 20px;
}
.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.wizard-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
}
.wizard-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
}
.wizard-rail {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff, #fff7f0);
    padding: 14px;
    position: sticky;
    top: 18px;
}
.wizard-rail h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}
.wizard-rail-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}
.wizard-rail-item {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: #fff;
}
.wizard-rail-item.is-active {
    border-color: rgba(246, 168, 104, 0.65);
    box-shadow: 0 8px 18px rgba(246, 168, 104, 0.2);
}
.wizard-rail-item.is-done {
    border-color: rgba(52, 211, 153, 0.55);
    background: rgba(52, 211, 153, 0.08);
}
.wizard-rail-link {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 10px;
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 10px;
    cursor: pointer;
}
.wizard-rail-index {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #925426;
    background: rgba(246, 168, 104, 0.2);
}
.wizard-rail-copy {
    display: grid;
    gap: 3px;
}
.wizard-rail-copy strong {
    line-height: 1.2;
    color: #1f2937;
}
.wizard-rail-copy small {
    color: #64748b;
}
.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(255, 250, 246, 0.99));
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--shadow);
}
.card h3, .page-header h2 {
    margin-top: 0;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 12px;
    border-bottom: 1px solid rgba(203, 213, 245, 0.14);
    text-align: left;
    vertical-align: top;
}
.table th {
    color: #64748b;
    font-size: .85rem;
}
.table td a {
    color: #9a5a2d;
}
.compact-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 10px;
    color: var(--muted);
}
.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.form-grid label, .question-block {
    display: grid;
    gap: 8px;
}
input[type="text"], input[type="date"], input[type="number"], textarea, select {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    background: #ffffff;
    color: var(--text);
}
input::placeholder, textarea::placeholder { color: rgba(203, 213, 245, 0.58); }
textarea { resize: vertical; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    padding: 12px 18px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    border: 1px solid rgba(246, 168, 104, 0.55);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(246, 168, 104, 0.2);
}
.button.primary {
    background: #f8d3ae;
    color: #925426;
}
.button.secondary {
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
}
.button.small { padding: 8px 12px; font-size: .9rem; }
.button.full { width: 100%; }
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.option-card {
    display: grid;
    gap: 8px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 16px;
    padding: 16px;
    background: #fffdfb;
}
.option-stack, .question-list, .section-editor, .validation-list { display: grid; gap: 14px; }
.section-editor {
    border-top: 1px dashed rgba(15, 23, 42, 0.14);
    padding-top: 16px;
}
.validation-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.validation-list li {
    border-left: 4px solid var(--info);
    padding: 10px 12px;
    background: #f8fbff;
    border-radius: 10px;
    display: grid;
    gap: 6px;
}
.validation-list .severity-warning { border-left-color: var(--warning); background: rgba(245, 158, 11, 0.1); }
.validation-list .severity-critical { border-left-color: var(--critical); background: rgba(248, 113, 113, 0.1); }
.validation-list .severity-info { border-left-color: var(--info); }
.progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
}
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #ffd2ae); }
.wizard-step { display: none; gap: 16px; }
.wizard-step.is-active { display: grid; }
.wizard-step-header { padding-bottom: 8px; border-bottom: 1px solid rgba(246, 168, 104, 0.2); }
.wizard-step-hint {
    margin: 0;
    border-left: 4px solid rgba(96, 165, 250, 0.55);
    background: rgba(96, 165, 250, 0.12);
    padding: 10px 12px;
    border-radius: 10px;
    color: #1e3a8a;
}
.sticky-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.98));
    padding-top: 16px;
}
.error-text { color: #fecaca; }
a { color: #9a5a2d; }
code {
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 2px 6px;
}
@media (max-width: 1024px) {
    .bdb-hero, .wizard-layout, .grid.two, .form-grid { grid-template-columns: 1fr; }
    .wizard-shell { grid-template-columns: 1fr; }
    .wizard-rail { position: static; }
    .bdb-hero {
        flex-direction: column;
        align-items: flex-start;
    }
    .bdb-hero__actions {
        justify-content: flex-start;
    }
}

.bdb-page > * + * { margin-top: 18px; }
.bdb-hero, .card { backdrop-filter: blur(10px); }
.bdb-hero__actions .button { min-width: 180px; }
.card p, .card li, .card td, .card th, .card label { color: var(--text); }
.page-header .muted, .card .muted, .compact-list { color: var(--muted); }


.bdb-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 28px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.bdb-topbar__brand {
    font-family: 'Baloo 2', Inter, Arial, sans-serif;
    font-size: 2rem;
    line-height: 1;
    color: #111827;
}
.bdb-topbar__nav, .bdb-topbar__meta {
    display: flex;
    align-items: center;
    gap: 24px;
}
.bdb-topbar a {
    color: #111827;
    text-decoration: none;
    font-weight: 700;
}
.bdb-topbar__meta a.is-active {
    color: #9a5a2d;
}
.bdb-footer {
    position: relative;
    z-index: 2;
    background: rgba(255, 248, 242, 0.98);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    margin-top: 40px;
}
.bdb-footer__inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 18px 20px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #64748b;
}
.bdb-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}
.bdb-footer__links a {
    text-decoration: none;
    color: #111827;
    font-weight: 700;
}
@media (max-width: 1024px) {
    .bdb-topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 20px;
    }
    .bdb-topbar__nav, .bdb-topbar__meta, .bdb-footer__inner, .bdb-footer__links {
        width: 100%;
        justify-content: flex-start;
    }
}

.bdb-project-switcher {
    display: grid;
    gap: 16px;
}
.bdb-project-switcher__form {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}
.bdb-project-switcher__controls {
    min-width: 280px;
}
.bdb-project-switcher select {
    min-width: 280px;
    background: #fffaf5;
}
@media (max-width: 1024px) {
    .bdb-project-switcher__form {
        flex-direction: column;
        align-items: stretch;
    }
    .bdb-project-switcher__controls,
    .bdb-project-switcher select {
        min-width: 100%;
        width: 100%;
    }
}

.bdb-page > * + * { margin-top: 18px; }
.bdb-hero, .card { backdrop-filter: blur(10px); }
.bdb-hero__actions .button { min-width: 180px; }
.card p, .card li, .card td, .card th, .card label { color: var(--text); }
.page-header .muted, .card .muted, .compact-list { color: var(--muted); }
