/* ── Alg sheets page (sheets.html). Builds on learn.css ─────────────────── */

.sheets .deck-card {
    gap: var(--sp-3);
}

.section-title {
    font-size: var(--fs-lg);
    font-weight: 600;
}

/* Your sheets */

.sheet-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sheet-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-3);
    padding: 8px;
    border-radius: var(--r-sm);
}

.sheet-row:hover {
    background: var(--surface-2);
}

.sheet-row.is-off .sheet-info {
    opacity: 0.55;
}

.sheet-toggle {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.sheet-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 200px;
}

.sheet-name {
    font-weight: 600;
}

.sheet-meta {
    color: var(--text-3);
    font-size: var(--fs-xs);
}

.sheet-meta a {
    color: var(--accent-text);
}

.sheet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

/* Add a sheet */

.source-tabs {
    display: inline-flex;
    align-self: flex-start;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
}

.source-tab {
    height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-2);
    font: 500 var(--fs-sm) var(--font-sans);
    cursor: pointer;
}

.source-tab[aria-selected="true"] {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}

.source-tab:focus-visible,
.chip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.source-panel[hidden] {
    display: none;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: var(--fs-sm);
    font-weight: 500;
}

.field .input {
    width: 100%;
}

.field-inline {
    flex-direction: row;
    align-items: center;
}

.field-inline .input {
    width: auto;
    min-width: 160px;
}

.textarea {
    height: auto;
    padding: var(--sp-2);
    font-family: var(--font-mono);
    line-height: 1.5;
    resize: vertical;
}

.add-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
}

.add-status {
    color: var(--text-2);
    font-size: var(--fs-sm);
}

.add-status.is-error {
    color: var(--bad);
}

/* Checker report */

#report {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    padding-top: var(--sp-2);
}

#report[hidden] {
    display: none;
}

.report-summary {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-4);
    font-size: var(--fs-sm);
}

.stat b {
    font-variant-numeric: tabular-nums;
}

.stat-ok b { color: var(--good); }
.stat-warn b { color: var(--warn); }
.stat-bad b { color: var(--bad); }

.report-filter {
    display: flex;
    gap: 4px;
}

.chip {
    height: 26px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    color: var(--text-2);
    font: 500 var(--fs-xs) var(--font-sans);
    cursor: pointer;
}

.chip[aria-pressed="true"] {
    background: var(--accent-soft);
    color: var(--accent-text);
}

.report-table-wrap {
    max-height: 380px;
    overflow: auto;
    border-radius: var(--r-sm);
    background: var(--surface-2);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-xs);
}

.report-table th {
    position: sticky;
    top: 0;
    padding: 6px 8px;
    background: var(--surface-3);
    color: var(--text-2);
    font-weight: 600;
    text-align: left;
}

.report-table td {
    padding: 5px 8px;
    border-top: 1px solid var(--line);
    vertical-align: top;
}

.report-table .alg-cell {
    font-family: var(--font-mono);
    word-break: break-word;
}

.report-table tr.is-mismatch td:last-child { color: var(--warn); }
.report-table tr.is-bad td:last-child { color: var(--bad); }

.report-empty {
    color: var(--text-3);
    text-align: center;
}

.save-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-3);
}

/* Export */

.export-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-4);
}

.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-sm);
}

.check-inline input {
    accent-color: var(--accent);
}

@media (max-width: 640px) {
    .field-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .field-inline .input {
        width: 100%;
    }
}
