/* Big-O Comparison (/big-o-comparison): only what is the app's own. Panels, fields, buttons, tables and colours come
   from the app kit (css/app-kit, docs/app-kit.md). Loaded only on this app's page (StylePaths in its demo catalog entry). */

/* One colour per complexity class, from cool (slow growth) to hot (explosive growth); the chips, the table swatches
   and the chart (app.colors reads --bo-c1 ... --bo-c9) share them. */
.big-o-comparison-landing-app > .filter-landing-stage {
    --bo-c1: #0f766e;
    --bo-c2: #15803d;
    --bo-c3: #65a30d;
    --bo-c4: #2563eb;
    --bo-c5: #7c3aed;
    --bo-c6: #ca8a04;
    --bo-c7: #ea580c;
    --bo-c8: #dc2626;
    --bo-c9: #be185d;
}

.big-o-comparison-landing-app[data-theme="dark"] > .filter-landing-stage {
    --bo-c1: #2dd4bf;
    --bo-c2: #4ade80;
    --bo-c3: #a3e635;
    --bo-c4: #60a5fa;
    --bo-c5: #a78bfa;
    --bo-c6: #facc15;
    --bo-c7: #fb923c;
    --bo-c8: #f87171;
    --bo-c9: #f472b6;
}

/* The chips (the legend too) and the Linear / Logarithmic switch above the chart. */
.big-o-comparison-landing-app .bo-chart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.big-o-comparison-landing-app .bo-chips {
    flex: 1 1 18rem;
    min-width: 0;
}

.big-o-comparison-landing-app .bo-scale {
    flex: none;
}

/* A chip is a checkbox in a pill: filled with its class colour when on, outlined when off. */
.big-o-comparison-landing-app .ak-chip.bo-chip {
    position: relative;
    border-color: var(--bo-chip);
    background: transparent;
    color: var(--ak-text);
    white-space: nowrap;
    user-select: none;
}

.big-o-comparison-landing-app .ak-chip.bo-chip:hover {
    border-color: var(--bo-chip);
    background: color-mix(in srgb, var(--bo-chip) 12%, transparent);
}

.big-o-comparison-landing-app .ak-chip.bo-chip.is-on {
    background: color-mix(in srgb, var(--bo-chip) 18%, var(--ak-panel));
}

.big-o-comparison-landing-app .ak-chip.bo-chip:not(.is-on) {
    color: var(--ak-muted);
    border-style: dashed;
}

.big-o-comparison-landing-app .ak-chip.bo-chip:focus-within {
    outline: 2px solid var(--ak-accent);
    outline-offset: 1px;
}

.big-o-comparison-landing-app .bo-chip-box {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.big-o-comparison-landing-app .bo-chip-dot {
    width: 0.65rem;
    height: 0.65rem;
    border: 2px solid var(--bo-chip);
    border-radius: 50%;
    flex: none;
}

.big-o-comparison-landing-app .bo-chip.is-on .bo-chip-dot {
    background: var(--bo-chip);
}

.big-o-comparison-landing-app .bo-chart {
    height: 300px;
}

/* The table: the class, its name and an example in the first column; counts and times stay on one line. */
.big-o-comparison-landing-app .bo-table th.bo-class {
    font-weight: 400;
    text-align: start;
}

.big-o-comparison-landing-app .bo-class-head {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.45rem;
}

.big-o-comparison-landing-app .bo-label {
    font-weight: 700;
    white-space: nowrap;
}

.big-o-comparison-landing-app .bo-name {
    color: var(--ak-muted);
    font-size: var(--ak-fs-sm);
}

.big-o-comparison-landing-app .bo-example {
    display: block;
    color: var(--ak-muted);
    font-size: var(--ak-fs-xs);
}

.big-o-comparison-landing-app .bo-steps,
.big-o-comparison-landing-app .bo-time {
    white-space: nowrap;
    vertical-align: top;
}

.big-o-comparison-landing-app .bo-universe-note {
    display: block;
    color: var(--ak-danger);
    font-size: var(--ak-fs-xs);
    font-weight: 600;
    white-space: normal;
}

@media (max-width: 560px) {
    .big-o-comparison-landing-app .bo-scale {
        flex: 1 1 100%;
    }

    .big-o-comparison-landing-app .bo-scale > .ak-seg-btn {
        flex: 1 1 0;
    }

    .big-o-comparison-landing-app .bo-steps,
    .big-o-comparison-landing-app .bo-time {
        white-space: normal;
    }
}
