.linear-system-input-mode {
    color: #334155;
    line-height: 1.5;
}

.linear-system-ab {
    display: block;
}

.linear-system-mode-tabs {
    flex-wrap: wrap;
}

.linear-system-mode-tabs button {
    white-space: normal;
}

.linear-system-mode-tabs button[aria-selected="true"] {
    box-shadow: 0 6px 14px rgba(11, 105, 255, 0.18);
}

.linear-system-input-mode [hidden],
#matrix-area-b[hidden],
.swap-mid-col[hidden] {
    display: none;
}

.linear-system-ab-title {
    color: #111827;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.linear-system-ab-text {
    margin: 4px 0;
}

.linear-system-ab-status {
    background: #f8fafc;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 10px;
    color: #334155;
    font-size: 0.95rem;
    margin-top: 10px;
    padding: 10px 12px;
}

.linear-system-ab-status.is-ready {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.28);
}

.linear-system-ab-status.is-error {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.35);
}

.linear-system-ab-dims {
    font-weight: 800;
}

.linear-system-ab-message,
.linear-system-ab-help {
    margin-top: 4px;
}

.linear-system-ab-help {
    color: #64748b;
    font-size: 0.9rem;
}

.linear-system-ab-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.linear-system-ab-solve {
    background: #2563eb;
    border: 0;
    border-radius: 12px;
    color: #ffffff;
    cursor: pointer;
    font-weight: 800;
    padding: 10px 14px;
}

.linear-system-ab-solve:hover {
    background: #1d4ed8;
}

.linear-system-ab-solve:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.32);
    outline-offset: 2px;
}

.linear-system-augmented {
    color: #334155;
}

.linear-system-augmented-status .linear-system-ab-message {
    line-height: 1.4;
}

#matrix-container-a .matrix input.linear-system-augmented-divider {
    border-left: 3px solid rgba(15, 23, 42, 0.45);
    background: #f8fafc;
}

#matrix-container-a .matrix input.linear-system-augmented-divider:focus {
    border-left-color: #0b69ff;
}

.linear-system-ab-result-error {
    background: #ffffff;
    border: 1px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 8px 22px rgba(245, 158, 11, 0.08);
}

.linear-system-ab-result-error .result-top-controls {
    align-items: center;
}

.linear-system-ab-result-marker,
.linear-system-ab-result-status {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 999px;
    color: #92400e;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 4px 10px;
}

.linear-system-ab-result-body {
    color: #1f2937;
    display: grid;
    gap: 10px;
    padding: 4px 2px 2px;
}

.linear-system-ab-result-title {
    color: #111827;
    font-size: 1.15rem;
    margin: 0;
}

.linear-system-ab-not-calculated,
.linear-system-ab-result-next {
    margin: 0;
}

.linear-system-ab-not-calculated {
    font-weight: 700;
}

.linear-system-ab-result-reasons {
    margin: 0;
    padding-left: 20px;
}

.linear-system-ab-result-reasons div {
    margin: 0;
}

.linear-system-ab-result-dimensions {
    background: #fffbeb;
    border: 1px solid rgba(245, 158, 11, 0.24);
    border-radius: 10px;
    display: grid;
    gap: 3px;
    padding: 10px 12px;
}

.linear-system-ab-result-dimensions-title {
    font-weight: 800;
}

.linear-system-ab-result-next {
    color: #475569;
}

@media (max-width: 640px) {
    .linear-system-ab-status {
        font-size: 0.9rem;
    }

    .linear-system-ab-solve {
        width: 100%;
    }

    .linear-system-ab-result-title {
        font-size: 1rem;
    }
}
