/* Huffman Coding Builder (/huffman-coding-builder): the SVG tree (leaves, inner nodes, 0/1 edges, the step's new
   node and the selected path), the code column and the bit stream. Tiles, panels, tables and buttons come from the
   app kit (css/app-kit, docs/app-kit.md). Loaded only on this app's page (StylePaths). */

.hc-landing-app .hc-panel { display: flex; flex-direction: column; gap: var(--ak-space-2, 0.6rem); }

.hc-landing-app .hc-tree { overflow-x: auto; overflow-y: hidden; padding-bottom: 0.2rem; }
.hc-landing-app .hc-tree svg { display: block; margin: 0 auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.hc-landing-app .hc-edge { stroke: color-mix(in srgb, var(--ak-muted) 60%, transparent); stroke-width: 1.6; }
.hc-landing-app .hc-edge.is-path { stroke: var(--ak-accent); stroke-width: 3; }
.hc-landing-app .hc-bit { font-size: 11px; font-weight: 700; fill: var(--ak-muted); }
.hc-landing-app .hc-bit.is-path { fill: var(--ak-accent); }

.hc-landing-app .hc-leaf rect { fill: color-mix(in srgb, var(--ak-accent) 14%, var(--ak-field)); stroke: var(--ak-accent); stroke-width: 1.5; }
.hc-landing-app .hc-leaf { cursor: pointer; outline: none; }
.hc-landing-app .hc-leaf:focus-visible rect { stroke-width: 3; }
.hc-landing-app .hc-sym { font-size: 14px; font-weight: 700; fill: var(--ak-text); }
.hc-landing-app .hc-count { font-size: 10.5px; fill: var(--ak-muted); }

.hc-landing-app .hc-inner circle { fill: var(--ak-panel); stroke: color-mix(in srgb, var(--ak-muted) 70%, transparent); stroke-width: 1.5; }
.hc-landing-app .hc-weight { font-size: 11px; font-weight: 600; fill: var(--ak-text); }

.hc-landing-app .is-new circle { fill: var(--ak-success); stroke: var(--ak-success); }
.hc-landing-app .is-new .hc-weight { fill: #fff; }
.hc-landing-app .is-joined rect,
.hc-landing-app .is-joined circle { stroke: var(--ak-success); stroke-width: 3; }
.hc-landing-app .hc-leaf.is-path rect { fill: var(--ak-accent); }
.hc-landing-app .hc-leaf.is-path .hc-sym { fill: var(--ak-on-accent, #fff); }
.hc-landing-app .hc-inner.is-path circle { stroke: var(--ak-accent); stroke-width: 3; }

.hc-landing-app .hc-status { margin: 0; }
.hc-landing-app .hc-actions { display: flex; flex-wrap: wrap; gap: var(--ak-space-2, 0.5rem); }

.hc-landing-app .hc-table tbody tr { cursor: pointer; }
.hc-landing-app .hc-tsym { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; }
.hc-landing-app .hc-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.06em; color: var(--ak-accent); font-weight: 600; }

.hc-landing-app .hc-bits {
    margin: 0;
    max-height: 14rem;
    overflow-y: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--ak-fs-sm, 0.88rem);
    line-height: 1.7;
    overflow-wrap: anywhere;
    word-break: break-all;
}
.hc-landing-app .hc-seg { cursor: pointer; border-radius: 3px; }
.hc-landing-app .hc-seg.is-odd { background: color-mix(in srgb, var(--ak-muted) 16%, transparent); }
.hc-landing-app .hc-seg.is-selected { background: var(--ak-accent); color: var(--ak-on-accent, #fff); }

.hc-landing-app .hc-check { margin: 0; font-size: var(--ak-fs-sm, 0.88rem); font-weight: 600; color: var(--ak-success); }
.hc-landing-app .hc-check::before { content: "✓ "; }
.hc-landing-app .hc-check.is-bad { color: var(--ak-danger); }
.hc-landing-app .hc-check.is-bad::before { content: "✗ "; }

.hc-landing-app .hc-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
