/* electio2D: страница элекций. База и формы — в base.css,
 * шапка/подвал — в fragments.css. Здесь только сетка страницы и карточки. */

/* base.css ставит `body * { margin: 0 auto }`: в карточках и списках это
 * центрирует блоки по горизонтали (flex-элемент перестаёт растягиваться).
 * Гасим авто-поля только по бокам внутри страницы. */
.el-wrap section,
.el-wrap article,
.el-wrap div,
.el-wrap ul,
.el-wrap ol,
.el-wrap li,
.el-wrap p,
.el-wrap h1,
.el-wrap h2,
.el-wrap h3,
.el-wrap h4,
.el-wrap form,
.el-wrap fieldset,
.el-wrap details,
.el-wrap summary,
.el-wrap label,
.el-wrap span,
.el-wrap button,
.el-wrap a {
    margin-left: 0;
    margin-right: 0;
}

.el-wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 12px 14px 32px;
    box-sizing: border-box;
    text-align: left;
}

.el-wrap h1 {
    font-size: 1.55rem;
    line-height: 1.25;
    margin: 6px 0 8px;
}

.el-lead {
    margin: 0 0 18px;
    opacity: 0.85;
    line-height: 1.5;
    max-width: 78ch;
}

.el-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
}

.el-presets {
    border: 1px solid rgba(128, 128, 128, 0.28);
    border-radius: 12px;
    padding: 10px 12px 12px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Настройки выдачи: рамка как у блока события, но содержимое — одна строка
   полей; на узком экране .el-row переносит их сам. */
.el-prefs {
    border: 1px solid rgba(128, 128, 128, 0.22);
    border-radius: 12px;
    padding: 8px 12px 12px;
    margin: 0;
    /* base.css ограничивает fieldset 600px (панели базы карт); настройкам
       выдачи нужна вся ширина, иначе пять полей уезжают на вторую строку. */
    max-width: none;
}

/* Поле даты: нативное «ДД.ММ.ГГГГ» + иконка календаря не влезают в 130px. */
.el-field-date {
    flex: 0 0 168px;
}

.el-prefs legend {
    padding: 0 6px;
    font-weight: 600;
    opacity: 0.9;
}

.el-prefs legend em {
    font-style: normal;
    font-weight: 400;
    opacity: 0.65;
}

.el-presets legend {
    padding: 0 6px;
    font-weight: 600;
    opacity: 0.9;
}

.el-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.el-chip {
    border: 1px solid rgba(128, 128, 128, 0.35);
    background: transparent;
    color: inherit;
    border-radius: 999px;
    padding: 5px 12px;
    font: inherit;
    font-size: 0.92rem;
    cursor: pointer;
}

.el-chip:hover {
    border-color: var(--violet-light, #A138FC);
}

.el-chip.active {
    background: var(--violet, #8900FF);
    border-color: var(--violet, #8900FF);
    color: #fff;
}

.el-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.el-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 180px;
    min-width: 0;
}

.el-field-wide {
    flex-basis: 100%;
}

.el-field-narrow {
    flex: 0 0 130px;
}

.el-field-city {
    flex: 1 1 240px;
}

.el-field > span {
    font-size: 0.85rem;
    opacity: 0.8;
}

.el-field em {
    font-style: normal;
    opacity: 0.65;
}

.el-field input,
.el-field select,
.el-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 9px;
    border-radius: 8px;
    border: 1px solid rgba(128, 128, 128, 0.4);
    background: rgba(128, 128, 128, 0.08);
    color: inherit;
    font: inherit;
    font-size: 0.95rem;
}

.el-field textarea {
    resize: vertical;
}

.el-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid rgba(128, 128, 128, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    flex: 0 0 auto;
}

.el-hint {
    font-size: 0.9rem;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(137, 0, 255, 0.1);
    border: 1px solid rgba(137, 0, 255, 0.28);
}

.el-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--violet-light, #A138FC);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.el-natal {
    border: 1px solid rgba(128, 128, 128, 0.28);
    border-radius: 12px;
    padding: 10px 12px;
}

.el-natal summary {
    cursor: pointer;
    font-weight: 600;
}

.el-natal-label {
    font-weight: 400;
    opacity: 0.75;
}

.el-note {
    font-size: 0.86rem;
    opacity: 0.75;
    margin: 8px 0 10px;
    line-height: 1.45;
}

.el-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.el-btn {
    border: 1px solid rgba(128, 128, 128, 0.4);
    background: rgba(128, 128, 128, 0.1);
    color: inherit;
    border-radius: 8px;
    padding: 7px 14px;
    font: inherit;
    font-size: 0.92rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.el-btn:hover {
    border-color: var(--violet-light, #A138FC);
}

.el-btn-primary {
    background: var(--violet, #8900FF);
    border-color: var(--violet, #8900FF);
    color: #fff;
    font-weight: 600;
}

.el-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.el-status {
    font-size: 0.9rem;
    opacity: 0.85;
}

#elProgress {
    width: 100%;
    height: 8px;
}

.el-result h2 {
    font-size: 1.25rem;
    margin: 0 0 6px;
}

.el-summary {
    font-size: 0.88rem;
    opacity: 0.75;
    margin: 0 0 14px;
    line-height: 1.5;
}

.el-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.el-card {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(128, 128, 128, 0.3);
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(128, 128, 128, 0.05);
}

.el-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.el-when {
    font-weight: 600;
    font-size: 1.02rem;
}

.el-badge {
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid currentColor;
}

.el-badge.best { color: #38c172; }
.el-badge.good { color: #c9a227; }
.el-badge.weak { color: #b96a3b; }

.el-time {
    margin: 6px 0 10px;
    font-size: 0.92rem;
    opacity: 0.85;
}

.el-layers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}

.el-checks h4 {
    margin: 0 0 6px;
    font-size: 0.9rem;
    opacity: 0.85;
    font-weight: 600;
}

.el-checks ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.el-checks li {
    font-size: 0.88rem;
    line-height: 1.4;
    padding-left: 2px;
}

.el-checks li.ok { color: #48b46a; }
.el-checks li.bad { color: #d2645e; }
.el-checks li.neutral { opacity: 0.7; }

.el-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.el-chart-box {
    margin: 24px 0;
    border: 1px solid rgba(128, 128, 128, 0.28);
    border-radius: 12px;
    padding: 12px;
}

.el-chart-box h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

#elChart {
    width: 100%;
    min-height: 320px;
}

.el-debug {
    margin: 20px 0;
    font-size: 0.85rem;
}

.el-debug-text {
    max-height: 420px;
    overflow: auto;
    white-space: pre;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.35;
    padding: 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
}

.el-disclaimer {
    margin-top: 28px;
    font-size: 0.82rem;
    opacity: 0.65;
    line-height: 1.5;
    max-width: 80ch;
}

@media (max-width: 640px) {
    .el-wrap {
        padding: 10px 10px 24px;
    }

    .el-field-narrow {
        flex: 1 1 120px;
    }

    .el-field-date {
        flex: 1 1 150px;
    }

    .el-layers {
        grid-template-columns: 1fr;
    }
}

/* Оценка по дням: компактная полоса, клик — к окнам этого дня */
.el-heat {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding: 6px 0 10px;
    margin-bottom: 10px;
    scrollbar-width: thin;
}

.el-heat-day {
    flex: 0 0 auto;
    width: 26px;
    height: 36px;
    border-radius: 5px;
    border: 1px solid rgba(128, 128, 128, 0.25);
    background: rgba(128, 128, 128, 0.06);
    color: inherit;
    font: inherit;
    font-size: 0.68rem;
    padding: 2px 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    line-height: 1;
}

.el-heat-day span {
    opacity: 0.7;
    font-size: 0.62rem;
}

.el-heat-day.good {
    background: rgba(201, 162, 39, 0.22);
}

.el-heat-day.best {
    background: rgba(56, 193, 114, 0.28);
}

.el-heat-day.weak {
    background: rgba(185, 106, 59, 0.2);
}

.el-heat-day.has {
    border-color: rgba(137, 0, 255, 0.75);
    box-shadow: inset 0 -2px 0 rgba(137, 0, 255, 0.75);
}

.el-heat-day:hover {
    border-color: var(--violet-light, #A138FC);
}

/* ИИ-строка: те же кнопки, что на страницах расчёта */
.el-ai {
    margin: 2px 0 14px;
}

.el-ai .ci-ai-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 4px 0 6px;
}

.el-ai .ci-ai-row a,
.el-ai .ci-ai-row button {
    padding: 5px 12px;
    border: 1px solid rgba(128, 128, 128, 0.4);
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
    background: transparent;
    color: inherit;
    font-family: inherit;
}

.el-ai .ci-ai-row a:hover,
.el-ai .ci-ai-row button:hover {
    border-color: var(--violet-light, #A138FC);
}

.el-ai .ci-meta {
    font-size: 0.8rem;
    opacity: 0.7;
}

#elDumpPrompt,
#elDumpAnswer {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.78rem;
    min-height: 90px;
}

/* Блок элекций на transit2D: компактная форма и карточки в .work */
.el-emb {
    border: 1px solid rgba(128, 128, 128, 0.28);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 14px auto;
    text-align: left;
}

.el-emb > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
}

.el-emb .el-chips {
    margin: 10px 0;
}

.el-emb .el-field {
    margin: 6px 0;
}

.el-emb .el-field input,
.el-emb .el-field select {
    font-size: 0.9rem;
    padding: 6px 8px;
}

.el-emb .el-list {
    margin-top: 12px;
}

.el-emb-card details summary {
    cursor: pointer;
    font-size: 0.86rem;
    opacity: 0.85;
    margin: 4px 0 6px;
}

.el-emb .el-checks h4 {
    font-size: 0.85rem;
}

.el-emb .el-checks li {
    font-size: 0.84rem;
}

/* base.css/radix2D.css ставят `body * { margin: 0 auto }` — гасим авто-поля
   по бокам, иначе карточки и списки центрируются по горизонтали. */
.el-emb section,
.el-emb article,
.el-emb div,
.el-emb ul,
.el-emb li,
.el-emb p,
.el-emb form,
.el-emb label,
.el-emb span,
.el-emb button,
.el-emb a,
.el-emb details,
.el-emb summary {
    margin-left: 0;
    margin-right: 0;
}
