/* Badge kit pages (spec 186): /badges and /badges/{program}/{kit}. */

.bkp {
    max-width: min(1440px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 1.4rem 0 4rem;
}
.bkp a, .bkp a:hover, .bkp a:focus, .bkp a:visited { text-decoration: none; }
.bkp-draft {
    margin: 0 0 1rem; padding: .6rem .9rem; border-radius: 10px;
    background: #fef3c7; color: #92400e; font-weight: 600;
}
.bkp-printonly { display: none; }

/* ---- hero ---------------------------------------------------------- */

.bkp-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: center;
    padding: clamp(1.4rem, 3.5vw, 3rem);
    border: 1px solid var(--border);
    border-radius: 22px;
    background:
        radial-gradient(120% 140% at 0% 0%, var(--accent-light), transparent 55%),
        var(--bg-secondary);
    margin-bottom: 2.4rem;
}
.bkp-eyebrow { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.bkp-eyebrow span {
    font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    padding: .25rem .65rem; border-radius: 999px;
    border: 1px solid var(--border); color: var(--text-secondary); background: var(--bg-primary);
}
.bkp-eyebrow span:first-child { color: #16a34a; border-color: rgba(22, 163, 74, .35); background: rgba(52, 211, 153, .12); }
.bkp-badge { margin: 0 0 .35rem; font-weight: 600; color: var(--accent); font-size: 1rem; }
.bkp-hero h1 { font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1.1; margin: 0 0 .9rem; letter-spacing: -.01em; }
.bkp-summary { font-size: 1.1rem; line-height: 1.65; color: var(--text-secondary); max-width: 60ch; margin: 0 0 1.6rem; }

.bkp-facts {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem;
    margin: 0 0 1.8rem;
}
.bkp-facts div { padding: .8rem .95rem; border-radius: 12px; background: var(--bg-primary); border: 1px solid var(--border); }
.bkp-facts dt { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .3rem; }
.bkp-facts dd { margin: 0; font-size: .9rem; line-height: 1.45; color: var(--text-primary); }

.bkp-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.bkp-go { padding-left: 1.4rem; padding-right: 1.4rem; }

.bkp-readaloud { margin: 0 0 1.2rem; padding: .7rem .9rem; border-radius: 10px; border-left: 4px solid var(--accent); background: var(--accent-light); color: var(--text-primary); }
.bkp-hero-art { margin: 0; }
/* a short picture (codes, passwords) sits at the top of the hero, not floating in the middle of it */
.bkp-hero-art:has(.bkp-pw), .bkp-hero-art:has(.bkp-shift), .bkp-hero-cover { align-self: start; margin-top: 1.2rem; }
.bkp-maze {
    display: grid;
    gap: 2px;
    padding: 10px;
    border-radius: 16px;
    background: #dfeedd;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18), inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.bkp-maze i { aspect-ratio: 1; border-radius: 3px; }
.bkp-maze i.w { background: #7c8597; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
i.m-start { background: var(--accent); border-radius: 50%; }
i.m-goal { background: #16a34a; border-radius: 3px; box-shadow: 0 0 0 3px rgba(22, 163, 74, .25); }
i.m-collectible { background: #f59e0b; border-radius: 50%; transform: scale(.7); }
i.m-enemy, i.m-hazard { background: #ef4444; border-radius: 50%; transform: scale(.75); }
.bkp-hero-art figcaption {
    display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; align-items: center;
    margin-top: .9rem; font-size: .84rem; color: var(--text-secondary);
}
.bkp-hero-art figcaption span { display: inline-flex; align-items: center; gap: .4rem; }
.bkp-hero-art figcaption i { display: inline-block; width: 12px; height: 12px; }
.bkp-cap-note { flex-basis: 100%; color: var(--text-muted); }

.bkp-shift {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px .6rem; align-items: center;
    padding: 14px; border-radius: 16px; background: #f4efe2;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18), inset 0 0 0 1px rgba(0, 0, 0, .06);
    color: #1f2a44;
}
.bkp-shift-k { font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6b6450; }
.bkp-shift-row { display: grid; grid-template-columns: repeat(26, minmax(0, 1fr)); gap: 2px; }
.bkp-shift-row i {
    font-style: normal; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700;
    font-size: clamp(.55rem, 1.2vw, .85rem); text-align: center; padding: .3rem 0;
    background: #fff; border-radius: 3px;
}
.bkp-shift-code i { background: #1f2a44; color: #f5c451; }
.bkp-card .bkp-shift { border-radius: 0; box-shadow: none; padding: 22px 12px; }
.bkp-pw {
    list-style: none; margin: 0; display: grid; gap: 8px;
    padding: 16px; border-radius: 16px; background: #f4efe2; color: #1f2a44;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18), inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.bkp-pw li {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    padding: .5rem .7rem; border-radius: 8px; background: #fff;
}
.bkp-pw code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: clamp(.75rem, 1.3vw, .95rem); overflow-wrap: anywhere; }
.bkp-pw span { flex-shrink: 0; font-size: .74rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; }
.bkp-pw .bad span { background: #fde2e1; color: #9b1c1c; }
.bkp-pw .ok span { background: #dcf3e3; color: #14622f; }
.bkp-pw .ok code::before { content: "\2713  "; color: #14622f; }
.bkp-bin code { letter-spacing: .12em; }
.bkp-list code { font-family: inherit; }
/* a long label and a long tag share the row on a phone: let the row wrap rather than break a word letter by letter */
.bkp-list li { flex-wrap: wrap; }
.bkp-list code { overflow-wrap: normal; min-width: 0; flex: 1 1 10rem; }
.bkp-bin span { background: #1f2a44; color: #f5c451; font-size: .9rem; min-width: 2.2rem; text-align: center; }
.bkp-card .bkp-pw { border-radius: 0; box-shadow: none; padding: 18px 14px; }
/* the hero has room: bigger rows, so the picture is not a small strip floating in the column */
.bkp-hero-art .bkp-pw { gap: 12px; padding: 22px; }
.bkp-hero-art .bkp-pw li { padding: .95rem 1.1rem; }
.bkp-hero-art .bkp-pw code { font-size: clamp(.95rem, 1.6vw, 1.25rem); }
.bkp-hero-art .bkp-pw span { font-size: .85rem; }

/* ---- body: progress rail + steps ----------------------------------- */

.bkp-body {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: clamp(1.5rem, 3vw, 3rem);
    align-items: start;
}
.bkp-side { position: sticky; top: calc(var(--tl-nav-h, 64px) + 16px); }
.bkp-side-card { border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem; background: var(--bg-secondary); }
.bkp-side-title { margin: 0 0 .7rem; font-weight: 700; }
.bkp-meter { height: 8px; border-radius: 999px; background: var(--bg-tertiary); overflow: hidden; }
.bkp-meter span { display: block; height: 100%; width: 0; background: var(--success); transition: width .4s ease; }
.bkp-meter-text { margin: .5rem 0 1rem; font-size: .85rem; color: var(--text-secondary); }
.bkp-steplist { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.bkp-steplist a {
    display: flex; gap: .65rem; align-items: flex-start; padding: .5rem .55rem; border-radius: 10px;
    color: var(--text-secondary); font-size: .86rem; line-height: 1.4;
}
.bkp-steplist a:hover { background: var(--bg-hover); color: var(--text-primary); }
.bkp-dot {
    flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700;
    border: 1.5px solid var(--border); color: var(--text-muted); background: var(--bg-primary);
}
.bkp-steplist li.on .bkp-dot { background: var(--success); border-color: var(--success); color: #fff; font-size: 0; }
.bkp-steplist li.on .bkp-dot::before { content: "\2713"; font-size: .8rem; }
.bkp-steplist li.on a { color: var(--text-primary); }
.bkp-side-note { margin: 1rem 0 0; font-size: .78rem; color: var(--text-muted); }

.bkp-steps { display: grid; gap: 1.4rem; min-width: 0; }

.bkp-step {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--bg-secondary);
    overflow: clip;   /* not hidden: hidden would stop the plan grid's colors from sticking */
    scroll-margin-top: calc(var(--tl-nav-h, 64px) + 16px);
    transition: border-color .2s;
}
.bkp-step.on { border-color: color-mix(in srgb, var(--success) 55%, var(--border)); }
.bkp-step-head {
    display: flex; gap: 1rem; align-items: center;
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, var(--bg-tertiary), transparent 80%);
}
.bkp-num {
    flex-shrink: 0; width: 46px; height: 46px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.25rem; font-weight: 800; color: #fff; background: var(--accent);
}
.bkp-step.on .bkp-num { background: var(--success); }
.bkp-kind {
    margin: 0 0 .15rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--text-muted);
}
.bkp-step-titles { flex: 1; min-width: 0; }
.bkp-done-tag {
    display: none; flex-shrink: 0; align-self: center;
    padding: .3rem .8rem; border-radius: 999px; font-size: .8rem; font-weight: 700;
    color: #fff; background: var(--success);
}
.bkp-step.on .bkp-done-tag { display: inline-block; }
.bkp-done-tag::before { content: "\2713  "; }
.bkp-step h2 { margin: 0; font-size: 1.25rem; line-height: 1.3; }
/* a phone has no room for the tag beside the title, so "Done" joins the small line above it */
@media (max-width: 560px) {
    .bkp-step-head { gap: .75rem; }
    .bkp-num { width: 38px; height: 38px; font-size: 1.1rem; }
    .bkp-step.on .bkp-done-tag { display: none; }
    .bkp-step.on .bkp-kind::after { content: "  \00b7  \2713  Done"; color: var(--success); }
}

.bkp-step-body { padding: 1.4rem 1.6rem 1.6rem; }
.bkp-intro { font-size: 1.04rem; line-height: 1.7; margin: 0 0 1rem; max-width: 72ch; }
.bkp-read { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin: 0 0 1.4rem; }
.bkp-read p {
    margin: 0; padding: .9rem 1rem; border-radius: 12px; line-height: 1.6; font-size: .94rem;
    background: var(--bg-primary); border: 1px solid var(--border); color: var(--text-secondary);
}
.bkp-label { margin: 0 0 .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }

.bkp-todo { margin: 0 0 1.2rem; padding: 0; list-style: none; counter-reset: todo; display: grid; gap: .5rem; max-width: 72ch; }
.bkp-todo li { counter-increment: todo; display: flex; gap: .7rem; line-height: 1.55; }
.bkp-todo li::before {
    content: counter(todo); flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .74rem; font-weight: 700; background: var(--bg-tertiary); color: var(--text-secondary);
}

/* an app step: what to do beside what the app checks */
.bkp-app { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.4rem; margin-bottom: 1.2rem; }
.bkp-app .bkp-todo { margin: 0; }
.bkp-app-checks {
    padding: 1.1rem 1.2rem; border-radius: 14px;
    background: var(--accent-light); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    display: flex; flex-direction: column; gap: .3rem;
}
.bkp-app-checks .btn { margin-top: .9rem; align-self: flex-start; }
.bkp-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.bkp-checklist li { display: flex; gap: .6rem; align-items: center; font-size: .92rem; }
.bkp-tick {
    flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
    border: 1.5px solid var(--text-muted); display: inline-flex; align-items: center; justify-content: center;
}
.bkp-checklist li.on .bkp-tick { background: var(--success); border-color: var(--success); }
.bkp-checklist li.on .bkp-tick::before { content: "\2713"; color: #fff; font-size: .72rem; font-weight: 700; }

/* quiz */
.bkp-quiz { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.bkp-q { margin: 0; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-primary); min-width: 0; }
.bkp-q legend { display: flex; gap: .55rem; font-weight: 600; line-height: 1.45; padding: 0; margin-bottom: .7rem; float: left; width: 100%; }
.bkp-q legend span {
    flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .76rem; background: var(--bg-tertiary); color: var(--text-secondary);
}
.bkp-opts { clear: both; display: grid; gap: .4rem; }
.bkp-opt {
    display: flex; gap: .6rem; align-items: center; cursor: pointer;
    padding: .55rem .75rem; border-radius: 10px; border: 1px solid var(--border);
    font-size: .93rem; transition: border-color .15s, background .15s;
}
.bkp-opt:hover { border-color: var(--accent); }
.bkp-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }
.bkp-opt input { accent-color: var(--accent); margin: 0; }
.bkp-q.right { border-color: var(--success); }
.bkp-q.wrong { border-color: var(--error); }
/* after Check, the picked option takes the verdict's color, so a wrong pick never looks right */
.bkp-q.wrong .bkp-opt:has(input:checked) { border-color: var(--error); background: rgba(239, 68, 68, .12); }
.bkp-q.right .bkp-opt:has(input:checked) { border-color: var(--success); background: rgba(22, 163, 74, .12); }
.bkp-why { margin: .6rem 0 0; font-size: .86rem; color: var(--text-secondary); }
.bkp-q.right .bkp-why { color: var(--success); }
.bkp-quiz-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.bkp-quiz-result { color: var(--text-secondary); }

/* paper parts */
.bkp-plan { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.6rem; align-items: start; margin-bottom: 1rem; }
.bkp-grid { display: grid; border: 1.5px solid var(--text-muted); border-radius: 4px; background: var(--bg-primary); }
/* the paper grid: .bkp-grid comes after .bkp-printonly, so it has to be hidden by name */
.bkp-grid.bkp-printonly { display: none; }
.bkp-grid i { aspect-ratio: 1; border: .5px solid var(--border); }
.bkp-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .2rem 1.6rem; margin: 0 0 1rem; }
.bkp-plan .bkp-fields { grid-template-columns: 1fr; }
.bkp-field { display: flex; flex-direction: column; gap: .3rem; margin: .6rem 0; font-size: .92rem; color: var(--text-secondary); }
.bkp-line { border-bottom: 1.5px dashed var(--border); height: 1.8rem; }

.bkp-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: .4rem; }
.bkp-note { padding: .9rem 1.1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-primary); }
.bkp-note ul { margin: 0; padding-left: 1.1rem; line-height: 1.6; color: var(--text-secondary); font-size: .93rem; }
.bkp-note p:last-child { margin: 0; line-height: 1.6; font-size: .93rem; color: var(--text-secondary); }
.bkp-note-show { border-color: rgba(22, 163, 74, .35); background: rgba(52, 211, 153, .08); }

.bkp-self {
    display: inline-flex; align-items: center; gap: .7rem; margin-top: 1.2rem; cursor: pointer;
    padding: .65rem 1rem; border-radius: 12px; border: 1.5px solid var(--border); font-weight: 600;
}
.bkp-self:hover { border-color: var(--accent); }
.bkp-self:has(input:checked) { border-color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.bkp-self input { width: 18px; height: 18px; accent-color: var(--success); margin: 0; }

/* certificate */
.bkp-cert {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: center;
    padding: 1.6rem; border-radius: 18px; border: 1.5px dashed var(--border); background: var(--bg-secondary);
    scroll-margin-top: calc(var(--tl-nav-h, 64px) + 16px);
}
.bkp-cert.ready { border-style: solid; border-color: var(--success); }
.bkp-cert h2 { margin: 0 0 .5rem; font-size: 1.35rem; }
.bkp-cert label:not(.bkp-opt) { display: block; font-weight: 600; margin: .6rem 0 .4rem; }
.bkp-cert-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.bkp-cert input[type=text] {
    flex: 1 1 14rem; padding: .6rem .8rem; border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg-primary); color: var(--text-primary); font-size: 1rem;
}
.bkp-fine { font-size: .84rem; color: var(--text-muted); line-height: 1.55; }
.bkp-cert-mock {
    position: relative; display: flex; flex-direction: column; align-items: center; container-type: inline-size;
    aspect-ratio: 11 / 8.5; padding: 5% 9% 4%;
    background: #fffdf6; color: #1a202c; text-align: center;
    border: 9px solid #1a365d; outline: 1.5px solid #b7912f; outline-offset: -16px;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
    font-family: Georgia, 'Times New Roman', serif;
    opacity: .7; transition: opacity .3s, transform .2s;
}
.bkp-cert-mock:hover { transform: translateY(-2px); opacity: 1; }
.bkp-cert.ready .bkp-cert-mock { opacity: 1; }
.bkp-cert-mock p { margin: 0; }
.bkp-mock-logo { width: 30cqw; height: auto; margin-bottom: 2cqw; }
.bkp-mock-top { font-size: 3.1cqw; letter-spacing: .22em; text-transform: uppercase; color: #1a365d; font-weight: 700; }
.bkp-mock-kicker { font-size: 1.6cqw; letter-spacing: .3em; text-transform: uppercase; color: #b7912f; font-weight: 700; margin-top: .25rem !important; }
.bkp-mock-name { margin: 2cqw auto 0 !important; width: 70%; font-size: 5.2cqw; font-style: italic; font-weight: 700; color: #1a365d; border-bottom: 1.5px solid #b7912f; padding-bottom: .15rem; overflow-wrap: anywhere; }
.bkp-mock-line { margin-top: 1.2cqw !important; font-size: 1.8cqw; color: #4a5568; }
.bkp-mock-title { font-size: 3.4cqw; font-weight: 700; margin-top: .15rem !important; }
.bkp-mock-sub { display: inline-block; margin-top: 1cqw !important; font-size: 1.7cqw; color: #1a365d; padding: .15rem .6rem; border-top: 1px solid #b7912f; border-bottom: 1px solid #b7912f; }
.bkp-mock-seal {
    margin-top: auto; flex: none;
    width: 13cqw; aspect-ratio: 1; border-radius: 50%; background: #1a365d;
    box-shadow: inset 0 0 0 3px #1a365d, inset 0 0 0 4.5px #b7912f;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #e9d8a6; font-size: 2.2cqw; line-height: 1.1;
}
.bkp-mock-seal b { font-size: 1.1cqw; letter-spacing: .12em; }
.bkp-sample { font-weight: 600; color: var(--accent); }

/* fill-in answers and the plan grid */
.bkp-input {
    width: 100%; padding: .55rem .75rem; border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg-primary); color: var(--text-primary); font-size: .95rem;
}
.bkp-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.bkp-sketch { margin: .4rem 0 1.4rem; }
/* the colors ride along while a tall grid scrolls under them */
.bkp-sketch-tools {
    display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: .8rem;
    position: sticky; top: var(--tl-nav-h, 64px); z-index: 2; padding: .5rem 0; background: var(--bg-secondary);
}
.bkp-palette { display: flex; flex-wrap: wrap; gap: .4rem; }
.bkp-pal, .bkp-clear {
    display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .75rem; border-radius: 999px;
    border: 1.5px solid var(--border); background: var(--bg-primary); color: var(--text-primary);
    font-size: .86rem; cursor: pointer;
}
.bkp-pal i { width: 14px; height: 14px; border-radius: 4px; }
.bkp-pal[data-k="."]::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 1.5px dashed var(--text-muted); }
.bkp-pal:hover, .bkp-clear:hover { border-color: var(--accent); }
.bkp-pal.on { border-color: var(--accent); background: var(--accent-light); font-weight: 600; }
.bkp-clear { color: var(--text-secondary); }
.bkp-sketch-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.4rem; align-items: start; }
.bkp-sketch-grid {
    display: grid; gap: 1px; padding: 6px; border-radius: 12px; background: #c9d6c6;
    touch-action: none; user-select: none; cursor: crosshair; max-width: 760px;
}
.bkp-sketch-grid i { aspect-ratio: 1; background: #eef5ec; border-radius: 2px; }
.bkp-sketch-grid i:hover { outline: 2px solid var(--accent); outline-offset: -1px; }
.bkp-sketch-grid i.kw { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2); }
.bkp-sketch-side { padding: 1rem 1.1rem; border-radius: 14px; background: var(--bg-primary); border: 1px solid var(--border); }
.bkp-sketch-side .btn { margin-top: 1rem; width: 100%; white-space: normal; line-height: 1.3; height: auto; }
.bkp-sketch-side .btn:disabled { opacity: .45; cursor: not-allowed; }
.bkp-rows-label { margin-top: 1rem; }
.bkp-rows-code {
    margin: .3rem 0 0; padding: .6rem .7rem; border-radius: 8px; background: var(--bg-secondary);
    font: 13px/1.45 var(--font-mono, ui-monospace, Menlo, Consolas, monospace); letter-spacing: .08em;
    white-space: pre; overflow-x: auto;
}
.bkp-sketch-side .bkp-copy-rows { margin-top: .5rem; }
.bkp-stuck { margin: 1rem 0 0; padding: .7rem 1rem; border-radius: 12px; border: 1px dashed var(--border); }
.bkp-stuck summary { cursor: pointer; font-weight: 600; color: var(--text-secondary); }
.bkp-stuck[open] summary { margin-bottom: .5rem; }
.bkp-stuck-code {
    margin: .5rem 0; padding: .7rem .8rem; border-radius: 8px; background: var(--bg-secondary);
    font: 13px/1.5 var(--font-mono, ui-monospace, Menlo, Consolas, monospace); white-space: pre; overflow-x: auto; max-height: 420px;
}
.bkp-to-note { margin: .5rem 0 0; }

/* a certificate's own page and /verify */
.bkp-narrow { max-width: min(880px, calc(100vw - 32px)); }
.bkp-verdict { padding: 1.6rem 1.8rem; border-radius: 18px; border: 1px solid var(--border); background: var(--bg-secondary); margin: 0 0 1.4rem; }
.bkp-verdict h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: .2rem 0 .6rem; }
.bkp-verdict p { line-height: 1.65; }
.bkp-verdict.ok { border-color: color-mix(in srgb, var(--success) 60%, var(--border)); }
.bkp-verdict.bad { border-color: color-mix(in srgb, var(--error) 60%, var(--border)); }
.bkp-recgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.bkp-recgrid a { color: var(--accent); overflow-wrap: anywhere; }
.bkp-verify-form label { display: block; font-weight: 600; margin-bottom: .4rem; }
.bkp-verify-form .bkp-input { flex: 1 1 14rem; width: auto; text-transform: uppercase; }
.bkp-link-btn { background: none; border: 0; padding: 0; color: var(--text-muted); text-decoration: underline; cursor: pointer; font-size: .86rem; }
.bkp-link-btn:hover { color: var(--error); }
.bkp-cancel { padding: .6rem .9rem; border-radius: 10px; background: var(--accent-light); }
#bkp-cert-form .bkp-input { margin-bottom: .8rem; }
.bkp-cert-go { margin-top: .2rem; }

.bkp-index-links { margin-top: 1.2rem !important; font-size: .9rem !important; }
.bkp-index-links a { color: var(--accent); }
.bkp-payhow { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 .9rem; }
.bkp-payhow .bkp-opt { flex: 1 1 12rem; }
.bkp-pack { margin-top: 1.4rem; padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-primary); }
.bkp-pack summary { cursor: pointer; font-weight: 600; }
.bkp-pack p { color: var(--text-secondary); line-height: 1.6; font-size: .92rem; }
.bkp-pack label:not(.bkp-opt) { display: block; font-weight: 600; margin: .6rem 0 .4rem; }
.bkp-pack .bkp-input { margin-bottom: .8rem; }
.bkp-code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; color: var(--accent); white-space: nowrap; }
.bkp-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.bkp-table th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding: .4rem .5rem; border-bottom: 1px solid var(--border); }
.bkp-table td { padding: .55rem .5rem; border-bottom: 1px solid var(--border); }
.bkp-table a { color: var(--accent); }
textarea.bkp-input { font-family: inherit; resize: vertical; }

/* the app over the kit page */
.bkp-overlay { position: fixed; inset: 0; z-index: 5000; background: var(--bg-primary); }
.bkp-overlay iframe { width: 100%; height: 100%; border: 0; display: block; }
html.bkp-locked, html.bkp-locked body { overflow: hidden; }

/* ---- /badges index ------------------------------------------------- */

.bkp-index-hero { padding: clamp(1.4rem, 3.5vw, 3rem); border: 1px solid var(--border); border-radius: 22px;
    background: radial-gradient(120% 140% at 0% 0%, var(--accent-light), transparent 55%), var(--bg-secondary); margin-bottom: 2.2rem; }
.bkp-index-hero h1 { font-size: clamp(2rem, 3.6vw, 3rem); margin: 0 0 .8rem; }
.bkp-index-hero p { font-size: 1.1rem; line-height: 1.65; color: var(--text-secondary); max-width: 68ch; margin: 0; }
.bkp-how { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-top: 1.6rem; }
.bkp-how div { padding: .9rem 1rem; border-radius: 12px; background: var(--bg-primary); border: 1px solid var(--border); font-size: .9rem; line-height: 1.5; color: var(--text-secondary); }
.bkp-how strong { display: block; color: var(--text-primary); margin-bottom: .2rem; }
.bkp-group { margin: 0 0 2.2rem; }
.bkp-group h2 { font-size: 1.2rem; margin: 0 0 .9rem; display: flex; align-items: baseline; gap: .6rem; }
.bkp-group h2 small { font-size: .85rem; font-weight: 500; color: var(--text-muted); }
.bkp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.1rem; }
.bkp-card {
    display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 18px;
    background: var(--bg-secondary); color: var(--text-primary); overflow: hidden; transition: border-color .15s, transform .15s;
}
.bkp-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.bkp-card .bkp-maze { border-radius: 0; box-shadow: none; padding: 14px; gap: 1px; }
.bkp-card-body { padding: 1rem 1.2rem 1.2rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.bkp-card-badge { font-size: .76rem; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.bkp-card h3 { margin: 0; font-size: 1.15rem; }
.bkp-card p { margin: 0; color: var(--text-secondary); font-size: .9rem; line-height: 1.55; }
.bkp-card-meta { margin-top: auto !important; padding-top: .6rem; font-size: .8rem !important; color: var(--text-muted) !important; }

/* ---- narrower screens ---------------------------------------------- */

@media (max-width: 1100px) {
    .bkp-body { grid-template-columns: 1fr; }
    .bkp-side { position: static; }
    .bkp-steplist { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .bkp-how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .bkp-sketch-wrap { grid-template-columns: 1fr; }
    /* on a phone the colors wrapped into a panel taller than half the screen and covered
       the grid; one row that swipes sideways keeps the pinned bar short */
    /* contain: its width must not count, or the row's full length widens the whole step.
       Start over gets its own line: beside the row, a swipe that began on it did nothing */
    .bkp-palette { flex-wrap: nowrap; overflow-x: auto; flex: 1 1 100%; min-width: 0; contain: inline-size; padding-bottom: .2rem; }
    /* a short palette (Daisy kits) wraps instead: a 5 year old will not know to swipe for the rest */
    .bkp-palette.bkp-palette-few { flex-wrap: wrap; overflow-x: visible; }
    .bkp-sketch-tools { gap: .4rem; }
    .bkp-pal, .bkp-clear { flex: none; }
    .bkp-hero, .bkp-app, .bkp-plan, .bkp-cert, .bkp-quiz, .bkp-read { grid-template-columns: 1fr; }
    .bkp-facts { grid-template-columns: 1fr; }
    .bkp-step-head, .bkp-step-body { padding-left: 1.1rem; padding-right: 1.1rem; }
}
@media (max-width: 560px) {
    .bkp-how { grid-template-columns: 1fr; }
}

/* ---- print: the lesson on paper ------------------------------------ */

@media print {
    .tl-nav, .bkp-noprint, nav.tl-crumbs { display: none !important; }
    .bkp-printonly { display: block; font-size: 10pt; }
    .bkp-grid.bkp-printonly { display: grid; }
    body { background: #fff; color: #000; }
    .bkp { max-width: none; padding: 0; }
    .bkp-hero { display: block; padding: 0; border: 0; background: none; margin-bottom: 1rem; }
    .bkp-body { display: block; }
    .bkp-step { break-inside: avoid; border: 1px solid #999; border-radius: 8px; margin-bottom: 12pt; background: none; }
    .bkp-k-plan { break-before: page; }
    .bkp-step-head { background: none; }
    .bkp-num { background: none !important; color: #000; border: 2px solid #000; }
    .bkp-read, .bkp-quiz, .bkp-app, .bkp-plan { grid-template-columns: 1fr 1fr; }
    .bkp-plan { grid-template-columns: 1fr; }
    .bkp-todo li::before { content: ""; border: 1.5px solid #000; background: none; }
    .bkp-opt { border: 0; padding: .15rem 0; }
    .bkp-opt input { appearance: none; width: 12px; height: 12px; border: 1.5px solid #000; border-radius: 50%; }
    .bkp-app-checks, .bkp-read p, .bkp-q, .bkp-note { background: none; }
    .bkp-tick { border-color: #000; }
}

/* ---- message cards and the decoder (cipher kit) --------------------- */
.bkp-msg {
    clear: both; margin: 0 0 .8rem; padding: .8rem .95rem; border-radius: 12px;
    background: var(--bg-secondary); border: 1px solid var(--border); border-left: 4px solid var(--accent);
    font-size: .92rem; line-height: 1.5;
}
.bkp-msg p { margin: 0 0 .35rem; }
.bkp-msg p:last-child { margin-bottom: 0; }
.bkp-msg-head { color: var(--text-secondary); font-size: .82rem; word-break: break-word; }
.bkp-msg-head b { color: var(--text-primary); }
/* the sender is the first clue a detective checks, so it reads at full strength */
.bkp-msg-from { color: var(--text-primary); font-size: .95rem; font-weight: 600; font-family: ui-monospace, Menlo, Consolas, monospace; }
.bkp-msg-subj { font-weight: 700; }
.bkp-decoder { margin: 1.2rem 0; padding: 1rem 1.1rem; border: 1px dashed var(--border); border-radius: 14px; }
.bkp-decoder .bkp-shift { box-shadow: none; margin: .6rem 0 .9rem; }
.bkp-decoder-tools { display: grid; grid-template-columns: minmax(0, 1fr) 6rem; gap: .6rem .9rem; align-items: start; }
.bkp-decoder-tools label:not(.bkp-opt) { display: grid; gap: .3rem; font-size: .85rem; font-weight: 600; }
.bkp-decoder-tools .bkp-payhow, .bkp-dc-out { grid-column: 1 / -1; }
.bkp-dc-out {
    min-height: 2.4rem; margin: 0; padding: .6rem .8rem; border-radius: 10px; background: var(--bg-secondary);
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1rem; letter-spacing: .04em; word-break: break-word;
}
@media print {
    .bkp-shift { box-shadow: none; background: #fff; border: 1px solid #999; }
    .bkp-shift-code i { background: #eee; color: #000; }
    .bkp-pw { box-shadow: none; background: #fff; border: 1px solid #999; }
    .bkp-msg { background: #fff; }
}

/* ---- how the app works (first app step) ----------------------------- */
.bkp-basics { margin: 0 0 1.1rem; padding: .9rem 1.1rem; border-radius: 14px; background: var(--bg-primary); border: 1px solid var(--border); border-left: 4px solid var(--accent); }
.bkp-basics ul { margin: 0; padding-left: 1.2rem; line-height: 1.6; }
.bkp-basics li + li { margin-top: .25rem; }
@media print { .bkp-basics { background: none; border: 1px solid #999; } }

/* ---- the app guide: screenshots with numbered pins ------------------- */
.bkp-guide { margin: 0 0 1.4rem; }
.bkp-guide-fig {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem); gap: 1rem 1.4rem; align-items: start;
    margin: 0 0 1.2rem; padding: 1rem; border-radius: 14px; background: var(--bg-primary); border: 1px solid var(--border);
}
.bkp-guide-main { grid-template-columns: 1fr; }
.bkp-guide-main .bkp-pinlist { columns: 2 20rem; column-gap: 1.8rem; }
.bkp-shot { position: relative; line-height: 0; }
.bkp-shot img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.bkp-box { position: absolute; border: 2px solid #f5c451; border-radius: 6px; box-shadow: 0 0 0 1.5px rgba(31, 42, 68, .85); pointer-events: none; }
.bkp-pin {
    position: absolute; transform: translate(-50%, -50%);
    width: 1.4rem; height: 1.4rem; border-radius: 50%; z-index: 1;
    display: grid; place-items: center;
    background: #f5c451; color: #1f2a44; font: 800 .82rem/1 system-ui, sans-serif;
    box-shadow: 0 0 0 2px #1f2a44, 0 2px 8px rgba(0, 0, 0, .45);
}
/* beside the box: right, left, above, below, the top-right corner, or the middle */
.bkp-at-r { transform: translate(25%, -50%); }
.bkp-at-ir { transform: translate(-125%, -50%); }
.bkp-at-l { transform: translate(-125%, -50%); }
.bkp-at-t { transform: translate(-50%, -125%); }
.bkp-at-b { transform: translate(-50%, 25%); }
.bkp-at-tr { transform: translate(-20%, -80%); }
.bkp-pinlist { margin: 0; padding: 0; list-style: none; }
.bkp-pinlist li { position: relative; padding-left: 2.1rem; margin-bottom: .55rem; line-height: 1.5; break-inside: avoid; }
.bkp-pinlist li::before {
    content: attr(value); position: absolute; left: 0; top: .05rem;
    width: 1.45rem; height: 1.45rem; border-radius: 50%; display: grid; place-items: center;
    background: #f5c451; color: #1f2a44; font: 800 .75rem/1 system-ui, sans-serif; box-shadow: 0 0 0 1.5px #1f2a44;
}
@media (max-width: 760px) {
    .bkp-guide-fig { grid-template-columns: 1fr; padding: .7rem; }
    .bkp-pin { width: 1.1rem; height: 1.1rem; font-size: .62rem; }
    .bkp-box { border-width: 1.5px; }
}
@media print {
    .bkp-guide-fig { break-inside: avoid; background: none; border: 1px solid #999; }
    .bkp-shot img { box-shadow: none; }
    .bkp-pin, .bkp-pinlist li::before { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* ---- locked: what is inside, and the way in (section 20) ------------- */
.bkp-locked { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 25rem); gap: 1.6rem; align-items: start; margin-top: 1.6rem; }
.bkp-inside h2, .bkp-unlock h2 { margin: 0 0 .9rem; font-size: 1.3rem; }
.bkp-inside-steps { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: .55rem; }
.bkp-inside-steps li { display: flex; gap: .8rem; align-items: center; padding: .7rem .9rem; border-radius: 12px; background: var(--bg-secondary); border: 1px solid var(--border); }
.bkp-inside-steps b { display: block; }
.bkp-inside-steps small { color: var(--text-muted); font-size: .8rem; }
.bkp-inside-shot { margin: 0; }
.bkp-inside-shot img { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.bkp-inside-shot figcaption { margin-top: .6rem; font-size: .88rem; color: var(--text-secondary); }
.bkp-unlock {
    position: sticky; top: calc(var(--tl-nav-h, 64px) + 16px);
    padding: 1.4rem; border-radius: 18px; background: var(--bg-secondary); border: 1.5px solid var(--accent);
    scroll-margin-top: calc(var(--tl-nav-h, 64px) + 16px);
}
.bkp-unlock label:not(.bkp-opt) { display: block; font-weight: 600; margin: .8rem 0 .4rem; }
.bkp-unlock form > .btn { margin-top: .8rem; width: 100%; }
.bkp-includes { margin: 0 0 .4rem; padding-left: 1.2rem; line-height: 1.55; }
.bkp-includes li + li { margin-top: .3rem; }
.bkp-codeform { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.bkp-codeform .bkp-input { text-transform: uppercase; letter-spacing: .05em; }
.bkp-unlock .bkp-pack { margin-top: 1rem; }
.bkp-unlocked { margin: 0 0 .8rem; padding: .55rem .8rem; border-radius: 10px; background: var(--accent-light); color: var(--text-primary); font-weight: 600; }
.bkp-muted { color: var(--text-muted); }
@media (max-width: 900px) {
    .bkp-locked { grid-template-columns: 1fr; }
    .bkp-unlock { position: static; order: -1; }
}

.bkp-card-price { margin: .3rem 0 0; font-weight: 700; color: var(--accent); font-size: .9rem; }
/* the shift table in a card is narrower than in the hero: smaller letters so Z still fits */
.bkp-card .bkp-shift-row i { font-size: clamp(.45rem, .9vw, .7rem); padding: .25rem 0; }
.bkp-card .bkp-shift-row { gap: 1px; }

/* ---- browse: search and filters ------------------------------------- */
.bkp-filters { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: end; margin: 1.6rem 0 .4rem; padding: 1rem 1.1rem; border-radius: 14px; background: var(--bg-secondary); border: 1px solid var(--border); }
.bkp-filters label { display: grid; gap: .3rem; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.bkp-filters input, .bkp-filters select { font: inherit; font-size: .95rem; text-transform: none; letter-spacing: 0; font-weight: 400; padding: .5rem .7rem; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-primary); color: var(--text-primary); }
.bkp-f-search { flex: 1 1 16rem; }
.bkp-f-count { margin: 0 0 .55rem auto; color: var(--text-secondary); font-size: .9rem; }
.bkp-f-none { margin: 1.4rem 0; color: var(--text-secondary); }
.bkp-card[hidden], .bkp-group[hidden] { display: none; }

/* ---- browse pages (/badges, /kits) ---------------------------------- */
.bki-hero {
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
    padding: clamp(1.6rem, 4vw, 3.4rem); border-radius: 26px; border: 1px solid var(--border);
    background: radial-gradient(120% 140% at 0% 0%, rgba(14, 165, 233, .16), transparent 55%), radial-gradient(90% 120% at 100% 100%, rgba(245, 196, 81, .12), transparent 60%), var(--bg-secondary);
    overflow: hidden;
}
.bki-eyebrow { margin: 0 0 .7rem; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.bki-hero h1 { margin: 0 0 1rem; font-size: clamp(2rem, 4.2vw, 3.3rem); line-height: 1.08; letter-spacing: -.01em; }
.bki-lede { margin: 0; font-size: clamp(1.02rem, 1.4vw, 1.18rem); line-height: 1.65; color: var(--text-secondary); max-width: 58ch; }
.bki-ctas { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.6rem 0 1.3rem; }
.bki-trust { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; font-size: .9rem; color: var(--text-secondary); }
.bki-trust li::before { content: "\2713"; margin-right: .45rem; color: var(--success); font-weight: 800; }
.bki-hero-art { position: relative; min-height: 20rem; }
.bki-art-kit { width: 82%; transform: rotate(-3deg); border-radius: 16px; overflow: hidden; box-shadow: 0 22px 50px rgba(0, 0, 0, .35); }
.bki-art-kit .bkp-maze, .bki-art-kit .bkp-shift { border-radius: 0; box-shadow: none; }
.bki-art-cert { position: absolute !important; right: 0; bottom: -.4rem; width: 62%; transform: rotate(4deg); opacity: 1 !important; pointer-events: none; }
.bki-steps { list-style: none; counter-reset: bki; margin: 1.4rem 0 2.6rem; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.bki-steps li { counter-increment: bki; position: relative; padding: 1.1rem 1.1rem 1.1rem 3.6rem; border-radius: 16px; background: var(--bg-secondary); border: 1px solid var(--border); }
.bki-steps li::before {
    content: counter(bki); position: absolute; left: 1rem; top: 1rem; width: 1.9rem; height: 1.9rem; border-radius: 50%;
    display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800;
}
.bki-steps b { display: block; margin-bottom: .25rem; }
.bki-steps span { font-size: .9rem; line-height: 1.5; color: var(--text-secondary); }
.bki-list > h2, .bki-faq > h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); margin: 0 0 .4rem; }
.bki-card-art { position: relative; }
.bkp-hero-cover .bki-cover { border-radius: 16px; box-shadow: 0 18px 44px rgba(0, 0, 0, .35); }
/* the finished project, cut to one card shape so a row of cards lines up */
.bki-cover { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: center top; background: #fff; }
.bki-price {
    /* on the picture's bottom edge, half over the card: clear of the alphabet and the maze */
    position: absolute; bottom: -.8rem; right: .9rem; z-index: 1; padding: .25rem .65rem; border-radius: 999px;
    background: #1f2a44; color: #f5c451; font-weight: 800; font-size: .85rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.bki-price.free { background: var(--success); color: #fff; }
.bki-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto !important; padding-top: .7rem; }
.bki-tags span { padding: .15rem .55rem; border-radius: 999px; border: 1px solid var(--border); font-size: .76rem; color: var(--text-secondary); }
.bki-groups {
    display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(16rem, .7fr); gap: 2rem; align-items: center;
    margin: 3rem 0; padding: clamp(1.4rem, 3.5vw, 2.6rem); border-radius: 22px; border: 1px solid var(--border); background: var(--bg-secondary);
    scroll-margin-top: calc(var(--tl-nav-h, 64px) + 16px);
}
.bki-groups h2 { margin: 0 0 .8rem; font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.bki-groups p { color: var(--text-secondary); line-height: 1.65; max-width: 62ch; }
.bki-packs { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.bki-packs li { display: grid; grid-template-columns: auto 1fr; gap: 0 .9rem; align-items: baseline; padding: 1rem 1.2rem; border-radius: 14px; background: var(--bg-primary); border: 1px solid var(--border); }
.bki-packs b { grid-row: span 2; font-size: 1.7rem; color: var(--accent); }
.bki-packs small { color: var(--text-muted); }
.bki-faq { max-width: 860px; margin: 0 0 3rem; }
.bki-faq details { border-bottom: 1px solid var(--border); padding: .9rem 0; }
.bki-faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.bki-faq summary::after { content: "+"; color: var(--accent); font-weight: 800; }
.bki-faq details[open] summary::after { content: "\2212"; }
.bki-faq details p { margin: .6rem 0 0; color: var(--text-secondary); line-height: 1.65; }
.bki-links { margin-top: 1.4rem; font-size: .92rem; }
.bki-links a { color: var(--accent); }
#kits { scroll-margin-top: calc(var(--tl-nav-h, 64px) + 16px); }
@media (max-width: 1000px) {
    .bki-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .bki-hero, .bki-groups { grid-template-columns: 1fr; }
    .bki-hero-art { min-height: 0; padding-bottom: 3.5rem; max-width: 30rem; }
}
@media (max-width: 560px) {
    .bki-steps { grid-template-columns: 1fr; }
}
.bki-groups p + p { margin-top: .8rem; }

.bki-programs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0 0; }
.bki-programs button { font: inherit; font-weight: 700; padding: .55rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--border); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; }
.bki-programs button[aria-selected="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }

.bkp-was { color: var(--text-muted); font-weight: 500; font-size: .8em; margin-left: .3rem; }
.bkp-discount { margin-top: .9rem; }
.bkp-discount summary { cursor: pointer; color: var(--text-secondary); font-size: .9rem; }
.bkp-discount form { margin-top: .5rem; }
.bkp-discount .bkp-input { text-transform: uppercase; }

/* hero picture: the game a learner builds, and the real certificate in front of it */
.bki-hero-art { position: relative; min-height: 0; padding: 0 0 18% 0; }
.bki-art-game { margin: 0; width: 86%; transform: rotate(-4deg); transform-origin: 30% 60%; border-radius: 14px; overflow: hidden;
    box-shadow: 0 26px 60px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .06); position: relative; }
.bki-art-game img { display: block; width: 100%; height: auto; }
.bki-art-game figcaption { position: absolute; left: .7rem; top: 2.6rem; padding: .25rem .6rem; border-radius: 999px;
    background: rgba(15, 23, 42, .78); color: #e2e8f0; font-size: .74rem; font-weight: 700; letter-spacing: .02em; }
.bki-art-cert { position: absolute; right: -2%; bottom: 0; width: 70%; margin: 0; transform: rotate(3.5deg);
    filter: drop-shadow(0 22px 40px rgba(0, 0, 0, .5)); }
.bki-art-cert img { display: block; width: 100%; height: auto; border-radius: 3px; }
.bki-art-tag { position: absolute; top: -.9rem; right: -.6rem; white-space: nowrap; transform: rotate(4deg); padding: .35rem .8rem; border-radius: 999px;
    background: #f5c451; color: #1f2a44; font-size: .78rem; font-weight: 800; letter-spacing: .03em; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
@media (max-width: 860px) {
    .bki-hero-art { max-width: 34rem; padding-bottom: 22%; margin-top: .5rem; }
}
@media (max-width: 560px) {
    .bki-art-game figcaption { display: none; }
    .bki-art-tag { font-size: .66rem; padding: .25rem .55rem; top: -.7rem; right: -.2rem; }
}

.bkp-inside-intro { display: block; margin-top: .3rem; font-size: .88rem; line-height: 1.5; color: var(--text-secondary); }
.bkp-inside-steps li { align-items: flex-start; }

/* phones get the computer note first and loudest: paying on a phone and then finding the app
   needs a keyboard is the disappointment it heads off */
.bkp-device { margin: 0 0 1rem; padding: .7rem .85rem; border-radius: 10px; background: var(--bg-primary); border: 1px solid var(--border); font-size: .88rem; line-height: 1.5; color: var(--text-secondary); }
.bkp-device b { color: var(--text-primary); }
@media (max-width: 900px), (pointer: coarse) {
    .bkp-device { border-color: #f59e0b; background: rgba(245, 158, 11, .12); font-size: .95rem; }
}
.bkp-credit { margin: 2.5rem 0 0; font-size: .8rem; color: var(--text-muted); max-width: 72ch; }

.bkp-steplist li.ready .bkp-dot-cert { box-shadow: 0 0 0 2px var(--accent); }
.bkp-who-label { font-weight: 500 !important; font-size: .85rem; color: var(--text-secondary); }

/* admin preview bar (spec 189) */
.bkp-preview { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin: 0 0 1rem; padding: .7rem 1rem; border-radius: 12px;
    background: #312e81; color: #e0e7ff; font-size: .9rem; }
.bkp-preview b { color: #fff; }
.bkp-preview a { color: #c7d2fe; font-weight: 700; }

/* ---- the pretend network (step kind "sim") ------------------------- */

.bkp-net {
    display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.2rem;
    margin: 1.2rem 0; padding: 1rem; border-radius: 14px;
    background: var(--bg-secondary); border: 1px solid var(--border);
}
.bkp-net-maps { align-self: start; }
.bkp-net-msgs { grid-column: 1 / -1; }
.bkp-net-msgs .bkp-label { margin: 0 0 .4rem; }
.bkp-net-map { width: 100%; height: auto; display: block; }
.bkp-net-tall { display: none; }
.bkp-net-zone { fill: none; stroke: var(--border); stroke-width: 2; stroke-dasharray: 6 5; }
.bkp-net-zlabel { font-size: 14px; font-weight: 700; fill: var(--text-muted); letter-spacing: .04em; }
.bkp-net-wire { stroke: #64748b; stroke-width: 3; }
.bkp-net-node rect { fill: var(--bg-primary); stroke: var(--border); stroke-width: 2; }
.bkp-net-node.is-start rect { stroke: #f59e0b; }
.bkp-net-node.mark-ok rect { stroke: var(--success); }
.bkp-net-node.mark-bad rect { stroke: var(--error); stroke-width: 3; }
.bkp-net-name { font-size: 15px; font-weight: 700; fill: var(--text-primary); text-anchor: middle; }
.bkp-net-addr { font-size: 14px; fill: var(--text-secondary); text-anchor: middle; font-family: ui-monospace, Menlo, Consolas, monospace; }
.bkp-net-side { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.bkp-net-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.bkp-net-buttons .btn.done::before { content: "\2713  "; }
.bkp-net-buttons .btn:disabled { opacity: .45; cursor: not-allowed; }
.bkp-net-side .bkp-label { margin: .2rem 0 0; }
.bkp-net-log { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .88rem; line-height: 1.4; }
.bkp-net-log { font-size: .84rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bkp-net-log li { padding: .35rem .55rem; border-radius: 8px; background: var(--bg-primary); }
.bkp-net-empty { color: var(--text-muted); }
.bkp-net-browser { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.bkp-net-url { margin: 0; padding: .4rem .7rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; background: var(--bg-tertiary); }
.bkp-net-page { padding: .6rem .8rem; background: #fff; color: #222; }
.bkp-net-ok { margin: 0 0 .3rem; font-size: .8rem; font-weight: 700; color: #16a34a; }
.bkp-net-h { margin: 0; font-size: 1.15rem; font-weight: 800; }
.bkp-net-spy { border-radius: 10px; padding: .6rem .75rem; border: 2px solid var(--error); background: rgba(239, 68, 68, .08); }
.bkp-net-spy .bkp-label { margin: 0 0 .35rem; color: var(--error); }
.bkp-net-panel { border-radius: 10px; padding: .6rem .75rem; border: 1px solid var(--border); background: var(--bg-primary); }
.bkp-net-panel .bkp-label { margin: .2rem 0 .3rem; }
.bkp-net-panel pre { margin: 0 0 .4rem; font-size: .85rem; line-height: 1.55; white-space: pre; overflow-x: auto; }
.bkp-net-spy ul { margin: 0; padding: 0 .3rem 0 1.1rem; display: grid; gap: .35rem; font-size: .88rem; overflow-wrap: anywhere; }
@media (max-width: 860px) {
    .bkp-net { grid-template-columns: 1fr; padding: .7rem; }
    .bkp-net-log { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .bkp-net-wide { display: none; }
    .bkp-net-tall { display: block; max-width: 420px; margin: 0 auto; }
}

.bkp-more {
    display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap;
    margin: 0 0 1.6rem; padding: 1.2rem 1.4rem; border-radius: 14px;
    background: var(--bg-secondary); border: 1px solid var(--border);
}
.bkp-more h2 { margin: .1rem 0 .3rem; font-size: 1.15rem; }
.bkp-more p { margin: 0; max-width: 62ch; }

/* ---- drills (step kind "drill", badge-drills.js) ------------------- */

.bkp-drill { margin: 1.2rem 0; padding: 1rem; border-radius: 14px; background: var(--bg-secondary); border: 1px solid var(--border); display: grid; gap: 1rem; }
.bkd-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
/* trail drill: a robot follows tapped arrow cards across a small board */
.bkd-trail-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.bkd-trail-tab { border: 1px solid var(--border); background: transparent; color: inherit; border-radius: 999px; padding: .3rem .8rem; font: inherit; cursor: pointer; }
.bkd-trail-tab.on { border-color: #0ea5e9; background: rgba(14, 165, 233, .15); }
.bkd-trail-tab.done::after { content: " \2713"; color: #16a34a; }
.bkd-trail-board { position: relative; display: grid; gap: 3px; max-width: 360px; width: 100%; background: #86b86a; padding: 3px; border-radius: 10px; }
.bkd-trail-cell { aspect-ratio: 1; background: #a7d38a; border-radius: 4px; display: grid; place-items: center; }
.bkd-trail-cell.goal { background: #fde68a; }
.bkd-trail-cell.start { background: #bfdbfe; }
.bkd-trail-cell svg { width: 80%; height: 80%; }
.bkd-trail-bot { position: absolute; display: grid; place-items: center; transition: left .45s, top .45s, translate .13s; pointer-events: none; padding: 3px; box-sizing: border-box; }
.bkd-trail-nose { position: absolute; inset: 0; transition: transform .35s; }
.bkd-trail-nose svg { width: 100%; height: 100%; }
.bkd-trail-cell.hit { animation: bkd-hit 1.2s; }
.bkd-trail-board.hit { animation: bkd-hit 1.2s; }
@keyframes bkd-hit { 0%, 50% { box-shadow: inset 0 0 0 4px #dc2626; background-color: #fecaca; } }
.bkd-trail-card.bkd-card-L { border-color: #f97316; } .bkd-trail-step.bkd-card-L { background: #f97316; }
.bkd-trail-card.bkd-card-R { border-color: #8b5cf6; } .bkd-trail-step.bkd-card-R { background: #8b5cf6; }
.bkd-trail-step .bkd-arrow { font-size: 1.35rem; }
.bkd-trail-bot svg { width: 82%; height: 82%; }
.bkd-trail-prog { list-style: none; margin: 0; padding: .4rem; display: flex; flex-wrap: wrap; gap: .35rem; min-height: 3.2rem; border: 1px dashed var(--border); border-radius: 10px; }
.bkd-trail-step { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 8px; background: #0ea5e9; color: #fff; }
.bkd-trail-step.now { outline: 3px solid #f59e0b; }
.bkd-trail-empty { align-self: center; }
.bkd-trail-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.bkd-trail-card { display: grid; gap: .15rem; justify-items: center; padding: .6rem .3rem; border-radius: 12px; border: 2px solid #0ea5e9; background: transparent; color: inherit; font: inherit; font-size: .85rem; cursor: pointer; }
.bkd-arrow { font-size: 1.6rem; line-height: 1; font-weight: 700; }
.bkd-running .bkd-trail-card, .bkd-running .btn { opacity: .5; pointer-events: none; }
.bkd-panel { padding: .9rem; border-radius: 12px; background: var(--bg-primary); border: 1px solid var(--border); display: grid; gap: .6rem; align-content: start; }
.bkd-panel .bkp-label { margin: 0; }
.bkd-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.bkd-row .bkp-input { flex: 1; min-width: 8rem; }
.bkd-sound { font-size: .88rem; color: var(--text-secondary); display: inline-flex; align-items: center; gap: .3rem; }
.bkd-lamp { width: 64px; height: 64px; border-radius: 50%; margin: .2rem auto; background: #3a3f4b; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .3); transition: background .05s; }
.bkd-lamp.on { background: #fde047; box-shadow: 0 0 28px 6px rgba(253, 224, 71, .7); }
.bkd-written, .bkd-seq { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.15rem; letter-spacing: .08em; text-align: center; }
.bkd-decoded { margin: 0; font-size: 1.3rem; font-weight: 800; text-align: center; letter-spacing: .12em; min-height: 1.6rem; }
.bkd-key { justify-self: center; width: 9rem; height: 9rem; border-radius: 50%; border: 0; font-size: 1.05rem; font-weight: 700; color: #fff; background: var(--accent); box-shadow: 0 8px 0 rgba(0, 0, 0, .35); cursor: pointer; touch-action: none; user-select: none; }
.bkd-key.on { transform: translateY(6px); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.bkd-msg { margin: 0; font-size: .9rem; }
.bkd-msg p { margin: .2rem 0; }
.bkd-good { color: var(--success); font-weight: 700; }
.bkd-bad { color: var(--error); }
.bkd-chart summary { cursor: pointer; font-weight: 700; }
.bkd-chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr)); gap: .35rem; margin: .6rem 0; }
.bkd-code { display: flex; justify-content: space-between; gap: .3rem; padding: .3rem .5rem; border-radius: 6px; background: var(--bg-primary); }
.bkd-code code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .1em; }
.bkd-items { display: flex; flex-wrap: wrap; gap: .45rem; }
.bkd-item { padding: .45rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); cursor: pointer; font-size: .9rem; }
.bkd-item.in { border-color: var(--accent); background: var(--accent-light); }
/* the placeholder must be exactly a button's size, or the shelf still shifts */
.bkd-item { font-family: inherit; line-height: 1.3; box-sizing: border-box; display: inline-block; }
.bkd-item-gap { visibility: hidden; pointer-events: none; }
.bkd-empty { flex: 1 1 100%; margin: 0; }
@media (max-width: 760px) {
    .bkd-cols { grid-template-columns: 1fr; }
}
