/* SAT Solver Visualizer (/sat-solver): the status line, the decision trail of chips, the clause list (satisfied grey,
   false literals struck, the unit and the conflict clause outlined), the SVG figures (search tree, implication graph,
   the picture of the problem) and the model. Tiles, panels, buttons, legends and ranges come from the app kit
   (css/app-kit, docs/app-kit.md). Loaded only on this app's page. */

.sat-landing-app .sat-panel { display: flex; flex-direction: column; gap: var(--ak-space-2, 0.6rem); }

.sat-landing-app .sat-head { flex-wrap: wrap; gap: var(--ak-space-2, 0.5rem); }
.sat-landing-app .sat-source { margin: 0; flex: 1 1 14rem; min-width: 0; color: var(--ak-muted); font-size: var(--ak-fs-sm, 0.88rem); }
.sat-landing-app .sat-caption { margin: 0; color: var(--ak-muted); font-size: var(--ak-fs-sm, 0.88rem); }
.sat-landing-app .sat-empty { margin: 0; color: var(--ak-muted); font-size: var(--ak-fs-sm, 0.88rem); }

.sat-landing-app .sat-status { margin: 0; min-height: 3em; font-size: var(--ak-fs-sm, 0.92rem); line-height: 1.5; }
.sat-landing-app .sat-status[data-sat-event="conflict"] { color: var(--ak-danger); }
.sat-landing-app .sat-status[data-sat-event="sat"] { color: var(--ak-success); }
.sat-landing-app .sat-status[data-sat-event="unsat"] { color: var(--ak-danger); }
.sat-landing-app .sat-actions { display: flex; flex-wrap: wrap; gap: var(--ak-space-2, 0.5rem); }

.sat-landing-app .sat-result-tile[data-sat-result="sat"] { --ak-stat-color: var(--ak-success); }
.sat-landing-app .sat-result-tile[data-sat-result="unsat"] { --ak-stat-color: var(--ak-danger); }

/* ---- The decision trail: one row per level, one chip per assignment ---- */
.sat-landing-app .sat-trail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 11rem;
    overflow-y: auto;
    padding-right: 0.2rem;
}
.sat-landing-app .sat-level { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.sat-landing-app .sat-level-no {
    min-width: 1.4rem;
    text-align: center;
    color: var(--ak-muted);
    font-size: var(--ak-fs-xs, 0.75rem);
    font-variant-numeric: tabular-nums;
}
.sat-landing-app .sat-chip {
    display: inline-block;
    padding: 0.08rem 0.4rem;
    border: 1.5px solid transparent;
    border-radius: var(--ak-radius-sm, 5px);
    background: var(--ak-field);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--ak-fs-sm, 0.85rem);
    white-space: nowrap;
}
.sat-landing-app .sat-chip.is-decision { background: color-mix(in srgb, var(--ak-accent) 18%, var(--ak-panel)); border-color: var(--ak-accent); font-weight: 700; }
.sat-landing-app .sat-chip.is-unit { background: color-mix(in srgb, var(--ak-series-3) 14%, var(--ak-panel)); border-color: color-mix(in srgb, var(--ak-series-3) 55%, transparent); }
.sat-landing-app .sat-chip.is-pure { background: color-mix(in srgb, var(--ak-series-4) 14%, var(--ak-panel)); border-color: color-mix(in srgb, var(--ak-series-4) 55%, transparent); }
.sat-landing-app .sat-chip.is-flip { background: color-mix(in srgb, var(--ak-warning) 18%, var(--ak-panel)); border: 1.5px dashed var(--ak-warning); font-weight: 700; }
.sat-landing-app .sat-chip.is-learned { background: color-mix(in srgb, var(--ak-info) 16%, var(--ak-panel)); border-color: color-mix(in srgb, var(--ak-info) 55%, transparent); }
.sat-landing-app .sat-chip.is-last { outline: 2px solid var(--ak-text); outline-offset: 1px; }
.sat-landing-app .sat-chip--more { border: none; background: none; color: var(--ak-muted); }

.sat-landing-app .sat-sw { border: 1.5px solid transparent; }
.sat-landing-app .sat-sw--decision { background: color-mix(in srgb, var(--ak-accent) 18%, var(--ak-panel)); border-color: var(--ak-accent); }
.sat-landing-app .sat-sw--unit { background: color-mix(in srgb, var(--ak-series-3) 14%, var(--ak-panel)); border-color: color-mix(in srgb, var(--ak-series-3) 55%, transparent); }
.sat-landing-app .sat-sw--pure { background: color-mix(in srgb, var(--ak-series-4) 14%, var(--ak-panel)); border-color: color-mix(in srgb, var(--ak-series-4) 55%, transparent); }
.sat-landing-app .sat-sw--flip { background: color-mix(in srgb, var(--ak-warning) 18%, var(--ak-panel)); border: 1.5px dashed var(--ak-warning); }
.sat-landing-app .sat-sw--learned { background: color-mix(in srgb, var(--ak-info) 16%, var(--ak-panel)); border-color: color-mix(in srgb, var(--ak-info) 55%, transparent); }

/* ---- The clause list ---- */
.sat-landing-app .sat-clauses {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    max-height: 19rem;
    overflow-y: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--ak-fs-sm, 0.86rem);
    line-height: 1.55;
}
.sat-landing-app .sat-clauses--learned { max-height: 9rem; }
.sat-landing-app .sat-clause {
    padding: 0.05rem 0.35rem;
    border: 1.5px solid transparent;
    border-radius: var(--ak-radius-sm, 5px);
    overflow-wrap: anywhere;
}
.sat-landing-app .sat-clause.is-sat { color: var(--ak-muted); opacity: 0.6; }
.sat-landing-app .sat-clause.is-unit { background: color-mix(in srgb, var(--ak-series-3) 12%, transparent); border-color: color-mix(in srgb, var(--ak-series-3) 60%, transparent); }
.sat-landing-app .sat-clause.is-conflict { background: color-mix(in srgb, var(--ak-danger) 14%, transparent); border-color: var(--ak-danger); }
.sat-landing-app .sat-clause.is-hot { outline: 2px solid var(--ak-text); outline-offset: 1px; }
.sat-landing-app .sat-clause--more { color: var(--ak-muted); }
.sat-landing-app .sat-clauses.is-open-only .sat-clause.is-sat { display: none; }
.sat-landing-app .sat-no {
    display: inline-block;
    min-width: 2.4em;
    margin-right: 0.3rem;
    color: var(--ak-muted);
    font-size: var(--ak-fs-xs, 0.76rem);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.sat-landing-app .sat-lit.is-true { color: var(--ak-success); font-weight: 700; }
.sat-landing-app .sat-lit.is-false { text-decoration: line-through; opacity: 0.65; }

.sat-landing-app .sat-defs > summary { cursor: pointer; color: var(--ak-muted); font-size: var(--ak-fs-sm, 0.88rem); }
.sat-landing-app .sat-deflist {
    margin: 0.35rem 0 0;
    padding: 0;
    list-style: none;
    max-height: 9rem;
    overflow-y: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--ak-fs-sm, 0.84rem);
}
.sat-landing-app .sat-learned-box { display: flex; flex-direction: column; gap: 0.25rem; }

/* ---- The figures: the search tree, the implication graph and the picture of the problem ---- */
.sat-landing-app .sat-figure { overflow-x: auto; overflow-y: hidden; padding-bottom: 0.2rem; direction: ltr; }
.sat-landing-app .sat-figure svg { display: block; }
.sat-landing-app .sat-picture { display: flex; justify-content: center; overflow-x: auto; direction: ltr; }
.sat-landing-app .sat-picture svg { display: block; max-width: 100%; height: auto; }
.sat-landing-app .sat-graph-text { line-height: 1.55; }

/* ---- The result ---- */
.sat-landing-app .sat-verdict { margin: 0; flex: 1 1 auto; font-size: var(--ak-fs-lg, 1.1rem); font-weight: 700; }
.sat-landing-app .sat-verdict.is-sat { color: var(--ak-success); }
.sat-landing-app .sat-verdict.is-unsat { color: var(--ak-danger); }
.sat-landing-app .sat-model {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    max-height: 12rem;
    overflow-y: auto;
}
.sat-landing-app .sat-assign {
    padding: 0.08rem 0.4rem;
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-sm, 5px);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--ak-fs-sm, 0.85rem);
    white-space: nowrap;
}
.sat-landing-app .sat-assign.is-on { background: color-mix(in srgb, var(--ak-success) 14%, transparent); border-color: color-mix(in srgb, var(--ak-success) 55%, transparent); }
.sat-landing-app .sat-assign.is-free { color: var(--ak-muted); border-style: dashed; }
.sat-landing-app .sat-assign.is-aux { opacity: 0.7; }
.sat-landing-app .sat-ok { color: var(--ak-success); }
.sat-landing-app .sat-ok::before { content: "✓ "; }
.sat-landing-app .sat-bad { color: var(--ak-danger); }

/* ---- The controls ---- */
.sat-landing-app .sat-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--ak-fs-sm, 0.85rem);
    resize: vertical;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}
.sat-landing-app .sat-keys { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.sat-landing-app .sat-key { min-width: 2.2rem; padding-left: 0.4rem; padding-right: 0.4rem; }
