/* ORTABILIM · project-scoped extensions only.
   Shared analytics components live in statistics.css and are used as-is. */

.orta-page {
    display: none;
}

.orta-page.is-active {
    display: block;
}

/* Keep controlled BDB dropdowns above page sections with their own stacking context. */
.stat-shell .stat-filter-card {
    z-index: 20;
    overflow: visible;
}

.stat-shell .stat-filter-card > .card-body {
    overflow: visible;
}

/* Empty state ------------------------------------------------------------- */

.orta-empty {
    padding: 2rem 1rem;
    color: var(--secondary);
    text-align: center;
    font-size: 0.8125rem;
}

/* KPI art ----------------------------------------------------------------- */

.orta-kpi-art--overview-blocks {
    background-image: url("../icons/overview-blocks.png");
}

.orta-kpi-art--overview-applications {
    background-image: url("../icons/overview-applications.png");
}

.orta-kpi-art--overview-acted {
    background-image: url("../icons/overview-acted.png");
}

.orta-kpi-art--overview-attention {
    background-image: url("../icons/overview-attention.png");
}

.orta-kpi-art--schools {
    background-image: url("../icons/kpi-school.png");
}

.orta-kpi-art--students {
    background-image: url("../icons/kpi-students.png");
}

.orta-kpi-art--process {
    background-image: url("../icons/kpi-process.png");
}

.orta-kpi-art--finance {
    background-image: url("../icons/kpi-finance.png");
}

.orta-kpi-art--risk {
    background-image: url("../icons/kpi-risk.png");
}

.orta-kpi-art--capacity {
    background-image: url("../icons/kpi-capacity.png");
}

.orta-kpi-art--registry {
    background-image: url("../icons/kpi-registry.png");
}

.orta-kpi-art--blocks-cards {
    background-image: url("../icons/blocks-cards.png");
}

.orta-kpi-art--blocks-groups {
    background-image: url("../icons/blocks-groups.png");
}

.orta-kpi-art--blocks-multi {
    background-image: url("../icons/blocks-multi.png");
}

.orta-kpi-art--blocks-collision {
    background-image: url("../icons/blocks-collision.png");
}

.orta-kpi-art--integrity-sum {
    background-image: url("../icons/integrity-sum.png");
}

.orta-kpi-art--integrity-percent {
    background-image: url("../icons/integrity-percent.png");
}

.orta-kpi-art--integrity-chart {
    background-image: url("../icons/integrity-chart.png");
}

.orta-kpi-art--esf-invoice {
    background-image: url("../icons/esf-invoice.png");
}

.orta-kpi-art--esf-tax {
    background-image: url("../icons/esf-tax.png");
}

.orta-kpi-art--esf-signature {
    background-image: url("../icons/esf-signature.png");
}

.orta-kpi-art--esf-price {
    background-image: url("../icons/esf-price.png");
}

/* Длинное слово остаётся целым: заголовок переносится только между словами. */
#blocksKpi .stat-kpi-title--educational-groups,
#schoolsKpi .stat-kpi-title--educational-groups {
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
}

.orta-kpi-art--queue {
    background-image: url("../icons/kpi-queue.png");
}

.orta-kpi-art--audit {
    background-image: url("../icons/kpi-audit.png");
}

.orta-kpi-art--verified {
    background-image: url("../icons/kpi-verified.png");
}

.orta-kpi-art--unknown {
    background-image: url("../icons/kpi-unknown.png");
}

.orta-kpi-art--official {
    background-image: url("../icons/kpi-official.png");
}

.orta-kpi-art--leader {
    background-image: url("../icons/kpi-leader.png");
}

.orta-kpi-art--money-acted {
    background-image: url("../icons/money-acted.png");
}

.orta-kpi-art--money-paid {
    background-image: url("../icons/money-paid.png");
}

.orta-kpi-art--money-share {
    background-image: url("../icons/money-share.png");
}

.orta-kpi-art--money-pending {
    background-image: url("../icons/money-pending.png");
}

.orta-kpi-art--semantic-school { background-image: url("../icons/semantic-school.png"); }
.orta-kpi-art--semantic-students { background-image: url("../icons/semantic-students.png"); }
.orta-kpi-art--semantic-queue { background-image: url("../icons/semantic-queue.png"); }
.orta-kpi-art--semantic-clock { background-image: url("../icons/semantic-clock.png"); }
.orta-kpi-art--semantic-gauge { background-image: url("../icons/semantic-gauge.png"); }
.orta-kpi-art--semantic-calendar { background-image: url("../icons/semantic-calendar.png"); }
.orta-kpi-art--semantic-region { background-image: url("../icons/semantic-region.png"); }
.orta-kpi-art--semantic-system { background-image: url("../icons/semantic-system.png"); }
.orta-kpi-art--semantic-alert { background-image: url("../icons/semantic-alert.png"); }
.orta-kpi-art--semantic-contract { background-image: url("../icons/semantic-contract.png"); }
.orta-kpi-art--semantic-migration { background-image: url("../icons/semantic-migration.png"); }
.orta-kpi-art--semantic-return { background-image: url("../icons/semantic-return.png"); }
.orta-kpi-art--semantic-audit { background-image: url("../icons/semantic-audit.png"); }
.orta-kpi-art--semantic-legal { background-image: url("../icons/semantic-legal.png"); }
.orta-kpi-art--semantic-lock { background-image: url("../icons/semantic-lock.png"); }
.orta-kpi-art--semantic-overlap { background-image: url("../icons/semantic-overlap.png"); }
.orta-kpi-art--semantic-spike { background-image: url("../icons/semantic-spike.png"); }
.orta-kpi-art--semantic-coverage { background-image: url("../icons/semantic-coverage.png"); }
.orta-kpi-art--semantic-upper-tail { background-image: url("../icons/semantic-upper-tail.png"); }

/* Section entry cards ----------------------------------------------------- */

.orta-portal {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
}

.orta-portal-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 0.75rem;
    align-items: start;
}

.orta-portal-art {
    display: block;
    width: 44px;
    height: 44px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 38px 38px;
}

.orta-portal-art--portfolio {
    background-image: url("../icons/portal-portfolio.svg");
}

.orta-portal-art--geo {
    background-image: url("../icons/portal-geo.svg");
}

.orta-portal-art--balance {
    background-image: url("../icons/portal-balance.svg");
}

.orta-portal-art--risk {
    background-image: url("../icons/portal-risk.svg");
}

.orta-portal-art--double {
    background-image: url("../icons/portal-double.svg");
}

.orta-portal-art--quality {
    background-image: url("../icons/portal-quality.svg");
}

.orta-portal-art--forensics {
    background-image: url("../icons/portal-forensics.svg");
}

.orta-portal-art--funnel {
    background-image: url("../icons/portal-funnel.svg");
}

.orta-portal-art--cashgap {
    background-image: url("../icons/portal-cashgap.svg");
}

.orta-portal-action {
    margin-top: auto;
    padding-top: 1rem;
    text-align: center;
}

/* Matrix map -------------------------------------------------------------- */

.orta-map-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.orta-map-copy {
    min-width: 0;
}

.orta-map-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.orta-map-toolbar .form-control {
    width: auto;
    min-width: 11rem;
}

.orta-map-toolbar .stat-select {
    z-index: 30;
    width: auto;
    min-width: 11rem;
    max-width: 100%;
}

.orta-map-toolbar .stat-select-panel {
    right: 0;
    left: auto;
}

.orta-map-grid {
    min-height: 0;
    padding: 0;
    overflow: visible;
}

.orta-map-grid .stat-map-pixel {
    border: 0;
}

.orta-map-grid .stat-map-pixel.is-selected {
    background: var(--primary);
}

#page-overview .stat-map-pixel.is-city {
    background: #67acd1;
}

#page-overview .stat-map-pixel.is-city.is-active {
    background: #2d8dc1;
}

.orta-map-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    color: var(--secondary);
    font-size: 0.75rem;
}

.orta-map-gradient {
    display: inline-block;
    width: 150px;
    height: 9px;
    background: linear-gradient(to right, rgba(0, 97, 150, 0.22), rgba(0, 97, 150, 0.96));
}

.orta-map-swatch {
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-left: 0.4rem;
    background: var(--MFSand);
}

.orta-map-side {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.orta-map-side-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.orta-map-side-metric {
    padding: 0.6rem 0.7rem;
}

.orta-map-side-metric strong {
    display: block;
    color: var(--MFText);
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.orta-map-side-metric span {
    display: block;
    margin-top: 0.15rem;
    color: var(--secondary);
    font-size: 0.6875rem;
    line-height: 1.25;
}

.orta-map-rank {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.orta-map-rank-item {
    display: block;
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
}

.orta-map-rank-item.is-selected .stat-hlist-label {
    min-width: 0;
    flex: 1 1 auto;
    color: var(--primary);
    font-weight: 600;
}

.orta-map-tooltip {
    position: fixed;
    z-index: 1080;
    display: none;
    min-width: 15rem;
    max-width: 19rem;
    pointer-events: none;
    text-align: left;
    box-shadow: 0 0.5rem 1.5rem rgba(31, 45, 61, 0.16);
}

.orta-map-tip-title {
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.2;
}

.orta-map-tip-source {
    color: var(--secondary);
    font-size: 0.6875rem;
    line-height: 1.2;
}

.orta-map-tip-sep {
    height: 1px;
    margin: 0.5rem 0;
    background: var(--MFBorder);
}

.orta-map-tip-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.1rem 0;
    color: var(--secondary);
    font-size: 0.75rem;
}

.orta-map-tip-line strong {
    color: var(--MFText);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.orta-map-tip-action {
    margin-top: 0.4rem;
    color: var(--primary);
    font-size: 0.6875rem;
    font-weight: 600;
}

/* Contingent timing heatmap ----------------------------------------------
   Scoped extension of the shared .stat-heatmap-grid: the first column holds an
   organisation name instead of an hour label, so it needs more room. Cell
   sizing, colouring and tooltips stay with the shared component. */

/* На узком экране сетка не сжимается до неразборчивого состояния, а
   прокручивается по горизонтали внутри своего контейнера: страница при этом
   горизонтально не едет. */
.orta-heat-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.orta-heat.stat-heatmap-grid {
    min-width: 720px;
    /* Число колонок выставляет renderHeat по фактическому количеству периодов:
       фиксированное repeat() ломало сетку на срезах короче или длиннее года. */
    grid-template-columns: minmax(11.5rem, 1.5fr) repeat(auto-fit, minmax(2.1rem, 1fr));
}

.orta-heat .stat-heatmap-day {
    padding-right: 0.35rem;
    overflow: hidden;
    font-size: 0.75rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Signal level marks on the shared heatmap cell -------------------------- */

.orta-heat .stat-heatmap-cell.is-early {
    box-shadow: inset 0 0 0 2px var(--warning);
}

.orta-heat .stat-heatmap-cell.is-confirmed {
    box-shadow: inset 0 0 0 2px var(--danger);
}

.orta-heat .stat-heatmap-cell.is-sustained {
    box-shadow: inset 0 0 0 2px var(--secondary);
}

/* Строка раздела ---------------------------------------------------------

   Название раздела, пояснение и тонкая линия снизу. Фотографий и вырезанных
   фигур здесь больше нет: на аналитической витрине они спорили с цифрами за
   внимание, а вырезанные силуэты выглядели хуже, чем отсутствие картинки. */

.orta-figrow {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--stat-border, rgba(95, 112, 127, 0.16));
}

.orta-figrow-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.orta-figrow-eyebrow {
    color: var(--secondary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.orta-figrow-title {
    margin: 0;
    color: var(--dark);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.25;
}

.orta-figrow-lead {
    max-width: 52rem;
    color: var(--secondary);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.orta-figrow--hero .orta-figrow-title { font-size: 1.625rem; }

.orta-figrow--hero .orta-figrow-lead { font-size: 0.875rem; }

.orta-figrow-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 2.25rem;
    margin-top: 0.9rem;
}

.orta-figrow-fact strong {
    display: block;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
}

.orta-figrow-fact span {
    color: var(--secondary);
    font-size: 0.75rem;
}

@media (max-width: 767px) {
    .orta-figrow--hero .orta-figrow-title { font-size: 1.25rem; }
    .orta-figrow-facts { gap: 1rem 1.25rem; }
    .orta-figrow-fact strong { font-size: 1.25rem; }
}

/* Two-value comparison block --------------------------------------------- */

.orta-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.75rem;
}

.orta-split-item {
    position: relative;
    padding: 0.9rem 1rem;
    padding-top: 3.15rem;
}

.orta-split-item::before {
    position: absolute;
    top: 0.9rem;
    left: 1rem;
    display: grid;
    width: 1.65rem;
    height: 1.65rem;
    place-items: center;
    border-radius: 0.25rem;
    background: var(--MFText);
    color: var(--MFWhite);
    content: attr(data-letter);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

.orta-split-item strong {
    display: block;
    color: var(--MFText);
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1.1;
}

.orta-split-item em {
    display: block;
    margin-top: 0.15rem;
    color: var(--MFText);
    font-size: 0.8125rem;
    font-style: normal;
    font-weight: 600;
    line-height: 1.3;
}

.orta-split-item span {
    display: block;
    margin-top: 0.3rem;
    color: var(--secondary);
    font-size: 0.6875rem;
    line-height: 1.35;
}

/* Two-axis score --------------------------------------------------------- */

.orta-score {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.orta-score-item {
    padding: 0.8rem 0.9rem;
}

#page-quality .orta-score-item strong {
    display: block;
    color: var(--MFText);
    font-size: 1.75rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1;
}

.stat-hlist-fill--dark {
    background: var(--MFText);
}

.orta-quality-bar-row .card-body {
    display: grid;
    grid-template-rows: auto 2.75rem 1fr;
}

.orta-quality-bar-row .card-body > .text-secondary {
    margin-bottom: 0 !important;
}

.orta-quality-bar-row .stat-hlist {
    align-self: start;
    margin-top: 0.75rem;
}

.orta-score-item em {
    display: block;
    margin-top: 0.25rem;
    color: var(--MFText);
    font-size: 0.8125rem;
    font-style: normal;
    font-weight: 600;
}

.orta-score-item span {
    display: block;
    margin-top: 0.2rem;
    color: var(--secondary);
    font-size: 0.6875rem;
    line-height: 1.35;
}

/* Scenario control ------------------------------------------------------- */

.orta-scenario {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(11rem, auto);
    gap: 1rem 1.5rem;
    align-items: center;
}

.orta-scenario-track {
    min-width: 0;
}

.orta-scenario-value {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.orta-scenario-value strong {
    color: var(--MFText);
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1;
}

.orta-scenario-out {
    padding: 0.75rem 0.9rem;
}

.orta-scenario-out strong {
    display: block;
    color: var(--primary);
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1.1;
}

.orta-scenario-out span {
    display: block;
    margin-top: 0.2rem;
    color: var(--secondary);
    font-size: 0.6875rem;
    line-height: 1.3;
}

/* Lifecycle flow board ---------------------------------------------------- */

.orta-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.5rem;
}

.orta-flow-step {
    display: block;
    width: 100%;
    padding: 0.75rem;
    text-align: left;
}

.orta-flow-step strong {
    display: block;
    color: var(--MFText);
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.orta-flow-step span {
    display: block;
    margin-top: 0.25rem;
    color: var(--secondary);
    font-size: 0.6875rem;
    line-height: 1.3;
}

/* Registry / profile helpers --------------------------------------------- */

.orta-link {
    padding: 0;
    color: var(--primary);
    background: transparent;
    border: 0;
    font-size: inherit;
    text-align: left;
    cursor: pointer;
}

.orta-link:hover {
    text-decoration: underline;
}

.orta-search {
    max-width: 22rem;
}

.orta-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.5rem;
}

.orta-profile-item {
    padding: 0.7rem 0.8rem;
}

.orta-profile-item span {
    display: block;
    color: var(--secondary);
    font-size: 0.6875rem;
    line-height: 1.25;
}

.orta-profile-item strong {
    display: block;
    margin-top: 0.2rem;
    color: var(--MFText);
    font-size: 0.9rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.orta-coverage {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (max-width: 1199.98px) {
    .orta-map-grid {
        min-height: 0;
    }

    .orta-map-rank {
        max-height: none;
    }
}

@media (max-width: 767.98px) {
    .orta-scenario,
    .orta-score {
        grid-template-columns: 1fr;
    }

    .orta-map-grid {
        min-height: 0;
        justify-content: flex-start;
    }

    .orta-map-gradient {
        width: 110px;
    }

    .orta-map-toolbar .form-control,
    .orta-map-toolbar .stat-select {
        width: 100%;
        min-width: 0;
    }

    .orta-map-side-metrics {
        grid-template-columns: 1fr;
    }
}

/* Chart zoom toolbar ------------------------------------------------------ */
/* The bar is a sibling above .stat-chart-wrap, never an overlay: the wrap is a
   canonical component and its box must not be re-declared. */

.orta-zoom {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.orta-zoom-hint {
    color: var(--secondary);
    font-size: 0.75rem;
    line-height: 1.2;
}

.orta-zoom-state {
    margin-left: auto;
}

.orta-zoom-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.orta-zoom-state:not(:empty) + .orta-zoom-actions {
    margin-left: 0.5rem;
}

.orta-zoom-btn {
    min-width: 2rem;
    padding: 0.15rem 0.4rem;
    font-weight: 600;
    line-height: 1.2;
}

.orta-zoom-reset {
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    line-height: 1.4;
}

.orta-zoom-reset.is-armed {
    color: var(--primary);
    font-weight: 600;
}

canvas.orta-zoomable {
    touch-action: none;
    cursor: crosshair;
}

canvas.orta-zoomable.is-grabbing {
    cursor: grabbing;
}

@media (max-width: 767.98px) {
    .orta-zoom-hint {
        width: 100%;
    }

    .orta-zoom-actions,
    .orta-zoom-state {
        margin-left: 0;
    }
}

/* Explainability drawer --------------------------------------------------- */

.orta-why {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.75rem;
}

.orta-why-block {
    background: var(--MFBg);
    border: 1px solid var(--MFBorder);
    padding: 0.75rem 0.85rem;
}

.orta-why-block h6 {
    color: var(--secondary);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.orta-why-lead {
    color: var(--MFText);
    font-weight: 600;
    display: block;
    margin-bottom: 0.35rem;
}

.orta-why-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.orta-why-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.2rem 0;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--MFBorder);
}

.orta-why-list li:last-child {
    border-bottom: 0;
}

.orta-why-list span:first-child {
    color: var(--secondary);
}

.orta-why-list span:last-child {
    color: var(--MFText);
    font-weight: 600;
    text-align: right;
}

.orta-why-note {
    border-left: 3px solid var(--MFSand);
    padding: 0.15rem 0 0.15rem 0.6rem;
    color: var(--secondary);
    font-size: 0.78rem;
    display: block;
    margin-top: 0.6rem;
}

.orta-why-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.orta-why-head strong {
    font-size: 0.95rem;
}

/* Contract failure screen ------------------------------------------------- */

.orta-diag {
    background: #fff;
    border: 2px solid var(--danger);
    padding: 1.25rem 1.5rem;
    max-width: 60rem;
    margin: 2rem auto;
    color: var(--MFText);
}

.orta-diag h4 {
    color: var(--danger);
}

.orta-diag-list {
    margin: 0;
    padding-left: 1.1rem;
}

.orta-diag-list li {
    padding: 0.2rem 0;
    font-size: 0.85rem;
}

.orta-diag-list--soft li {
    color: var(--secondary);
}

.orta-fieldlist {
    display: inline-block;
    max-width: 26rem;
    font-size: 0.75rem;
    color: var(--secondary);
    line-height: 1.35;
    word-break: break-word;
}

.orta-fieldlist strong {
    color: var(--MFText);
    margin-right: 0.25rem;
}

/* Schema drift banner ----------------------------------------------------- */

.orta-banner {
    background: #fff;
    border: 1px solid var(--warning);
    border-left: 4px solid var(--warning);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: var(--MFText);
}

.orta-banner strong {
    display: block;
    margin-bottom: 0.35rem;
}

.orta-banner .orta-diag-list {
    margin-bottom: 0.35rem;
}


/* v3.2 portal micro-visuals + resilient text -------------------------------- */
.orta-portal,
.orta-portal-head > div,
.orta-fit {
    min-width: 0;
}

.orta-wrap,
.orta-insight-title,
.orta-insight-text {
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
}

/* Крупное значение KPI переносится только между числом и единицей: неразрывный
   пробел внутри «млрд ₸» не даёт оторвать знак валюты от разряда. */
.orta-kpi-fit .stat-kpi-value {
    white-space: normal;
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
}

.orta-fit > .badge {
    flex: 0 0 auto;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.orta-portal-mini {
    height: 42px;
    margin-top: 0.7rem;
    padding: 0.35rem 0.4rem 0.2rem;
    border-radius: 0.7rem;
    background: var(--MFBg);
    overflow: hidden;
}

.orta-portal-mini--empty {
    display: flex;
    align-items: center;
    color: var(--secondary);
    font-size: 0.68rem;
}

.orta-mini-bars {
    display: flex;
    height: 100%;
    align-items: flex-end;
    gap: 4px;
}

.orta-mini-bar {
    flex: 1 1 0;
    min-width: 3px;
    max-width: 24px;
    border-radius: 4px 4px 2px 2px;
    background: var(--primary);
    opacity: 0.78;
}
.orta-mini-bars--sand .orta-mini-bar { background: #c79b4b; }
.orta-mini-bars--secondary .orta-mini-bar { background: #6c757d; }
.orta-mini-bars--warning .orta-mini-bar { background: #d9a441; }
.orta-mini-bars--danger .orta-mini-bar { background: #d66565; }

.orta-portal-monthly {
    margin-top: 0.8rem;
    padding: 0.55rem 0.6rem 0.45rem;
    border-radius: 0.65rem;
    background: var(--MFBg);
}

.orta-portal-monthly-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    color: var(--secondary);
    font-size: 0.68rem;
    line-height: 1.2;
}

.orta-portal-monthly-head strong {
    color: var(--MFText);
    font-size: 0.68rem;
    font-weight: 600;
    text-align: right;
}

.orta-portal-monthly-bars {
    display: grid;
    height: 42px;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.25rem;
}

.orta-portal-month {
    display: grid;
    min-width: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.15rem;
}

.orta-portal-month-track {
    display: flex;
    min-height: 0;
    align-items: flex-end;
    justify-content: center;
}

.orta-portal-month-track i {
    display: block;
    width: min(100%, 18px);
    border-radius: 0.25rem 0.25rem 0.1rem 0.1rem;
    background: var(--primary);
    opacity: 0.82;
}

.orta-portal-month small {
    overflow: hidden;
    color: var(--secondary);
    font-size: 0.55rem;
    line-height: 1;
    text-align: center;
    text-overflow: clip;
    white-space: nowrap;
}

.orta-mini-segments {
    display: flex;
    height: 16px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--MFBg);
}
.orta-mini-segment { min-width: 2px; }
#page-overview .orta-mini-segment--0 { background: var(--primary); }
#page-overview .orta-mini-segment--1 { background: #2d8dc1; }
#page-overview .orta-mini-segment--2 { background: #67acd1; }
#page-overview .orta-mini-segment--3 { background: #b9d9e9; }

.orta-portal-funnel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.orta-portal-funnel-stage {
    position: relative;
    min-width: 0;
    padding: 0.6rem 0.65rem;
    border-radius: 0.65rem;
    background: var(--MFBg);
}

.orta-portal-funnel-stage:not(:last-child)::after {
    position: absolute;
    top: 50%;
    right: -0.65rem;
    z-index: 1;
    display: grid;
    width: 1rem;
    height: 1rem;
    place-items: center;
    border-radius: 50%;
    background: var(--MFWhite);
    color: var(--MFText);
    content: "\2192";
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    transform: translateY(-50%);
}

.orta-portal-funnel-stage span,
.orta-portal-funnel-stage strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.orta-portal-funnel-stage span {
    color: var(--secondary);
    font-size: 0.7rem;
    line-height: 1.2;
}

.orta-portal-breakdown {
    margin-top: 0.8rem;
    padding: 0.55rem 0.65rem 0.6rem;
    border-radius: 0.65rem;
    background: var(--MFBg);
}

.orta-portal-breakdown-title {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--MFText);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
}

.orta-portal-breakdown-list {
    display: grid;
    gap: 0.35rem;
}

.orta-portal-breakdown-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    margin-bottom: 0.12rem;
    font-size: 0.65rem;
    line-height: 1.15;
}

.orta-portal-breakdown-meta span {
    overflow: hidden;
    color: var(--secondary);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.orta-portal-breakdown-meta strong {
    color: var(--MFText);
    font-weight: 600;
}

.orta-portal-breakdown-track {
    display: block;
    height: 0.25rem;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--MFBorder) 65%, var(--MFWhite));
}

.orta-portal-breakdown-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

.orta-portal-funnel-stage strong {
    margin-top: 0.25rem;
    color: var(--MFText);
    font-size: 1rem;
    line-height: 1.2;
}

.orta-reg-ref {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.8fr);
    gap: 0.8rem;
    padding: 0.8rem 0.9rem;
    margin-bottom: 0.55rem;
}
.orta-reg-ref > div { min-width: 0; }
.orta-reg-ref strong { display: block; color: var(--MFText); font-size: 0.82rem; }
.orta-reg-ref span, .orta-reg-ref small { display: block; color: var(--secondary); overflow-wrap: anywhere; }
.orta-reg-ref span { margin-top: 0.15rem; font-size: 0.78rem; }
.orta-reg-ref small { font-size: 0.72rem; }

@media (max-width: 767.98px) {
    .orta-reg-ref { grid-template-columns: 1fr; }
}

/* Селекты: bootstrap задаёт .form-control-sm высоту 24px при line-height 0.9 —
   текст обрезается по вертикали. Возвращаем читаемую геометрию. */
.stat-shell select.form-control,
.stat-shell select.form-control-sm,
.stat-shell select.form-control-sm:not([size]):not([multiple]) {
  height: auto;
  min-height: 34px;
  line-height: 1.35;
  padding: .35rem 2rem .35rem .75rem;
  font-size: .8125rem;
  text-overflow: ellipsis;
}
.stat-shell select.form-control:focus,
.stat-shell select.form-control-sm:focus {
  box-shadow: 0 0 0 2px rgba(0, 97, 150, .14);
  border-color: var(--primary, #006196);
}

/* Свёрнутый список технических имён полей в таблице контракта данных. */
.orta-fieldlist > summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
  min-width: 2.25rem;
  padding: .1rem .45rem;
  border-radius: .35rem;
  background: var(--MFBg, #EEF4F8);
  color: var(--primary, #006196);
  font-weight: 600;
  font-size: .75rem;
  text-align: center;
}
.orta-fieldlist > summary::-webkit-details-marker { display: none; }
.orta-fieldlist > summary:hover { background: #E1ECF4; }
.orta-fieldlist > span {
  display: block;
  margin-top: .5rem;
  width: 34rem;
  max-width: 60vw;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  font-size: .6875rem;
  line-height: 1.5;
  color: var(--secondary, #5F707F);
  word-break: break-word;
}


/* ==========================================================================
   ORTABILIM · CLEAN VISUAL LAYER · UI ONLY
   --------------------------------------------------------------------------
   This block changes presentation only. Calculation/data packs are untouched.
   Goal: quiet GovTech canvas, less duplicated chrome, transparent editorial
   education figures that sit directly on the page background.
   ========================================================================== */

/* Editorial figures: no panel, no fake scene, no coloured box. The PNG itself
   is transparent and therefore visually belongs to the dashboard canvas. */
.orta-page {
    position: relative;
}

.orta-page-visual {
    position: relative;
    display: flex;
    height: 112px;
    align-items: flex-end;
    justify-content: flex-end;
    margin: -0.35rem .25rem .35rem;
    overflow: visible;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.orta-page-visual img {
    display: block;
    width: auto;
    max-width: min(40vw, 500px);
    max-height: 145px;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 10px 18px rgba(38, 61, 79, .08));
}

.orta-page-visual--hero {
    height: 164px;
    margin-top: -.5rem;
    margin-bottom: -.15rem;
}

.orta-page-visual--hero img {
    max-width: min(47vw, 640px);
    max-height: 205px;
}

.orta-page-visual--portrait {
    height: 124px;
}

.orta-page-visual--portrait img {
    max-height: 166px;
    max-width: min(28vw, 300px);
}

/* Alternate the visual weight so the figures do not form a repetitive right rail. */
#page-money .orta-page-visual,
#page-schools .orta-page-visual,
#page-students .orta-page-visual,
#page-regulatory .orta-page-visual {
    justify-content: flex-start;
    padding-left: .35rem;
}

#page-overview .orta-page-visual img,
#page-money .orta-page-visual img,
#page-regulatory .orta-page-visual img {
    opacity: .98;
}

/* Remove technical residue if an older cached HTML still contains it. */
.orta-fieldlist,
#contractState,
#contractTable {
    display: none !important;
}

@media (max-width: 1399.98px) {
    .orta-page-visual {
        height: 96px;
    }
    .orta-page-visual img {
        max-width: 42vw;
        max-height: 124px;
    }
    .orta-page-visual--hero {
        height: 130px;
    }
    .orta-page-visual--hero img {
        max-height: 165px;
    }
}

@media (max-width: 767.98px) {
    .orta-page-visual,
    #page-money .orta-page-visual,
    #page-schools .orta-page-visual,
    #page-students .orta-page-visual,
    #page-regulatory .orta-page-visual {
        height: 86px;
        justify-content: center;
        padding-left: 0;
        margin-top: -.15rem;
        overflow: hidden;
    }
    .orta-page-visual img {
        max-width: 78vw;
        max-height: 112px;
    }
    .orta-page-visual--hero {
        height: 108px;
    }
    .orta-page-visual--hero img {
        max-height: 136px;
    }
}


/* Hero KPI: contextual education scene at left, compact metric readout at right. */
#page-overview .orta-hero-kpi {
    overflow: hidden;
    border-color: rgba(255, 255, 255, .8);
    background:
        radial-gradient(ellipse at 26% 52%, #fbeede 0%, rgba(248, 238, 226, .9) 22%, rgba(244, 239, 231, .48) 46%, transparent 72%),
        radial-gradient(ellipse at 91% 18%, #d5efff 0%, #e4f1f6 48%, #eef0ed 100%);
}

#page-overview .orta-hero-kpi .card-body {
    padding: 1.35rem;
}

#page-overview .orta-hero-kpi-layout {
    display: grid;
    min-height: 20rem;
    grid-template-columns: minmax(22rem, 1.05fr) minmax(0, 1.35fr);
    gap: 1.4rem;
    align-items: stretch;
}

#page-overview .orta-hero-kpi-visual {
    display: flex;
    min-width: 0;
    min-height: 19rem;
    align-items: center;
    justify-content: center;
}

#page-overview .orta-hero-kpi-visual img {
    display: block;
    width: 100%;
    max-width: 37rem;
    height: auto;
    max-height: 21.5rem;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
}

#page-overview .orta-hero-kpi-data {
    display: flex;
    min-width: 0;
    align-items: center;
}

#page-overview .orta-hero-kpi-cards {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

#page-overview .orta-hero-kpi-card {
    display: flex;
    min-width: 0;
    min-height: 8.25rem;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 1.05rem;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: .95rem;
    background: rgba(255, 255, 255, .68);
    backdrop-filter: blur(10px);
}

#page-overview .orta-hero-kpi-card-title {
    color: var(--secondary);
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
}

#page-overview .orta-hero-kpi-card-value {
    margin: .75rem 0 0;
    color: var(--MFText);
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
    white-space: nowrap;
}

#page-overview .orta-hero-kpi-card-description {
    width: 100%;
    margin-top: .65rem;
    overflow-wrap: anywhere;
    color: var(--secondary);
    font-size: .9rem;
    line-height: 1.35;
}

@media (max-width: 1199.98px) {
    #page-overview .orta-hero-kpi-layout {
        grid-template-columns: 1fr;
    }

    #page-overview .orta-hero-kpi-visual {
        min-height: 14rem;
    }

    #page-overview .orta-hero-kpi-visual img {
        width: min(34rem, 100%);
        max-height: 17rem;
    }
}

@media (max-width: 767.98px) {
    #page-overview .orta-hero-kpi .card-body {
        padding: .9rem;
    }

    #page-overview .orta-hero-kpi-layout {
        min-height: 0;
        gap: .9rem;
    }

    #page-overview .orta-hero-kpi-visual {
        min-height: 11rem;
    }

    #page-overview .orta-hero-kpi-visual img {
        width: min(28rem, 100%);
        max-height: 13rem;
    }

    #page-overview .orta-hero-kpi-cards {
        grid-template-columns: 1fr;
    }

    #page-overview .orta-hero-kpi-card {
        min-height: 6.4rem;
    }
}

/* Requested dashboard refinements --------------------------------------- */

/* A wrapped portal subtitle must not shift its chart below neighbouring
   cards; every card therefore reserves one copy zone and one visual zone. */
.orta-portal > .stat-kpi-description {
    min-height: 2.85rem;
}

.orta-portal-visual {
    display: flex;
    min-height: 7.5rem;
    align-items: flex-end;
    padding: 0.55rem 0 0.6rem;
}

.orta-portal-visual > * {
    width: 100%;
    margin-top: 0;
}

.orta-portal-visual .orta-portal-breakdown,
.orta-portal-visual .orta-portal-monthly {
    padding-bottom: 0.8rem;
}

.orta-hlist-columns-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.5rem;
}

.orta-pie-bottom {
    min-height: 18rem;
    grid-template-columns: 1fr;
    align-content: center;
}

.orta-pie-bottom .stat-pie-side-chart,
.orta-pie-bottom--large.stat-pie-side--compact .stat-pie-side-chart {
    max-width: 13rem;
    height: 13rem;
}

.orta-pie-bottom .stat-pie-side-legend {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

.orta-pie-bottom .stat-pie-side-legend-item {
    flex: 0 1 13rem;
}

#page-money .orta-pie-bottom .stat-pie-side-center {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    text-align: center;
    transform: none;
}

#page-money .orta-pie-bottom .stat-pie-side-center strong {
    white-space: nowrap;
}

.orta-pie-side--large {
    min-height: 20rem;
    grid-template-columns: minmax(12rem, 1fr) minmax(0, 1fr);
}

.orta-pie-side--large.stat-pie-side--compact .stat-pie-side-chart {
    max-width: 14.5rem;
    height: 14.5rem;
}

.orta-money-table .stat-data-table {
    width: 100%;
    table-layout: fixed;
}

.orta-money-table .stat-data-table th,
.orta-money-table .stat-data-table td {
    overflow-wrap: anywhere;
    white-space: normal;
}

.orta-money-table .stat-data-table .badge {
    max-width: 100%;
    white-space: normal;
}

@media (min-width: 1200px) {
    #schoolsKpi > .col-xl-3:nth-child(-n + 3),
    #migrationKpi > .col-xl-3:nth-child(-n + 3) {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    #schoolsKpi > .col-xl-3:nth-child(n + 4),
    #migrationKpi > .col-xl-3:nth-child(n + 4) {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 991.98px) {
    .orta-hlist-columns-3 {
        grid-template-columns: 1fr;
    }

    .orta-portal > .stat-kpi-description {
        min-height: 0;
    }
}
