/* Logic Circuit Simulator (/logic-circuit-simulator): the row of parts to add, the board (a canvas you drag on) with
   its zoom buttons, the inputs and outputs under it, and the truth table with the formulas. Tiles, panels, chips,
   tags, tables and buttons come from the app kit (css/app-kit, docs/app-kit.md). Loaded only on this app's page. */

.lc-landing-app .lc-board { display: flex; flex-direction: column; gap: var(--ak-space-3, 1rem); }
.lc-landing-app .lc-palette { justify-content: center; }
.lc-landing-app .lc-palette .ak-chip > .ak-icon { width: 0.9em; height: 0.9em; }

.lc-landing-app .lc-canvas-wrap { position: relative; }
.lc-landing-app .lc-canvas {
    display: block;
    width: 100%;
    height: 440px;
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-sm, 8px);
    background: var(--ak-bg);
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}
.lc-landing-app .lc-canvas:focus-visible { outline: 2px solid var(--ak-accent); outline-offset: 2px; }
@media (max-width: 640px) { .lc-landing-app .lc-canvas { height: 340px; } }
.lc-landing-app .lc-zoom { position: absolute; top: 0.5rem; inset-inline-end: 0.5rem; display: flex; gap: 0.25rem; }

/* The inputs as switches (also for the keyboard) and the outputs as values. */
.lc-landing-app .lc-io { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.4rem; min-height: 1.85rem; }
.lc-landing-app .lc-io b { font-family: var(--ak-font-mono, ui-monospace, Menlo, Consolas, monospace); font-size: 1.05em; }
.lc-landing-app .lc-io .ak-tag { gap: 0.35rem; padding: 0.25rem 0.6rem; --ak-tag: var(--ak-muted); }
.lc-landing-app .lc-io .ak-tag.is-on { --ak-tag: var(--ak-success); }
.ak-app.lc-landing-app > .filter-landing-stage .lc-io .lc-in[aria-pressed="true"] { border-color: var(--ak-success); background: var(--ak-success); color: #ffffff; }
.ak-app.lc-landing-app > .filter-landing-stage .lc-io .lc-in[aria-pressed="false"] { border-color: var(--ak-border); background: var(--ak-panel); color: var(--ak-text); }

.lc-landing-app .lc-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ak-space-2, 0.5rem); }
.lc-landing-app .lc-actions .ak-btn { justify-content: center; min-width: 0; white-space: normal; text-align: center; }
@media (max-width: 640px) { .lc-landing-app .lc-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lc-landing-app .lc-actions .ak-btn[hidden] { display: none; }

/* The truth table: one narrow column per input and output, the row of the present inputs marked. */
.lc-landing-app .lc-table-panel { display: flex; flex-direction: column; gap: var(--ak-space-2, 0.5rem); }
.lc-landing-app .lc-formulas { display: flex; flex-direction: column; gap: 0.15rem; margin: 0; padding: 0; list-style: none; font-size: var(--ak-fs-sm, 0.875rem); color: var(--ak-text); overflow-wrap: anywhere; }
.lc-landing-app .lc-formulas:empty { display: none; }
.lc-landing-app .lc-table-wrap { width: fit-content; max-width: 100%; }
.lc-landing-app .lc-table th, .lc-landing-app .lc-table td { min-width: 3.4rem; text-align: center; font-variant-numeric: tabular-nums; }
.lc-landing-app .lc-table .lc-first-out { border-inline-start: 2px solid var(--ak-border); }
.lc-landing-app .lc-table tbody tr { cursor: pointer; }
.lc-landing-app .lc-table tbody tr.ak-strong { background: color-mix(in srgb, var(--ak-accent) 16%, transparent); }
.lc-landing-app .lc-table tbody tr:focus-visible { outline: 2px solid var(--ak-accent); outline-offset: -2px; }
.lc-landing-app .lc-table .lc-bit { color: var(--ak-muted); }
.lc-landing-app .lc-table .lc-bit.is-on { color: var(--ak-success); font-weight: 700; }
.lc-landing-app .lc-note { margin: 0; }
.lc-landing-app .ak-panel-head[hidden] { display: none; }
