/* Euler Path Finder (/euler-path-finder): the board you trace on, the status line (with its tones: warning, stuck,
   done, solver), the action rows, the degree chips, the three cases of the degree rule and the edges to add. Tiles,
   panels, buttons and the segmented controls come from the app kit (css/app-kit, docs/app-kit.md). Loaded only on
   this app's page (StylePaths). */

.epf-app .epf-panel { display: flex; flex-direction: column; gap: var(--ak-space-2, 0.6rem); min-width: 0; }
.epf-app .epf-story { display: block; }
.epf-app .epf-story[hidden] { display: none; }

.epf-app .epf-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--ak-space-2) var(--ak-space-3);
}

/* The status line: what to do next, what went wrong, or the solver's step. */
.epf-app .epf-say {
    margin: 0;
    min-height: 2.9rem;
    padding: var(--ak-space-2, 0.5rem) var(--ak-space-3, 0.75rem);
    border: 1px solid var(--ak-border);
    border-inline-start: 4px solid var(--ak-accent);
    border-radius: var(--ak-radius-sm, 8px);
    background: var(--ak-field);
    color: var(--ak-text);
    font-size: var(--ak-fs-sm, 0.9rem);
    line-height: 1.45;
}
.epf-app .epf-say[data-tone="warning"] { border-inline-start-color: var(--ak-warning); background: color-mix(in srgb, var(--ak-warning) 8%, var(--ak-field)); }
.epf-app .epf-say[data-tone="danger"] { border-inline-start-color: var(--ak-danger); background: color-mix(in srgb, var(--ak-danger) 8%, var(--ak-field)); }
.epf-app .epf-say[data-tone="success"] { border-inline-start-color: var(--ak-success); background: color-mix(in srgb, var(--ak-success) 10%, var(--ak-field)); font-weight: 600; }
.epf-app .epf-say[data-tone="info"] { border-inline-start-color: var(--ak-info); }

.epf-app .epf-board { border-radius: var(--ak-radius-sm); }
.epf-app .epf-board:focus-visible { outline: 2px solid var(--ak-accent); outline-offset: 3px; }
.epf-app .epf-board.is-won { box-shadow: 0 0 0 2px var(--ak-success); }

/* The board is 4:3, like the drawing area in the script, so a figure keeps its shape on every screen. */
.epf-app .epf-chart {
    max-width: 760px;
    height: auto;
    aspect-ratio: 4 / 3;
    margin-inline: auto;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.epf-app .epf-actions { flex-wrap: wrap; }
.epf-app .epf-actions[hidden] { display: none; }

/* The degree of every vertex, odd ones marked. */
.epf-app .epf-degrees {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.epf-app .epf-deg {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    border: 1px solid var(--ak-border);
    border-radius: 999px;
    background: var(--ak-field);
    font-variant-numeric: tabular-nums;
}
.epf-app .epf-deg-v { font-weight: 700; }
.epf-app .epf-deg-d { color: var(--ak-muted); }
.epf-app .epf-deg.is-odd { border-color: var(--ak-warning); background: color-mix(in srgb, var(--ak-warning) 14%, var(--ak-field)); }
.epf-app .epf-deg.is-odd .epf-deg-d { color: var(--ak-text); font-weight: 700; }
.epf-app .epf-deg.is-zero { opacity: 0.6; }

/* The three cases of the degree rule; the one that applies stands out. */
.epf-app .epf-rules {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ak-space-2, 0.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
}
.epf-app .epf-rules li {
    padding: var(--ak-space-2, 0.5rem) var(--ak-space-3, 0.75rem);
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-sm, 8px);
    color: var(--ak-muted);
    font-size: var(--ak-fs-sm, 0.88rem);
    line-height: 1.35;
}
.epf-app .epf-rules li.is-on {
    border-color: var(--ak-accent);
    box-shadow: inset 0 0 0 1px var(--ak-accent);
    color: var(--ak-text);
    font-weight: 600;
}
.epf-app .epf-rules li[data-epf-rule="more"].is-on { border-color: var(--ak-danger); box-shadow: inset 0 0 0 1px var(--ak-danger); }

/* The edges that would make the figure drawable. */
.epf-app .epf-fix { display: flex; flex-direction: column; gap: 0.4rem; }
.epf-app .epf-fix[hidden] { display: none; }
.epf-app .epf-fix-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin: 0;
    font-size: var(--ak-fs-sm, 0.9rem);
}
.epf-app .epf-fix-line strong { font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
    .epf-app .epf-rules { grid-template-columns: minmax(0, 1fr); }
}
