/* TurkeyBoards Tools — Firmware Kit: layer bar, board canvas, keycode palette, pin tables, image preview. */


/* the board */
#board { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#board:focus { outline: none; }
#board:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
.fk-key { cursor: pointer; }
.fk-key .cap { fill: var(--fk-cap); stroke: var(--fk-edge); stroke-width: 1.5; }
.fk-key .face { fill: var(--fk-face); }
.fk-key text { font-family: var(--font-ui); font-weight: 700; fill: var(--fk-ink); pointer-events: none; }
.fk-key .hold { opacity: .72; }
.fk-key.is-mod .cap { fill: var(--brand-deck); } .fk-key.is-mod .face { fill: #2b6290; } .fk-key.is-mod text { fill: #ffffff; }
.fk-key.is-layer .cap { fill: var(--brand-feather-light); } .fk-key.is-layer .face { fill: #b6e0f3; } .fk-key.is-layer text { fill: #001634; }
.fk-key.is-special .cap { fill: var(--brand-wattle); } .fk-key.is-special .face { fill: #e04a52; } .fk-key.is-special text { fill: #ffffff; }
.fk-key.is-zmk .cap { fill: #6a4fb3; } .fk-key.is-zmk .face { fill: #7d63c4; } .fk-key.is-zmk text { fill: #ffffff; }
.fk-key.is-trans text { fill: var(--fk-faint); }
.fk-key.is-none text { fill: var(--fk-faint); }
.fk-key.is-raw .cap { stroke: var(--warning); stroke-dasharray: 4 3; }
.fk-key.is-held .cap { fill: var(--brand-beak); } .fk-key.is-held .face { fill: #ffb44d; } .fk-key.is-held text { fill: #001634; }
.fk-key.is-missing .cap { stroke: var(--danger); stroke-width: 2.5; stroke-dasharray: 5 3; }
.fk-key.is-sel .cap { stroke: var(--selection); stroke-width: 4; }
/* Swap with… (the right-click menu): the key waiting for the one to swap with */
.fk-key.is-swap .cap { stroke: var(--selection); stroke-width: 3; stroke-dasharray: 6 4; }
/* the board's right-click menu (.menu.pv-menu, shared with the Layout Editor and the Ergogen Builder): the views and the
   layers as one row of small buttons each */
.fk-ctx .fk-ctx-row { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 6px 4px; }
.fk-ctx .fk-ctx-row button { width: auto; flex: 1 0 auto; min-width: 36px; justify-content: center; padding: 5px 8px; border: 1px solid var(--line); background: var(--surface-sunken); font: 600 12.5px/18px var(--font-ui); }
.fk-ctx .fk-ctx-row button[aria-checked="true"] { background: var(--brand-feather); border-color: var(--sticker-edge); color: var(--on-feather); }
.fk-ctx .fk-ctx-row button:hover { border-color: var(--line-strong); }
.fk-ctx .fk-ctx-row button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.fk-ctx .ctx-l { flex: 1; min-width: 0; }
.fk-key:hover .cap { stroke: var(--selection); }
.fk-knob .cap { fill: #3a3d42; } .fk-knob .face { fill: #4a4e55; } .fk-knob text { fill: #ffffff; }
:root { --fk-cap: #d5e0ea; --fk-face: #fcfcfc; --fk-edge: #001634; --fk-ink: #001634; --fk-faint: #8aa1b6; }
/* keycaps stay light on the dark canvas, as in the Layout Editor */
:root[data-theme="dark"] { --fk-edge: #000000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --fk-edge: #000000; } }
.file-list li .btn-row { flex-wrap: nowrap; }
@media (max-width: 600px) { .fwk .canvas-hint { display: none; } }

/* image preview over the canvas */
.fk-image { position: absolute; inset: 0; overflow: auto; display: grid; place-items: start center; padding: 24px; background: var(--canvas); }
.fk-image img { max-width: 100%; height: auto; box-shadow: var(--shadow-pop); border-radius: var(--radius-md); }


/* pins */
.fk-pins select { height: 28px; font-size: 12px; }
.fk-pins td { padding: 3px 4px; }
.fk-pins th { white-space: nowrap; }
.fk-pins .side { font: 700 10.5px/14px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); padding-top: 10px; }
.fk-pins .is-dup select { border-color: var(--danger); color: var(--danger); }
.fk-ro td { font-family: var(--font-mono); }

/* tap dance and macro keys, and a combo's keys while picking them */
.fk-key.is-td .cap { fill: #0b7a6f; } .fk-key.is-td .face { fill: #13968a; } .fk-key.is-td text { fill: #ffffff; }
.fk-key.is-macro .cap { fill: #8a5a00; } .fk-key.is-macro .face { fill: #b37700; } .fk-key.is-macro text { fill: #ffffff; }
.fk-key.is-combo .cap { stroke: var(--brand-beak); stroke-width: 4; }
.fk-key.is-combo .face { fill: #ffd59a; } .fk-key.is-combo text { fill: #001634; }

/* extras: tap dance, combos, macros */
.fk-cards { display: grid; gap: 10px; }
.fk-card { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-sunken); }
.fk-card.is-picking { border-color: var(--brand-beak); box-shadow: inset 0 0 0 1px var(--brand-beak); }
.fk-card-h { display: flex; align-items: center; gap: 6px; }
.fk-card-h code { font: 700 12px/1 var(--font-mono); color: var(--ink-muted); flex: none; }
.fk-card-h input { flex: 1 1 auto; min-width: 0; height: 30px; }
.fk-card-h .tb-btn, .fk-card-h .tb-iconbtn { flex: none; }
.fk-card .fld input { font-family: var(--font-mono); font-size: 12px; }
.fk-card .fld input[data-f="term"] { font-family: inherit; max-width: 120px; }
.fk-combo-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; min-height: 28px; }
.fk-combo-keys .chip { display: inline-grid; place-items: center; min-width: 30px; height: 28px; padding: 0 6px; border-radius: var(--radius-key); border: 1.5px solid var(--brand-outline); background: var(--keycap); color: var(--keycap-legend); font: 700 12px/1 var(--font-ui); }
.fk-combo-keys > span:not(.chip):not(.note) { color: var(--ink-muted); font-weight: 700; }
.fk-layer-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-height: 32px; }
.fk-layer-checks .check { font-size: 12px; }
.fk-macro { width: 100%; min-height: 56px; resize: vertical; font: 400 12.5px/1.45 var(--font-mono); padding: 6px 8px; }
.fk-card .is-bad { color: var(--danger); }
#panel-extras code { font-family: var(--font-mono); font-size: 0.92em; }

/* the firmware switcher in the toolbar: a firmware this controller can't run stays visible, greyed, with its reason */
.fk-fw { flex: none; }
.fk-fw button[aria-disabled="true"] { opacity: .42; cursor: not-allowed; }
.fk-fw button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* Download: one click for the package, the caret for the rest */
.fk-split { display: inline-flex; }
.fk-split > .tb-btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.fk-split > .fk-caret { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-width: 0; padding-inline: 6px; }
.fk-split > .fk-caret svg { width: 14px; height: 14px; }
@media (max-width: 560px) { .ed-toolbar-row .fk-split > .fk-caret { padding-inline: 4px; } }

/* keys the chosen firmware can't use */
.fk-key.is-bad .cap { stroke: var(--warning); stroke-width: 3; stroke-dasharray: 5 3; }
.fk-cant { display: grid; gap: 6px; justify-items: start; padding: 8px 10px; border: 1px solid var(--warning); border-radius: var(--radius-md); background: var(--surface-sunken); }
.fk-cant p { margin: 0; font-size: 13px; line-height: 19px; color: var(--warning); }

/* the LEDs view: the chain, and a numbered dot per LED (orange: on a key; pale: underglow) */
.fk-key.is-led text { fill: var(--fk-faint); }
.fk-key.is-noled .cap { stroke-dasharray: 4 3; }
.fk-key.is-noled .face { fill: var(--fk-cap); }
.fk-leds { pointer-events: none; }
.fk-leds .chain { fill: none; stroke: #f08c00; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; opacity: .55; }
.fk-leds .dot circle { fill: var(--brand-beak); stroke: #001634; stroke-width: 1.5; }
.fk-leds .glow circle { fill: #fff3bf; stroke: #f08c00; stroke-width: 1.5; }
.fk-leds text { font: 700 11px var(--font-mono); fill: #001634; }
.fk-leds .first circle { stroke-width: 3; }
/* numbering the chain by hand: keys still to number dashed, numbered ones with a big number, a mirrored half's follow faintly */
.ed-canvas-wrap.is-numbering { box-shadow: inset 0 0 0 3px var(--brand-beak); }
.fk-key.is-todo .cap { stroke: var(--brand-beak); stroke-width: 2.5; stroke-dasharray: 5 3; }
.fk-key.is-todo:hover .cap, .fk-key.is-todo.is-sel .cap { stroke-dasharray: none; stroke-width: 3.5; }
.fk-key.is-numbered .cap { stroke: #f08c00; stroke-width: 2; }
.fk-key.is-follows { cursor: default; opacity: .75; }
.fk-numlayer .num circle { fill: var(--brand-beak); stroke: #001634; stroke-width: 1.5; }
.fk-numlayer .num.auto circle { fill: #fff3bf; stroke: #f08c00; }
.fk-numlayer .num text { font: 700 14px var(--font-mono); }
.fk-prevbar.fk-numbar { border-left-color: var(--brand-beak); }
.fk-numbar .fk-narrow { display: none; }
@media (max-width: 600px) {
  .fk-numbar .fk-wide { display: none; }
  .fk-numbar .fk-narrow { display: inline; }
  .fk-numbar .btn-row { flex-wrap: nowrap; gap: 6px; width: 100%; }
  .fk-numbar .btn-row .tb-btn { flex: 1 1 auto; justify-content: center; white-space: nowrap; padding-left: 8px; padding-right: 8px; font-size: 13px; }
  .fk-numbar .btn-row .tb-btn-ghost { flex-grow: 0; }
  /* the bar sits under the board on phones, not over it */
  .ed-canvas-wrap.is-numbering #board { height: calc(100% - var(--banner-h, 0px) - var(--numbar-h, 0px)); }
}
.fk-light-matrix #led-number { justify-self: start; }

/* lighting */
.fk-light-matrix { display: grid; gap: 10px; }
#light-seg button small { white-space: nowrap; }


.fk-pkg-h { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fk-pkg-h > div { display: grid; gap: 1px; min-width: 0; }
.fk-pkg-h b { font: 700 13.5px/18px var(--font-mono); overflow-wrap: anywhere; }
.fk-pkg-h span { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.fk-pkg-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--brand-feather); color: var(--on-feather); border: 1.5px solid var(--sticker-edge); }
.fk-pkg-icon svg { width: 18px; height: 18px; }
.fk-tree { contain: inline-size; list-style: none; margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); font: 400 12px/20px var(--font-mono); max-height: 260px; overflow: auto; }
.fk-tree li { padding-left: calc(var(--d, 0) * 14px); white-space: nowrap; }
.fk-tree li.is-dir { color: var(--ink-muted); }
.fk-tree button { font: inherit; color: var(--link); background: none; border: 0; padding: 0 2px; margin: 0 -2px; border-radius: 3px; cursor: pointer; text-align: left; }
.fk-tree button:hover { text-decoration: underline; }
.fk-steps code, .fk-cmd code, #usb-note code { font: 400 12px/1.5 var(--font-mono); }
.fk-steps p code { color: var(--ink); background: var(--surface-sunken); border-radius: 3px; padding: 0 3px; }
.fk-cmd { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: start; margin-top: 6px; contain: inline-size; }
.fk-cmd pre { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-sunken); border: 1px solid var(--line); overflow-x: auto; white-space: pre; color: var(--ink); }
.fk-cmd pre:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }

/* the keyboard's name in the header: a long one ends in … */
#kb-name { text-overflow: ellipsis; }

/* why a greyed-out firmware isn't available: a line just under the switcher, after a tap or Enter on it */
.fk-fw-tip { position: fixed; z-index: 55; width: max-content; max-width: min(360px, calc(100vw - 16px)); padding: 8px 12px; border-radius: var(--radius-md); border: 1px solid var(--warning); background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-pop); font: 400 13px/19px var(--font-ui); }
.fk-fw-tip::before { content: ""; position: absolute; top: -6px; left: calc(var(--tip-x, 20px) - 5px); width: 10px; height: 10px; background: var(--surface-raised); border-left: 1px solid var(--warning); border-top: 1px solid var(--warning); transform: rotate(45deg); }

/* toasts: never over the canvas hint; on phones as wide as the screen allows, not a narrow box of four lines */
body:has(> #toast:not([hidden])) #canvas-hint { visibility: hidden; }
@media (max-width: 560px) {
  .toast { left: 12px; right: 12px; width: auto; transform: none; max-width: none; justify-content: space-between; }
}

/* lighting's own fieldset (greyed for a design), and button rows whose text-only button starts flush with the one above */
fieldset.fk-set { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
fieldset.fk-set:disabled { opacity: .45; }
.fk-btns-flush { column-gap: 14px; }
.fk-btns-flush > .tb-btn-ghost { padding-inline: 0; }

/* keys without a matrix position: a banner over the board with the fix; the board moves down to make room for it */
.fk-banner { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 8; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 12px; background: var(--surface-raised); border: 1px solid var(--line); border-left: 3px solid var(--danger); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); }
.fk-banner-text { flex: 1 1 300px; min-width: 0; }
.fk-banner-text b { display: block; font-size: 14px; line-height: 20px; }
.fk-banner-text p { margin: 2px 0 0; font-size: 13px; line-height: 19px; color: var(--ink-muted); }
.fk-banner .btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fk-banner .tb-btn svg { width: 15px; height: 15px; }
.fk-banner.is-flash { animation: fk-flash 1s ease-out; }
@keyframes fk-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--danger), var(--shadow-pop); } 100% { box-shadow: var(--shadow-pop); } }
@media (prefers-reduced-motion: reduce) { .fk-banner.is-flash { animation: none; outline: 3px solid var(--danger); } }
.ed-canvas-wrap.has-banner #board { height: calc(100% - var(--banner-h, 0px)); margin-top: var(--banner-h, 0px); }
.fk-key.is-missing { cursor: help; }
.fk-key.is-missing:hover .cap { stroke: var(--danger); }
@media (max-width: 600px) {
  .fk-banner { left: 8px; right: 8px; top: 8px; padding: 8px 10px; }
  .fk-banner-text p { font-size: 12.5px; line-height: 18px; }
}

/* a button that reads as a link, inside a sentence */
.fk-link { font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.fk-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

/* no keys yet: where they come from, and a place to drop a keyboard file */
.ed-canvas-wrap.is-empty #board { display: none; }
.ed-canvas-wrap.is-empty .preview-empty { overflow-y: auto; place-content: safe center; }
.fk-empty { display: grid; justify-items: center; gap: 12px; max-width: 600px; margin: 0 auto; text-align: center; }
.fk-empty h2 { margin: 0; font: 700 18px/24px var(--font-ui); color: var(--ink); overflow-wrap: anywhere; }
.fk-empty > p { margin: 0; font-size: 13.5px; line-height: 20px; color: var(--ink-muted); }
.fk-empty .note { font-size: 12.5px; line-height: 18px; }
.fk-empty-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius-md); background: var(--brand-feather); color: var(--on-feather); border: 1.5px solid var(--sticker-edge); }
.fk-empty-icon svg { width: 28px; height: 28px; }
.fk-empty-btns { justify-content: center; }
.fk-empty-btns .tb-btn svg { width: 16px; height: 16px; }
.fk-drop { display: grid; justify-items: center; gap: 6px; width: 100%; padding: 16px; border: 2px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--surface-sunken); color: var(--ink-muted); font-size: 13px; line-height: 19px; }
.fk-drop b { color: var(--ink); font-size: 14px; }
.fk-drop code { font: 400 12px/1 var(--font-mono); color: var(--ink); }
.fk-drop .tb-btn svg { width: 15px; height: 15px; }
body.is-dropping .fk-drop { border-color: var(--selection); background: var(--selection-fill); }
@media (max-width: 900px) {
  .fwk .ed-canvas-wrap.is-empty { height: auto !important; min-height: 320px; }
  .fwk .ed-canvas-wrap.is-empty .preview-empty { position: static; padding: 20px 16px; }
}

/* the reason a firmware is greyed out, with its fix */
.fk-fw-tip.has-fix { display: grid; gap: 8px; justify-items: start; }
.fk-fw-tip .tb-btn { white-space: normal; text-align: left; }
.fk-key.is-missing text { fill: var(--fk-faint); }

/* ================= the calmer layout (2026-11): fewer boxes and lines, one place for the checks ================= */

/* ---------- toolbar: [layers] [view] [undo redo] … [firmware] [Download ▾] [Help]; groups set apart by space, not lines ---------- */
.fwk .ed-toolbar-row { column-gap: 14px; }
.fk-layer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; flex: 0 1 auto; min-width: 0; }
.fk-layers { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.fk-layers button { font: 700 12px/1 var(--font-ui); height: 30px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: transparent; color: var(--ink-muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.fk-layers button:hover { color: var(--ink); background: var(--surface-sunken); }
.fk-layers button b { font: 400 11px/1 var(--font-mono); color: var(--ink-muted); opacity: .8; }
.fk-layers button[aria-selected="true"] { background: var(--brand-feather); color: var(--on-feather); border-color: var(--sticker-edge); }
.fk-layers button[aria-selected="true"] b { color: var(--on-feather); }
.fk-chip-edit { width: 110px; height: 30px; border-radius: var(--radius-pill); padding: 0 12px; font: 700 12px/1 var(--font-ui); }
.fk-layer-tools .tb-iconbtn { width: 30px; height: 30px; }
.fk-layer-tools .tb-iconbtn svg { width: 17px; height: 17px; }
.fk-end { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; flex: none; min-width: 0; max-width: 100%; }
.fk-history { gap: 0; }
@media (max-width: 1240px) {
  .fwk .ed-toolbar-row { column-gap: 10px; }
  .fwk .ed-toolbar-row #help-btn { font-size: 0; gap: 0; padding-inline: 8px; }
  .fwk .ed-toolbar-row #help-btn > svg { width: 16px; height: 16px; }
  .fwk .fk-dl-fw { display: none; }
  .fwk .ed-toolbar-row .tb-seg button, .fk-layers button { padding-inline: 8px; }
}
@media (max-width: 560px) {
  .fwk .ed-toolbar-row { column-gap: 8px; }
  .fk-layers button { padding-inline: 7px; gap: 4px; }
}

/* ---------- the steps (the panel's tabs): a numbered circle each; ✓ when done, a red count when something needs fixing ---------- */
.fk-tabs-bar { padding: 4px 4px 0 6px; align-items: stretch; }
.fk-stepbar { gap: 0; }
.fk-stepbar button { position: relative; flex: 1 1 0; min-width: 52px; display: grid; justify-items: center; align-content: start; gap: 5px; padding: 8px 4px 8px; font: 700 12px/16px var(--font-ui); color: var(--ink-muted); border-bottom-width: 3px; }
.fk-stepbar button:hover { color: var(--ink); }
.fk-stepbar button[aria-selected="true"] { color: var(--ink); }
/* the line joining the steps, behind their circles */
.fk-stepbar [data-step]::before { content: ""; position: absolute; top: 18px; left: 0; right: 0; height: 1.5px; background: var(--line); }
.fk-stepbar [data-step="wiring"]::before { left: 50%; }
.fk-stepbar [data-step="build"]::before { right: 50%; }
.fk-stepbar [data-step].is-done::before, .fk-stepbar [data-step].is-done + [data-step]::before { background: color-mix(in srgb, var(--brand-feather) 55%, var(--line)); }
.fk-si { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink-muted); font: 700 11px/1 var(--font-mono); }
.fk-stepbar .is-done .fk-si { background: var(--brand-feather); border-color: var(--sticker-edge); color: var(--on-feather); font-size: 12px; }
.fk-stepbar .is-next .fk-si { border-color: var(--brand-feather-deep); color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-feather) 22%, transparent); }
.fk-stepbar .is-attn .fk-si { border-color: var(--danger); color: var(--danger); box-shadow: none; }
.fk-stepbar .is-opt .fk-si { border-style: dashed; }
.fk-badge { position: absolute; top: -6px; right: -11px; min-width: 16px; height: 16px; padding: 0 4px; display: grid; place-items: center; border-radius: var(--radius-pill); background: var(--danger); color: #ffffff; font: 700 10px/1 var(--font-ui); border: 1.5px solid var(--surface); }
.fk-stepbar .is-aside { flex: 0 1 auto; margin-left: 6px; padding-inline: 10px; }
.fk-stepbar .is-aside::after { content: ""; position: absolute; left: -4px; top: 10px; bottom: 12px; width: 1px; background: var(--line); }
.fk-stepbar .is-aside .fk-si { border: 0; background: none; }
.fk-stepbar .is-aside .fk-si svg { width: 18px; height: 18px; }
.fk-sl { white-space: nowrap; }
.fk-tabs-bar .dock-btn { align-self: center; margin-bottom: 0; }

/* ---------- panels: sections one under the other, a hairline between them ---------- */
.tab-panel.fk-panel { gap: 0; padding: 0 16px 20px; }
.fk-panel > :first-child { padding-top: 12px; }
.fk-sec { border-top: 1px solid var(--line); min-width: 0; }
.fk-panel > .fk-sec:first-child, .fk-panel > [hidden] + .fk-sec, .fk-panel > .fk-fwnote + .fk-sec { border-top: 0; }
.fk-sec-h { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fk-sec-t { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 12px 0; background: none; border: 0; color: var(--ink); font: 700 13.5px/20px var(--font-ui); cursor: pointer; text-align: left; border-radius: var(--radius-sm); }
.fk-sec-t:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.fk-chev { flex: none; width: 14px; height: 14px; color: var(--ink-muted); transition: transform .15s ease; }
.fk-sec.is-open > .fk-sec-h .fk-chev, .fk-sec-t[aria-expanded="true"] .fk-chev { transform: rotate(90deg); }
.fk-sec-n { flex: none; white-space: nowrap; }
.fk-sec-s { flex: 1 1 auto; min-width: 0; text-align: right; font: 400 12px/18px var(--font-mono); color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fk-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.fk-sec-h .help-dot { flex: none; margin-left: 4px; }
.fk-sec-b { display: grid; gap: 10px; padding: 0 0 16px; min-width: 0; }
fieldset.fk-sec-b { border: 0; margin: 0; }
fieldset.fk-sec-b:disabled { opacity: .55; }
.fk-sec-act { padding: 0 0 14px; }
.fk-sec-act .tb-btn svg, #pins-btns .tb-btn svg { width: 15px; height: 15px; }
.fk-sub { font-size: 12.5px; line-height: 18px; margin-top: -4px; }
/* a chip on the PCB: its options, under the board's own fields */
.fk-chip, .fk-chip > div { display: grid; gap: 10px; min-width: 0; }
.fk-chip[hidden], .fk-chip > div[hidden], #chip-vbat-fld[hidden], #oled-pick[hidden] { display: none; }
.fk-chip .grid-2 .tb-input { min-width: 0; text-overflow: ellipsis; }
select.tb-input.is-empty#chip-vbat { border: 1.5px dashed var(--warning); }
.fk-source { display: grid; gap: 8px; padding-bottom: 12px; }
.fk-source .note b { color: var(--success); }
/* a field that's missing something, while its section has a dot */
.fk-pins.show-empty select.is-empty, select.tb-input.is-empty#serial-select { border: 1.5px dashed var(--warning); }
.fk-pins td, .fk-pins th { border-bottom-color: color-mix(in srgb, var(--line) 60%, transparent); }

/* ---------- Keymap tab: the chosen key, then the keycodes ---------- */
.fk-key-sec, .fk-kc-sec { display: grid; gap: 10px; padding: 12px 0 14px; min-width: 0; }
.fk-kc-sec { border-top: 1px solid var(--line); padding-top: 14px; }
.fk-km-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; min-width: 0; }
.fk-km-h h4 { margin: 0; display: flex; align-items: center; gap: 6px; font: 700 13.5px/20px var(--font-ui); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fk-type { font-size: 12.5px; color: var(--ink-muted); white-space: nowrap; }
.fk-current { display: grid; gap: 8px; }
.fk-now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fk-now > div { display: grid; gap: 2px; min-width: 0; }
.fk-now b { font: 700 13px/18px var(--font-ui); color: var(--ink); overflow-wrap: anywhere; }
.fk-now code { font: 400 12px/16px var(--font-mono); color: var(--ink-muted); overflow-wrap: anywhere; }
.fk-now .chip { flex: none; min-width: 48px; height: 48px; padding: 4px 8px; display: grid; place-content: center; text-align: center; border-radius: var(--radius-key); border: 1.5px solid var(--brand-outline); background: var(--keycap); color: var(--keycap-legend); font: 700 14px/16px var(--font-ui); box-shadow: inset 0 -5px 0 rgba(0, 22, 52, .14); }
.fk-now .chip small { font: 700 10px/12px var(--font-ui); opacity: .72; }
.fk-builder { display: grid; gap: 10px; }
.fk-key-btns { gap: 6px; }
/* Keycodes: the switch (Keys · Actions · Device · Layouts), that tab's groups as one block of chips, then the keys */
.fk-kc-seg { width: 100%; }
.fk-kc-seg button { min-height: 30px; padding: 6px 4px; }
.fk-kc-seg button[aria-selected="true"] { background: var(--brand-feather); color: var(--on-feather); box-shadow: 0 0 0 1.5px var(--sticker-edge); }
.fk-kc-seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.fk-cats { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.fk-cats[hidden] { display: none; }
.fk-cats button { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px 0 9px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 12px/1 var(--font-ui); cursor: pointer; white-space: nowrap; }
.fk-cats button small { font: 400 10.5px/1 var(--font-mono); color: var(--ink-muted); }
.fk-cats button:hover { background: var(--surface-sunken); border-color: var(--line-strong); }
.fk-cats button[aria-selected="true"] { background: var(--brand-deck); color: var(--on-deck); border-color: var(--brand-deck); }
.fk-cats button[aria-selected="true"] small { color: inherit; opacity: .8; }
.fk-cats button.is-off { border-style: dashed; color: var(--ink-muted); }
.fk-cats button.is-off[aria-selected="true"] { color: var(--on-deck); }
.fk-cats button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
@media (pointer: coarse) { .fk-cats button { height: 32px; padding-inline: 11px; } }
/* search results in place of the groups: what was searched, how many, and the way back */
.fk-results { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.fk-results[hidden] { display: none; }
.fk-results #kc-back { margin-left: auto; }
/* Layouts: a gallery of cards, previewed on the board, then Apply or Cancel */
.fk-layouts { display: grid; gap: 10px; min-width: 0; }
.fk-layouts[hidden] { display: none; }
.fk-lnote { margin: 0; font-size: 12.5px; line-height: 18px; }
.fk-lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fk-lcard { display: grid; align-content: start; gap: 6px; padding: 10px 11px; text-align: left; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; min-width: 0; }
.fk-lcard:hover { border-color: var(--selection); background: var(--selection-fill); }
.fk-lcard:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.fk-lcard.is-on { border-color: var(--brand-feather-deep); box-shadow: inset 0 0 0 1.5px var(--brand-feather-deep); background: var(--selection-fill); }
.fk-lcard-h { display: flex; align-items: center; justify-content: space-between; gap: 6px; font: 700 13px/18px var(--font-ui); }
.fk-lnow { font: 700 10px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; padding: 3px 6px; border-radius: var(--radius-pill); background: var(--brand-deck); color: var(--on-deck); }
.fk-lcard-rows { display: grid; gap: 1px; font: 400 12px/15px var(--font-mono); letter-spacing: .04em; color: var(--ink-muted); white-space: pre; }
.fk-lcard-txt { font: 400 12px/16px var(--font-ui); color: var(--ink-muted); }
.fk-lcard small { font: 400 11px/14px var(--font-ui); color: var(--ink-muted); }
.fk-lprev { display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--line); border-left: 3px solid var(--brand-feather); background: var(--surface-sunken); }
.fk-lprev p { margin: 0; font-size: 12.5px; line-height: 18px; }
.fk-lprev .btn-row, .fk-prevbar .btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* the board while a layout is on preview: a bar over it, and the keys that change outlined */
.fk-prevbar { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 8; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 12px; background: var(--surface-raised); border: 1px solid var(--line); border-left: 3px solid var(--brand-feather); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); }
.fk-prevbar[hidden] { display: none; }
.fk-prevbar p { flex: 1 1 260px; min-width: 0; margin: 0; font-size: 13px; line-height: 19px; color: var(--ink-muted); }
.fk-prevbar p b { color: var(--ink); margin-right: 4px; }
.ed-canvas-wrap.is-preview { box-shadow: inset 0 0 0 3px var(--brand-feather); }
.fk-key.is-changed .cap { stroke: var(--brand-feather-deep); stroke-width: 3.5; }
@media (max-width: 600px) { .fk-prevbar { left: 8px; right: 8px; top: auto; bottom: 8px; padding: 8px 10px; gap: 6px 10px; } .fk-prevbar p { flex-basis: 100%; font-size: 12.5px; line-height: 18px; } }
/* "With Ctrl / Shift / Alt / GUI": the modifiers held with the chosen key */
.fk-mods { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.fk-mods-l { font: 700 10.5px/14px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); margin-right: 4px; }
.fk-mod { height: 28px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 12px/1 var(--font-ui); cursor: pointer; }
.fk-mod:hover:not(:disabled) { background: var(--surface-sunken); border-color: var(--line-strong); }
.fk-mod[aria-pressed="true"] { background: var(--brand-deck); color: #ffffff; border-color: var(--brand-deck); }
.fk-mod-r { margin-left: auto; color: var(--ink-muted); }
.fk-mod-r[aria-pressed="true"] { background: var(--surface-sunken); color: var(--ink); border-color: var(--line-strong); }
.fk-mod:disabled { opacity: .45; cursor: default; }
.fk-mod:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
@media (pointer: coarse) { .fk-mod { height: 34px; } }
.fk-palette .fk-pal-hint { padding-top: 0; font-size: 12px; }
.fk-found { font-size: 12px; }
.fk-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; padding: 2px 0; }
.fk-palette button { min-height: 46px; padding: 4px; border-radius: var(--radius-key); border: 1px solid var(--line-strong); background: var(--surface-sunken); color: var(--ink); font: 700 13px/15px var(--font-ui); cursor: pointer; display: grid; place-content: center; gap: 2px; text-align: center; overflow-wrap: anywhere; }
.fk-palette button small { font: 400 10px/12px var(--font-mono); color: var(--ink-muted); }
.fk-palette button:hover, .fk-palette button:focus-visible { border-color: var(--selection); background: var(--selection-fill); outline: none; }
.fk-palette button.is-on { border-color: var(--brand-feather-deep); box-shadow: inset 0 0 0 1.5px var(--brand-feather-deep); }
.fk-palette .fk-more { grid-column: 1 / -1; min-height: 34px; font-weight: 400; font-size: 12.5px; color: var(--ink-muted); }
.fk-palette .empty-note { grid-column: 1 / -1; font-size: 13px; color: var(--ink-muted); padding: 6px 2px; margin: 0; }

/* ---------- small cards over the page: the layer menu, Layout ▾ ---------- */
.fk-layer-menu { min-width: 240px; }
.fk-layer-menu .fk-mi { flex: 1; }
.fk-layer-menu button:disabled { opacity: .45; cursor: not-allowed; }
.fk-layer-menu .is-danger { color: var(--danger); }
.fk-tick { flex: none; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-strong); }
.fk-layer-menu [aria-checked="true"] .fk-tick { background: var(--brand-feather); border-color: var(--sticker-edge); }
.fk-layer-menu [aria-checked="true"] .fk-tick::after { content: "✓"; font: 700 11px/1 var(--font-ui); color: var(--on-feather); }
.fk-menu-note { margin: 6px 10px 4px; font: 400 12px/17px var(--font-mono); color: var(--ink-muted); }
.fk-flush { justify-self: start; padding-inline: 0; }

/* ---------- the checks: a pill at the end of the status bar, and the list it opens ---------- */
.fk-checks-btn { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid currentColor; background: transparent; font: 700 11px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; cursor: pointer; }
.fk-checks-btn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fk-checks-btn.is-err { color: var(--danger); }
.fk-checks-btn.is-ok { color: var(--success); }
.fk-checks-btn small { font: inherit; color: var(--warning); }
.fk-checks-btn:hover { background: var(--surface-sunken); }
.fk-checks-btn[aria-expanded="true"] { background: var(--brand-feather); color: var(--on-feather); border-color: var(--sticker-edge); }
.fk-checks-btn[aria-expanded="true"] small { color: var(--on-feather); }
.fk-checks { position: fixed; z-index: 52; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(42px + env(safe-area-inset-bottom, 0px)); width: min(420px, calc(100vw - 24px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); }
.fk-checks-head { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--line); }
.fk-checks-head h2 { margin: 0; font: 700 15px/20px var(--font-ui); }
.fk-checks-head h2:focus { outline: none; }
.fk-checks-head h2:focus-visible { outline: none; }
.fk-checks-head .note { flex: 1; font-size: 12px; }
.fk-checks-body { overflow-y: auto; padding: 4px 16px 14px; display: grid; gap: 6px; overscroll-behavior: contain; }
.fk-checks-body h3 { margin: 10px 0 2px; }
.fk-issues { list-style: none; margin: 0; padding: 0; display: grid; }
.fk-issues li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; padding: 8px 0; font-size: 13px; line-height: 19px; color: var(--ink); border-top: 1px solid var(--line); }
.fk-issues li:first-child { border-top: 0; }
.fk-issues li > i { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--danger); }
.fk-issues li.is-warn > i { background: var(--warning); }
.fk-issues .tb-btn { height: 28px; padding: 0 10px; }
.fk-allgood { margin: 10px 0 4px; font-size: 13px; color: var(--success); }
@media (max-width: 560px) {
  .fk-checks { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: 75vh; }
  .fk-issues li { grid-template-columns: 8px minmax(0, 1fr); }
  .fk-issues li > .tb-btn { grid-column: 2; justify-self: start; }
}

/* ---------- the next step, once this one has nothing to fix ---------- */
.fk-next { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--line); background: var(--surface); font-size: 12.5px; line-height: 20px; color: var(--ink-muted); }
.fk-ok { color: var(--success); font-weight: 700; }
.fk-link-btn { font: 700 12.5px/20px var(--font-ui); color: var(--link); background: none; border: 0; padding: 2px 4px; margin: -2px -4px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; }
.fk-link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Extras ---------- */
.fk-fwnote { padding-bottom: 4px; }
.fk-fwnote b { color: var(--ink); }
.fk-add-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.fk-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-muted); }
.fk-inline input { width: 60px; height: 30px; }
.fk-syntax { font-size: 12px; line-height: 18px; }
.fk-syntax code { color: var(--ink); }
.fk-card { background: transparent; }
/* what each firmware does with a section: one quiet line, the chosen firmware first and in ink */
.fk-avail { font-size: 12px; line-height: 18px; margin-top: -4px; }
.fk-avail .is-on { color: var(--ink); }
.fk-avail .is-on b { font-weight: 700; }
/* the other firmware's lines: folded behind a small "Other firmware", one line each when open */
.fk-other { margin-top: 2px; }
.fk-other > summary { display: inline-flex; align-items: center; gap: 4px; list-style: none; cursor: pointer; color: var(--ink-muted); font: 600 11.5px/18px var(--font-ui); border-radius: var(--radius-sm); }
.fk-other > summary::-webkit-details-marker { display: none; }
.fk-other > summary::after { content: ""; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); margin-left: 1px; }
.fk-other[open] > summary::after { transform: rotate(45deg); margin-top: -3px; }
.fk-other > summary:hover { color: var(--ink); }
.fk-other > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.fk-other > span { display: block; color: var(--ink-muted); }
#serial-field { display: grid; gap: 10px; }
#serial-field[hidden] { display: none; }
/* a section this firmware can't use: greyed, its line says why (the line stays readable) */
.fk-sec.is-off .fk-sec-n { color: var(--ink-muted); }
fieldset.fk-sec-b:disabled .fk-avail { opacity: 1; }
fieldset.fk-sec-b:disabled > :not(.fk-avail) { opacity: .5; }
fieldset.fk-sec-b:disabled { opacity: 1; }
.fk-sec-b .check { font-size: 13px; line-height: 18px; align-items: flex-start; }
.fk-sec-b .check input { margin-top: 1px; flex: none; }
.fk-indent { margin-left: 24px; }
.fk-checks-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.fk-checks-row .note { font-size: 12px; }
.fk-as-more { display: grid; gap: 10px; padding-left: 24px; }
.fk-as-more[hidden] { display: none; }
.fk-fld-note { align-self: end; font-size: 12px; line-height: 16px; padding-bottom: 7px; margin: 0; }
#tap-slow[hidden] { display: none; }
/* a key override's modifiers: small toggles */
.fk-ko-mods { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; min-width: 0; }
.fk-tog { position: relative; display: inline-flex; }
.fk-tog input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.fk-tog span { display: inline-grid; place-items: center; min-width: 44px; height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: 600 12px/1 var(--font-ui); color: var(--ink-muted); background: var(--surface); }
.fk-tog input:checked + span { background: var(--brand-feather); border-color: var(--sticker-edge); color: var(--on-feather); }
.fk-tog input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.fk-lead-chip { flex: none; display: inline-grid; place-items: center; height: 26px; padding: 0 8px; border-radius: var(--radius-key, 4px); border: 1.5px solid var(--brand-outline, var(--line-strong)); font: 700 11px/1 var(--font-ui); color: var(--ink-muted); }
.fk-mono { font-family: var(--font-mono); font-size: 12.5px; }
.fk-card textarea.fk-macro[rows="1"] { min-height: 34px; }

/* layer lighting: a row per layer (its name, a colour, a swatch), the lights for Caps Lock and friends */
.fk-glow-list { display: grid; gap: 6px; }
.fk-glow-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fk-glow-n { flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fk-glow-row select { flex: 0 1 150px; width: auto; min-width: 0; }
.fk-glow-row .fk-indent { margin-left: 24px; }
.fk-glow-ind { display: grid; gap: 6px; }
.fk-glow-ind .fk-glow-row.fk-indent select { flex: 0 1 130px; }
.fk-glow-ind .check.fk-glow-n { align-items: center; }
.fk-glow-ind .check.fk-glow-n input { margin-top: 0; }
.fk-swatch { flex: none; width: 32px; height: 32px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-sunken); cursor: pointer; }
/* a link to another section: wraps on a narrow panel */
.fk-xlink .fk-link-btn, .fk-avail .fk-link-btn { white-space: normal; text-align: left; margin: 0; padding: 0; }
/* (a swatch not in use keeps its place, so the colour menus line up) */
.fk-swatch.is-none { visibility: hidden; }
.fk-led-n { flex: 0 0 64px; width: 64px; }
.fk-grp { display: grid; gap: 8px; }
.fk-grp[hidden], .fk-grp > [hidden] { display: none; }
.fk-grp > .tb-label { margin: 4px 0 -2px; }
/* the OLED: a preview of each half's screen (6 × 8 pixel characters: 21 × 4 across, 5 × 16 upright) */
.fk-screens { display: grid; gap: 14px; }
.fk-screen { display: grid; gap: 8px; min-width: 0; }
.fk-oled-wrap { display: flex; justify-content: center; padding: 10px; border-radius: var(--radius-md); background: var(--surface-sunken); border: 1px solid var(--line); }
.fk-oled { margin: 0; padding: 6px 8px; background: #05080c; color: #a8e4ff; font: 400 11px/14px var(--font-mono); letter-spacing: .02em; border-radius: 3px; border: 2px solid #1b2733; white-space: pre; overflow: hidden; box-shadow: inset 0 0 0 1px #000; }
.fk-oled.is-tall { font-size: 10.5px; line-height: 12px; }
.fk-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.fk-parts li { display: flex; align-items: center; gap: 2px; min-height: 30px; }
.fk-parts li .check { flex: 1 1 auto; min-width: 0; }
.fk-parts .fk-mv { width: 30px; height: 30px; }
.fk-parts .fk-mv svg { width: 15px; height: 15px; }
.fk-parts .fk-mv.is-down svg { transform: rotate(180deg); }
.fk-parts .fk-mv:disabled { opacity: .3; cursor: default; }
.fk-screen .note.is-warn { color: var(--warning); }
#mouse-presets .note { font-size: 12px; margin-right: 2px; }

/* ---------- Build: one line about the checks, the package, the steps ---------- */
.fk-ready { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-size: 13px; line-height: 20px; }
.fk-ready.is-err { color: var(--danger); }
.fk-ready.is-ok { color: var(--success); }
.fk-pkg { display: grid; gap: 12px; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-sunken); }
.fk-pkg-h .help-dot { margin-left: auto; align-self: start; }
.fk-pkg-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.fk-mini { display: contents; }
.fk-mini .fk-sec-t { padding: 4px 0; font-size: 12.5px; color: var(--ink-muted); }
.fk-mini .fk-sec-t:hover { color: var(--ink); }
.fk-mini .fk-sec-b { flex-basis: 100%; padding: 0; }
.fk-steps-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 22px 0 10px; }
.fk-steps-h h4 { margin: 0; display: flex; align-items: center; gap: 6px; font: 700 13.5px/20px var(--font-ui); }
.fk-steps-h .note { font-size: 12px; }
.fk-steps { counter-reset: fk-step; list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 14px; font-size: 13px; line-height: 19px; }
.fk-steps li { counter-increment: fk-step; display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 10px; row-gap: 4px; }
.fk-steps li::before { content: counter(fk-step); grid-row: 1 / span 3; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); font: 700 11px/1 var(--font-mono); color: var(--ink-muted); }
.fk-steps li > * { grid-column: 2; min-width: 0; }
.fk-step-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-height: 22px; }
.fk-step-h b { font-size: 13.5px; }
.fk-steps p { margin: 0; color: var(--ink-muted); overflow-wrap: anywhere; }
.fk-cmd { margin-top: 2px; gap: 4px; }
.fk-cmd .tb-iconbtn { width: 30px; height: 30px; color: var(--ink-muted); }
.fk-cmd .tb-iconbtn:hover { color: var(--ink); }
.fk-cmd .tb-iconbtn svg { width: 16px; height: 16px; }
#sec-more { margin-top: 10px; }
.fk-viewer { padding-top: 6px; }

/* ---------- Images ---------- */
.fk-plain { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.fk-panel > .fk-plain:first-child { border-top: 0; }
.fk-plain .btn-row { align-items: center; }

/* bottom dock: the sections side by side */
.dock-bottom .tab-panel.fk-panel { column-gap: 28px; }
.dock-bottom .fk-panel > .fk-sec { border-top: 0; }
/* an open section shows its contents: its one-line summary is for when it's folded (counts stay) */
.fk-sec.is-open:not([data-keep]) > .fk-sec-h .fk-sec-s { visibility: hidden; }

/* ---------- QMK settings: the Extras group's heading; the chosen key's cards ---------- */
.fk-grp-h { margin: 18px 0 0; padding: 14px 0 2px; border-top: 1px solid var(--line-strong); font: 700 11px/16px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.fk-grp-h .note { text-transform: none; letter-spacing: 0; font-weight: 400; }
.fk-grp-h + .fk-sec { border-top: 0; }
.fk-ctxs { display: grid; gap: 6px; margin-top: 12px; }
.fk-ctxs[hidden] { display: none; }
.fk-ctx { border: 1px solid var(--line); border-radius: var(--radius-md); min-width: 0; }
.fk-ctx-h { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px; background: none; border: 0; border-radius: var(--radius-md); color: var(--ink); font: 700 12.5px/18px var(--font-ui); cursor: pointer; text-align: left; }
.fk-ctx-h:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.fk-ctx-h .fk-chev { width: 14px; height: 14px; flex: none; transition: transform .15s; color: var(--ink-muted); }
.fk-ctx-h[aria-expanded="true"] .fk-chev { transform: rotate(90deg); }
.fk-ctx-n { flex: none; }
.fk-ctx-s { flex: 1 1 auto; min-width: 0; text-align: right; font: 400 12px/18px var(--font-mono); color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fk-ctx-b { display: grid; gap: 8px; padding: 2px 10px 10px; min-width: 0; }
.fk-ctx-b[hidden] { display: none; }
.fk-ctx-b .note { font-size: 12px; line-height: 17px; margin: 0; }
.fk-ctx-b .check { font-size: 13px; line-height: 18px; align-items: flex-start; }
.fk-ctx-b .fk-link-btn { justify-self: start; margin: 0; padding: 2px 0; }
.fk-ctx.is-off .fk-ctx-n { color: var(--ink-muted); }
.fk-grp > .tb-label .note { text-transform: none; letter-spacing: 0; font-weight: 400; }
