/* ==========================================================================
   Модель экономической природы — Континуум Емельянова
   Интерактивная шкала: агрегат ↔ предприятие
   ========================================================================== */

/* === Color tokens === */
.emodel-page {
    --emodel-green: #2c6e49;
    --emodel-green-light: #4a7c59;
    --emodel-amber: #b8860b;
    --emodel-sienna: #a0522d;
    --emodel-red: #8b2500;
}

/* === Range Slider Controls === */
.emodel-page input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, var(--emodel-green), var(--emodel-green-light), var(--emodel-amber), var(--emodel-sienna), var(--emodel-red));
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.emodel-page input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    background: radial-gradient(circle at 40% 35%, var(--cream), var(--warm));
    border: 2px solid var(--brown-medium);
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.emodel-page input[type=range]::-moz-range-thumb {
    width: 20px; height: 20px;
    background: radial-gradient(circle at 40% 35%, var(--cream), var(--warm));
    border: 2px solid var(--brown-medium);
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* === Animations === */
@keyframes emodelPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139,37,0,0); }
    50%      { box-shadow: 0 0 16px 3px rgba(139,37,0,.1); }
}

/* === Page Layout === */
.emodel-page {
    padding-top: 80px;
    background: var(--paper);
}

/* === Hero === */
.emodel-hero {
    background: linear-gradient(135deg, var(--brown), var(--dark));
    padding: 1.4rem 1.5rem 1.1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid var(--red);
}
.emodel-hero-border {
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(196,167,125,.15);
    pointer-events: none;
}
.emodel-hero-inner {
    position: relative;
    z-index: 1;
}
.emodel-hero-sub {
    font-family: var(--font-accent);
    font-size: .72rem;
    color: var(--light);
    letter-spacing: .15em;
    text-transform: uppercase;
    margin-bottom: .25rem;
    font-style: italic;
}
.emodel-hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 4vw, 2.4rem);
    font-weight: 900;
    color: var(--cream);
    margin: 0 0 .2rem;
    text-shadow: 2px 2px 0 var(--red);
    line-height: 1.15;
}
.emodel-hero-title span {
    color: var(--light);
    font-size: .75em;
}
.emodel-hero-desc {
    font-family: var(--font-heading);
    font-size: .9rem;
    color: var(--light);
    max-width: 520px;
    margin: .2rem auto 0;
    font-style: italic;
    line-height: 1.3;
}

/* === Body wrapper === */
.emodel-body {
    max-width: 940px;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
}

/* === Presets === */
.emodel-presets {
    display: flex;
    gap: .5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}
.emodel-preset {
    font-family: var(--font-heading);
    font-size: .85rem;
    font-weight: 700;
    padding: .35rem .9rem;
    color: var(--cream);
    border: 1px solid rgba(232,217,190,.3);
    border-radius: 4px;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    line-height: 1.4;
}
.emodel-preset:hover {
    opacity: .85;
    transform: translateY(-1px);
}

/* === Visualization panel === */
.emodel-viz {
    background: linear-gradient(145deg, var(--paper), #ece0c9);
    border: 2px solid var(--light);
    border-radius: 8px;
    padding: .75rem .85rem;
    margin-bottom: .75rem;
}

/* Continuum bar */
.emodel-continuum {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
}
.emodel-continuum-label {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .65rem;
    white-space: nowrap;
    letter-spacing: .05em;
}
.emodel-continuum-track {
    flex: 1;
    height: 8px;
    background: linear-gradient(90deg, var(--emodel-green), var(--emodel-green-light), var(--emodel-amber), var(--emodel-sienna), var(--emodel-red));
    border-radius: 4px;
    position: relative;
    border: 1px solid rgba(74,55,40,.2);
}
.emodel-marker {
    position: absolute;
    top: -5px;
    transition: left .5s ease-out;
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid var(--brown);
    transform: translateX(-50%);
}
.emodel-divider {
    position: absolute;
    top: 0; bottom: 0;
    width: 1px;
    background: rgba(44,24,16,.18);
}

/* Zone badge */
.emodel-badge {
    animation: emodelPulse 3s ease-in-out infinite;
    transition: background .5s ease;
    text-align: center;
    margin-bottom: .5rem;
    color: var(--cream);
    padding: .3rem .7rem;
    border-radius: 4px;
}
.emodel-badge-name {
    font-family: var(--font-display);
    font-size: .95rem;
    font-weight: 700;
}
.emodel-badge-sub {
    font-family: var(--font-accent);
    font-size: .7rem;
    font-style: italic;
    opacity: .85;
    margin-left: 8px;
}

/* Canvas */
.emodel-canvas-wrap {
    display: flex;
    justify-content: center;
    background: rgba(245,237,216,.35);
    border-radius: 5px;
    border: 1px dashed rgba(139,90,43,.12);
}

/* Legend */
.emodel-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: .4rem;
    flex-wrap: wrap;
}
.emodel-legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
}
.emodel-legend-item span {
    font-family: var(--font-accent);
    font-size: .62rem;
    font-style: italic;
    color: var(--brown-medium);
}
.emodel-legend-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
}

/* === Sliders Panel === */
.emodel-sliders {
    background: #fff9ef;
    border: 2px solid var(--light);
    border-radius: 8px;
    padding: .75rem .6rem .6rem;
    overflow: visible;
}
.emodel-sliders-title {
    font-family: var(--font-display);
    font-size: .95rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 .1rem;
    color: var(--brown);
}
.emodel-hint {
    font-family: var(--font-accent);
    font-size: .64rem;
    color: var(--warm);
    text-align: center;
    font-style: italic;
    margin: 0 0 .4rem;
}

/* Poles header */
.emodel-poles {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 .5rem;
    margin-bottom: .15rem;
}
.emodel-poles-side {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .64rem;
    display: flex;
    align-items: center;
    gap: 4px;
}
.emodel-poles-line {
    flex: 1;
    height: 1px;
    background: rgba(139,90,43,.1);
    margin: 0 8px;
}
.emodel-poles-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    display: inline-block;
}

/* Sliders row */
.emodel-srow {
    display: flex;
    justify-content: center;
    gap: 2px;
    padding: 0 2px;
    position: relative;
}

/* Individual slider column */
.emodel-scol {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    min-width: 68px;
    max-width: 115px;
    position: relative;
}
.emodel-slabel {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .72rem;
    text-align: center;
    color: var(--brown);
    line-height: 1.12;
    white-space: pre-line;
    margin-bottom: 4px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.emodel-stag {
    font-family: var(--font-accent);
    font-size: .58rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3px;
    padding: 1px 5px;
    border-radius: 3px;
    transition: all .3s;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.emodel-strack {
    position: relative;
    width: 48px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.emodel-tick-line {
    position: absolute;
    left: 4px; right: 4px;
    height: 2px;
    border-radius: 1px;
}
.emodel-tick-dot {
    position: absolute;
    right: -6px;
    width: 10px; height: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all .2s;
    z-index: 10;
}
.emodel-tick-dot:hover {
    transform: scale(1.4) !important;
}

/* Popover tooltip */
.emodel-popover {
    position: absolute;
    left: calc(100% + 16px);
    width: 220px;
    background: rgba(44,24,16,.96);
    color: var(--cream);
    padding: 8px 10px;
    border-radius: 5px;
    font-size: .72rem;
    line-height: 1.4;
    font-family: var(--font-body);
    z-index: 200;
    box-shadow: 0 5px 20px rgba(0,0,0,.4);
    pointer-events: none;
}
.emodel-popover-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .8rem;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.emodel-popover-arrow {
    position: absolute;
    left: -5px;
    top: 40px;
    width: 0; height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 5px solid rgba(44,24,16,.96);
}
.emodel-spoles {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 4px;
    padding: 0 2px;
}
.emodel-spoles span {
    font-family: var(--font-accent);
    font-size: .54rem;
    font-weight: 700;
}

/* === Insight === */
.emodel-insight {
    margin-top: .85rem;
    background: linear-gradient(135deg, var(--brown), var(--dark));
    color: var(--cream);
    padding: .9rem 1rem;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}
.emodel-insight-border {
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(196,167,125,.1);
    pointer-events: none;
    border-radius: 3px;
}
.emodel-insight-quote {
    padding: .4rem .7rem;
    background: rgba(139,37,0,.18);
    border-left: 3px solid var(--red);
    border-radius: 0 3px 3px 0;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: .85rem;
    line-height: 1.35;
    position: relative;
}

/* WP content block */
.emodel-wp-content {
    margin-top: 2rem;
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--brown-medium);
    line-height: 1.8;
}
.emodel-wp-content h2,
.emodel-wp-content h3 {
    font-family: var(--font-display);
    color: var(--brown);
    margin-top: 1.5rem;
}

/* Footer note */
.emodel-footer-note {
    text-align: center;
    margin-top: .8rem;
    padding-bottom: .5rem;
    font-family: var(--font-accent);
    font-size: .68rem;
    color: var(--warm);
    font-style: italic;
}

/* === Responsive === */
@media (max-width: 720px) {
    .emodel-popover {
        left: auto; right: auto;
        top: auto !important;
        bottom: calc(100% + 12px);
        width: 180px;
        font-size: .65rem;
    }
    .emodel-popover-arrow {
        left: 50%; top: auto;
        bottom: -5px;
        transform: translateX(-50%);
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 5px solid rgba(44,24,16,.96);
        border-bottom: none;
        border-right-color: transparent;
    }
    .emodel-scol {
        min-width: 52px;
    }
    .emodel-slabel {
        font-size: .6rem;
    }
    .emodel-hero-title {
        font-size: clamp(1.1rem, 5vw, 1.8rem);
    }
}

@media (max-width: 480px) {
    .emodel-body {
        padding: .5rem .5rem 1.5rem;
    }
    .emodel-strack {
        height: 130px;
    }
    .emodel-stag {
        font-size: .5rem;
    }
}
