.layout {
    width: min(1280px, calc(100% - 48px));
}

.header {
    width: min(1440px, calc(100% - 48px));
    min-height: 104px;
    padding: 6px 0;
}

.site-logo {
    height: 90px;
    width: auto;
    max-width: 100%;
    display: block;
}

@media (max-width: 600px) {
    .site-logo {
        height: 68px;
    }
}

.intro {
    max-width: 700px;
}

.numeric-dashboard {
    margin: 0 0 24px;
}

.numeric-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 0 0 18px;
}

.numeric-title-row h2 {
    margin: 4px 0 0;
    font-size: 30px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.numeric-title-row .eyebrow {
    margin: 0;
}

.basis-badge {
    padding: 7px 12px;
    border: 1px solid #35435b;
    border-radius: 999px;
    color: #b3c6e8;
    background: #141c2b;
    font-size: 11px;
    white-space: nowrap;
}

.numeric-top-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.95fr) minmax(320px, 1.05fr);
    gap: 18px;
    margin-bottom: 18px;
}

.numeric-panel {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(145deg, #151b26, #10141d);
}

.numeric-panel h3 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: 0.01em;
}

.dashboard-matrix {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.dashboard-cell {
    min-height: 102px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border: 1px solid #3a4963;
    border-radius: 12px;
    background: #172235;
}

.cell-number {
    color: #9aabc6;
    font-size: 10px;
    line-height: 1;
}

.dashboard-cell strong {
    color: #e6eeff;
    font-size: clamp(22px, 2.4vw, 33px);
    font-weight: 650;
    line-height: 1.1;
    letter-spacing: 0.035em;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.cell-count {
    color: #9eafc9;
    font-size: 10px;
    line-height: 1.3;
}

.dashboard-cell.is-empty {
    border-color: #263044;
    background: #101620;
}

.dashboard-cell.is-empty strong {
    color: #58667e;
}

.dashboard-cell.is-empty .cell-count {
    color: #79859a;
}

.working-number-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.working-number-card {
    min-height: 117px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border: 1px solid #303c51;
    border-radius: 12px;
    background: #111a29;
}

.working-number-card span {
    color: #a4b2c8;
    font-size: 11px;
}

.working-number-card strong {
    font-size: 38px;
    font-weight: 600;
    line-height: 1;
    color: #c9d9ff;
    font-variant-numeric: tabular-nums;
}

.numeric-caption {
    margin: 16px 0 0;
    color: #95a4ba;
    font-size: 11px;
    line-height: 1.65;
}

.dashboard-lines {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 24px;
}

.dashboard-line-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 9px;
}

.dashboard-line-label span {
    color: #aebbd0;
    font-size: 11px;
}

.dashboard-line-label strong {
    color: #e5edfc;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.line-marks {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 4px;
}

.line-mark {
    height: 5px;
    border-radius: 2px;
    background: #283246;
}

.line-mark.is-filled {
    background: #a8c2f4;
}

.tools-raised {
    padding: 20px 22px;
    margin-bottom: 28px;
}

.tools-raised h2 {
    font-size: 18px;
    margin-bottom: 14px;
}

.tool-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.tool-jump {
    min-height: 48px;
    padding: 9px 15px;
    border: 1px solid var(--line, #232b36);
    background: var(--ink-2, #171d26);
    color: var(--ivory, #edeae3);
    font-size: 14px;
}

.tool-jump:hover:not(:disabled) {
    background: var(--ink-1, #11161d);
    border-color: var(--platinum, #94a3b8);
}

.tools-raised details {
    padding: 13px 0;
    scroll-margin-top: 20px;
}

.tools-raised summary {
    color: var(--ivory, #edeae3);
    font-size: 15px;
}

.consultation-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 14px;
}

.consultation-heading h2 {
    margin: 0;
    font-size: 22px;
}

.consultation-heading p {
    margin: 0;
    color: #99a9c1;
    font-size: 12px;
}

/* Лента сообщений не обрезается: растёт по содержимому и
   прокручивается общим скроллом страницы. */
#messages {
    height: auto;
    max-height: none;
    min-height: 280px;
    overflow: visible;
    padding-bottom: 40px;
}

.message-assistant {
    max-width: 100%;
    background: var(--ink-2, #171d26);
    border-color: var(--line, #232b36);
}

.message-content {
    line-height: 1.7;
    font-size: 16px;
    color: var(--ivory, #edeae3);
}

.message-author {
    color: var(--ivory-2, #a8adb5);
}

/* Паспорт: списки из "- " / "• " и **жирный** -> <strong> (dashboard.js
   textBlocks). Светлый акцент на выделенном тексте, аккуратные отступы. */
.full-block,
.periods-ai-text {
    line-height: 1.7;
}

.full-block p,
.periods-ai-text p,
.full-block li,
.periods-ai-text li {
    margin: 0 0 14px;
}

.passport-list {
    margin: 0 0 14px;
    padding-left: 22px;
}

.passport-list li {
    margin: 0 0 8px;
}

.full-block strong,
.periods-ai-text strong {
    color: #f4f4f5;
}

/* Таймер сессии «Сессия: 45:00» не должен перекрывать заголовок
   «Персональный Паспорт психоматрицы» на мобильных экранах. */
@media (max-width: 767px) {
    #passportRoot > h2 {
        padding-top: 34px;
    }

    .full-block p,
    .periods-ai-text p,
    .full-block li,
    .periods-ai-text li,
    .passport-list li {
        font-size: 14.5px;
        line-height: 1.55;
        margin-bottom: 10px;
    }
}

.live-graph-panel {
    margin-top: 22px;
    padding: 20px;
    border: 1px solid var(--line, #232b36);
    border-radius: 14px;
    background: var(--ink-0, #0b0f14);
}

.live-graph-panel h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

#periodCanvas {
    display: block;
    margin-top: 16px;
    max-width: 100%;
}

.graph-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 15px;
}

.graph-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ivory-2, #a8adb5);
    font-size: 13px;
}

.graph-swatch {
    width: 16px;
    height: 3px;
    border-radius: 2px;
    display: inline-block;
}

@media (min-width: 1350px) {
    .chat-form {
        padding: 24px 32px;
    }

    #messages {
        padding: 30px 32px 40px;
    }
}

@media (max-width: 950px) {
    .dashboard-lines {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .consultation-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}

@media (max-width: 700px) {
    .layout {
        width: calc(100% - 28px);
    }

    .numeric-top-grid {
        grid-template-columns: 1fr;
    }

    .numeric-panel {
        padding: 18px;
    }

    .numeric-title-row h2 {
        font-size: 25px;
    }

    .basis-badge {
        font-size: 10px;
    }

    .dashboard-cell {
        min-height: 94px;
    }

    .dashboard-cell strong {
        font-size: 29px;
    }

    .working-number-card {
        min-height: 100px;
    }

    .tools-raised {
        padding: 18px;
    }

    .tool-jump {
        flex: 1 1 40%;
    }

    .live-graph-panel {
        padding: 12px;
    }
}

@media (max-width: 380px) {
    .numeric-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .dashboard-lines {
        column-gap: 15px;
    }

    .dashboard-line-label span {
        font-size: 10px;
    }
}

@media print {
    .numeric-panel {
        background: white;
        border-color: #bbb;
    }

    .dashboard-cell,
    .working-number-card {
        background: white;
        border-color: #bbb;
    }

    .dashboard-cell strong,
    .working-number-card strong,
    .dashboard-line-label span,
    .dashboard-line-label strong {
        color: black;
    }

    .tools-raised,
    .tool-navigation,
    .basis-badge {
        display: none !important;
    }
}