/* Brand guidelines generator. Bouwt voort op tools.css en carrousel.css (toolbar, dialoog,
   projectlijst); alleen de wizard en de documentpreview staan hier. */

.bg-current {
    font-size: 0.9375rem;
    font-weight: 600;
    padding-inline: 0.5rem;
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bg-body {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    min-height: 680px;
}

.bg-side {
    background: #ffffff;
    border-right: 1px solid var(--line);
    padding: 0 0 1.25rem;
    min-width: 0;
}

.bg-steps {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0 0.5rem;
    margin: 0 0 0.5rem;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
}

.bg-steps [role="tab"] {
    font: inherit;
    font-size: 0.875rem;
    min-height: 44px;
    padding: 0.5rem 0.65rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.bg-steps [role="tab"] span {
    display: inline-grid;
    place-items: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    border: 1px solid var(--field-border);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.bg-steps [role="tab"][aria-selected="true"] {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

.bg-steps [role="tab"][aria-selected="true"] span {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.bg-steps [role="tab"].is-done span {
    border-color: var(--ok);
    color: var(--ok);
}

.bg-step {
    padding: 0.75rem 1.25rem 0;
}

.bg-step[hidden] {
    display: none;
}

.bg-step-title {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(1.4rem, 2vw, 1.75rem);
    line-height: 1.2;
    margin-bottom: 0.4rem;
}

.bg-step .field {
    margin-bottom: 0.9rem;
}

.bg-step textarea.input {
    resize: vertical;
}

.bg-values {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 0.4rem;
}

.bg-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.bg-traits .choice {
    border: 1px solid var(--field-border);
    background: var(--field-bg);
    padding: 0.3rem 0.8rem 0.3rem 0.6rem;
    min-height: 40px;
}

.bg-traits .choice:has(input:checked) {
    border-color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--ink);
}

.bg-traits .choice:has(input:disabled) {
    opacity: 0.45;
}

.bg-trait-rank {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 0.8rem;
}

.bg-slider {
    margin-bottom: 1rem;
}

.bg-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--muted);
}

.bg-palettes {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.bg-palette {
    width: 100%;
    font: inherit;
    font-size: 0.8125rem;
    text-align: left;
    padding: 0.5rem;
    border: 1px solid var(--line);
    background: var(--paper);
    cursor: pointer;
    min-height: 44px;
}

.bg-palette:hover,
.bg-palette[aria-pressed="true"] {
    border-color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--ink);
}

.bg-palette-swatches {
    display: flex;
    height: 34px;
    margin-bottom: 0.35rem;
}

.bg-palette-swatches span {
    flex: 1 1 0;
}

.bg-colors {
    display: grid;
    gap: 0.5rem;
}

.bg-color-row {
    display: grid;
    grid-template-columns: 9rem 44px minmax(0, 1fr) 7.5rem;
    gap: 0.5rem;
    align-items: center;
}

.bg-color-row label {
    font-size: 0.875rem;
}

.bg-color-row input[type="color"] {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--field-border);
    background: none;
    cursor: pointer;
}

.bg-color-row .input {
    min-height: 44px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.bg-color-row small {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
}

.bg-contrast {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.35rem;
}

.bg-contrast li {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: center;
    font-size: 0.875rem;
}

.bg-contrast-sample {
    display: grid;
    place-items: center;
    height: 2.4rem;
    font-weight: 700;
    border: 1px solid var(--line);
}

.bg-contrast .is-bad {
    color: var(--error);
    font-weight: 600;
}

.bg-contrast .is-ok {
    color: var(--ok);
    font-weight: 600;
}

.bg-pairs {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.bg-pair {
    width: 100%;
    font: inherit;
    text-align: left;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    background: var(--paper);
    cursor: pointer;
    min-height: 44px;
}

.bg-pair[aria-pressed="true"],
.bg-pair:hover {
    border-color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--ink);
}

.bg-pair-h {
    display: block;
    font-size: 1.4rem;
    line-height: 1.15;
}

.bg-pair-b {
    display: block;
    font-size: 0.875rem;
    margin-top: 0.2rem;
}

.bg-pair-note {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.3rem;
}

.bg-specimen {
    border: 1px solid var(--line);
    padding: 1rem 1.1rem;
    background: var(--paper);
    overflow-wrap: break-word;
}

.bg-specimen p + p {
    margin-top: 0.5rem;
}

.bg-logos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.bg-logo-slot {
    border: 1px solid var(--line);
    padding: 0.6rem;
    background: var(--paper);
}

.bg-logo-slot h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.bg-logo-thumb {
    height: 90px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--field-border);
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    color: var(--muted);
    background: #ffffff center / contain no-repeat;
}

.bg-logo-thumb.is-dark {
    background-color: #1c1b17;
    color: #b8b2a4;
}

.bg-logo-thumb.has-logo {
    border-style: solid;
    color: transparent;
}

.bg-voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0 1rem;
}

.bg-chapters {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
}

.bg-chapter {
    border: 1px solid var(--line);
    background: var(--paper);
}

.bg-chapter-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem;
}

.bg-chapter-head .check {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    font-size: 0.9375rem;
}

.bg-chapter-body {
    padding: 0.4rem 0.75rem 0.75rem;
    border-top: 1px solid var(--line);
    background: #ffffff;
}

.bg-chapter-body[hidden] {
    display: none;
}

.bg-chapter-body .field {
    margin-bottom: 0.75rem;
}

.bg-field-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.bg-tag {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--tint);
    border: 1px solid var(--line);
    padding: 0.05rem 0.4rem;
    margin-left: 0.35rem;
    vertical-align: 0.1em;
}

.bg-reset {
    font: inherit;
    font-size: 0.8125rem;
    background: none;
    border: 0;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    min-height: 32px;
    padding: 0;
}

.bg-nav {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1.25rem 1.25rem 0;
    margin-top: 1rem;
    border-top: 1px solid var(--line);
}

.bg-preview {
    background: var(--cm-stage-bg);
    min-width: 0;
    position: relative;
}

/* Op de grijze achtergrond van het voorbeeld is --muted te licht (4,3:1). */
.bg-preview-head .cm-panel-title,
.bg-preview-head .hint {
    color: #5a564d;
}

.bg-preview-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.4rem 1rem 0 0.1rem;
    position: sticky;
    top: 0;
    background: var(--cm-stage-bg);
    z-index: 2;
}

.bg-pages {
    list-style: none;
    padding: 0.5rem 1.25rem 1.5rem;
    margin: 0;
    display: grid;
    gap: 1rem;
    max-height: calc(100vh - 80px);
    overflow: auto;
    position: sticky;
    top: 2.2rem;
}

.bg-pages li {
    line-height: 0;
}

.bg-pages canvas {
    width: 100%;
    height: auto;
    display: block;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(28, 27, 23, 0.12), 0 6px 20px rgba(28, 27, 23, 0.1);
}

@media (max-width: 960px) {
    .bg-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .bg-side {
        border-right: 0;
    }

    .bg-pages {
        max-height: none;
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bg-preview-head {
        position: static;
        padding-left: 1rem;
    }
}

@media (max-width: 560px) {
    .bg-color-row {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .bg-color-row label {
        grid-column: 1 / -1;
    }

    .bg-color-row small {
        grid-column: 1 / -1;
    }

    .bg-palettes,
    .bg-pairs,
    .bg-logos {
        grid-template-columns: minmax(0, 1fr);
    }

    .bg-step {
        padding-inline: 1rem;
    }

    .bg-steps [role="tab"] {
        padding-inline: 0.45rem;
    }
}
