/* Карточка схемы к SQL-заданию «Проверь себя». Шапки таблиц того же цвета,
   что у таблиц результатов в теме. */
.quiz-schema {
    margin: -4px 0 20px;
}

.quiz-schema-label {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #64748b;
}

.quiz-schema-map {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px 40px;
    margin-bottom: 18px;
}

.quiz-schema-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: visible;
    pointer-events: none;
}

.quiz-schema-line {
    fill: none;
    stroke: #94a3b8;
    stroke-width: 1.5;
    transition: stroke .15s ease;
}

.quiz-schema-line-end {
    fill: #94a3b8;
    transition: fill .15s ease;
}

.quiz-schema-line.is-active {
    stroke: #7c3aed;
    stroke-width: 2;
}

.quiz-schema-line-end.is-active {
    fill: #7c3aed;
}

.quiz-schema-table {
    position: relative;
    z-index: 1;
    min-width: 170px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    font-size: 13px;
}

.quiz-schema-table-name {
    padding: 6px 12px;
    background: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    color: #0f172a;
}

.quiz-schema-columns {
    margin: 0;
    padding: 4px 0;
    list-style: none;
}

.quiz-schema-column {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    align-items: center;
    gap: 6px;
    padding: 2px 12px 2px 8px;
    line-height: 20px;
    transition: background-color .15s ease;
}

.quiz-schema-column.is-active {
    background: #ede9fe;
}

.quiz-schema-key {
    font-size: 10px;
    font-weight: 700;
    color: #b45309;
}

.quiz-schema-column.is-fk .quiz-schema-key {
    color: #7c3aed;
}

.quiz-schema-column-name {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #1e293b;
}

.quiz-schema-column-type {
    font-size: 12px;
    color: #94a3b8;
}

.quiz-schema-result {
    max-width: 100%;
    overflow-x: auto;
}

.quiz-schema-instruction {
    margin: 20px 0 0;
}

.quiz-schema-result table {
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
}

.quiz-schema-result th {
    padding: 6px 14px;
    background: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    text-align: left;
    color: #0f172a;
}

.quiz-schema-result th {
    vertical-align: top;
}

.quiz-schema-result-name {
    display: block;
}

/* Пояснение автора к столбцу: смысл значения, а не формула. */
.quiz-schema-result-note {
    display: block;
    max-width: 220px;
    margin-top: 2px;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    color: #64748b;
}

.dark .quiz-schema-result-note {
    color: #94a3b8;
}

.quiz-schema-result td {
    padding: 4px 14px;
    background: #ffffff;
    color: #94a3b8;
}

.quiz-schema-result th + th,
.quiz-schema-result td + td {
    border-left: 1px solid #cbd5e1;
}

.dark .quiz-schema-table,
.dark .quiz-schema-result table {
    border-color: #334155;
    background: #0f172a;
}

.dark .quiz-schema-table-name,
.dark .quiz-schema-result th {
    background: #1e293b;
    color: #e2e8f0;
}

.dark .quiz-schema-result td {
    background: #0f172a;
    color: #64748b;
}

.dark .quiz-schema-result th + th,
.dark .quiz-schema-result td + td {
    border-left-color: #334155;
}

.dark .quiz-schema-column-name {
    color: #e2e8f0;
}

.dark .quiz-schema-column-type {
    color: #64748b;
}

.dark .quiz-schema-column.is-active {
    background: rgba(124, 58, 237, .22);
}

.dark .quiz-schema-key {
    color: #fbbf24;
}

.dark .quiz-schema-column.is-fk .quiz-schema-key {
    color: #a78bfa;
}

.dark .quiz-schema-line {
    stroke: #475569;
}

.dark .quiz-schema-line-end {
    fill: #475569;
}

.dark .quiz-schema-line.is-active {
    stroke: #a78bfa;
}

.dark .quiz-schema-line-end.is-active {
    fill: #a78bfa;
}

/* На узком экране таблицы стоят одна под другой, и линии ключей идут по полосам слева от
   них – у каждой линии своя полоса. Отступ оставляет место под эти полосы, иначе дальние
   полосы уходят за край карточки. */
@media (max-width: 620px) {
    .quiz-schema-map {
        padding-left: 20px;
    }
}
