
:root{--bg:#f4f7fb;--card:#fff;--text:#172033;--muted:#6c7688;--line:#e2e7ef;--accent:#356df3;--accent2:#edf3ff}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif}
a{text-decoration:none;color:inherit}
.topbar{height:64px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 22px;position:sticky;top:0;z-index:50}
.brand{display:flex;gap:10px;align-items:center;font-weight:800;font-size:19px}.brand-mark{width:36px;height:36px;border-radius:11px;background:var(--accent2);display:grid;place-items:center}
.menu-toggle{display:none;border:0;background:transparent;font-size:28px;cursor:pointer}
.layout{display:flex;min-height:0}
.sidebar{width:285px;flex:none;background:#fff;border-right:1px solid var(--line);padding:18px 14px}
.side-title{font-size:18px;font-weight:800;padding:5px 10px 14px}.cat-title{font-size:11px;font-weight:800;color:var(--muted);text-transform:uppercase;padding:14px 10px 6px}
.random-link,.nav-link{display:block;border-radius:10px;padding:10px 12px;margin:2px 0;font-size:14px}.random-link{background:var(--accent2);font-weight:800;margin-bottom:15px}
.nav-link:hover,.nav-link.active{background:var(--accent2);color:var(--accent);font-weight:700}
.content{width:100%;max-width:1400px;margin:auto;padding:28px}
.hero,.lab-card{background:#fff;border:1px solid var(--line);border-radius:20px;padding:30px;box-shadow:0 8px 30px rgba(25,40,70,.05)}
.hero{margin-bottom:28px}.eyebrow{font-size:12px;font-weight:800;color:var(--accent);text-transform:uppercase;letter-spacing:.08em}
h1{font-size:34px;line-height:1.1;margin:8px 0 12px}h2{font-size:22px;margin:0 0 15px}.hero p{max-width:760px;color:var(--muted);font-size:17px;line-height:1.6}
.hero-actions,.lab-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}.btn{border:1px solid var(--line);background:#fff;border-radius:11px;padding:11px 16px;font-weight:700;cursor:pointer;font-size:14px}.btn.primary{background:var(--accent);color:#fff;border-color:var(--accent)}.btn.small{padding:8px 12px}
.topic-group{margin-bottom:30px}.cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.topic-card{background:#fff;border:1px solid var(--line);border-radius:15px;padding:17px;min-height:110px;display:flex;flex-direction:column;gap:8px}.topic-card small{color:var(--muted)}
.topic-icon{width:34px;height:34px;border-radius:10px;background:var(--accent2);display:grid;place-items:center;color:var(--accent)}
.crumb{color:var(--muted);font-size:13px;margin-bottom:12px}.lab-header{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}
.lab-scene{min-height:430px;border:1px solid var(--line);border-radius:16px;background:#fbfcff;overflow:hidden;margin-top:20px}
.lab-info{margin-top:16px;padding:15px;border-radius:12px;background:#f7f9fc;color:#4d5769;min-height:50px}
.experiment-placeholder{height:430px;display:grid;place-items:center;text-align:center;color:var(--muted);padding:30px}.experiment-placeholder .experiment-icon{font-size:72px;margin-bottom:12px}
@media(max-width:1100px){.cards{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:800px){.menu-toggle{display:block}.sidebar{position:fixed;left:-310px;top:64px;height:calc(100vh - 64px);z-index:40;transition:left .2s;box-shadow:10px 0 30px rgba(0,0,0,.08)}.sidebar.open{left:0}.content{padding:15px}.cards{grid-template-columns:repeat(2,minmax(0,1fr))}.hero,.lab-card{padding:20px;border-radius:15px}h1{font-size:27px}}
@media(max-width:520px){.cards{grid-template-columns:1fr}.lab-header{flex-direction:column}.lab-scene,.experiment-placeholder{min-height:330px}.topbar{padding:0 14px}}


/* =========================================================
   FIX: изоляция лаборатории от WordPress / Elementor
   Правая часть не должна съезжать вниз.
   ========================================================= */

html,
body.physics-lab {
    margin: 0 !important;
    padding: 0 !important;
}

.physics-lab,
.physics-lab * {
    box-sizing: border-box;
}

.physics-lab .layout {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;

    width: 100% !important;
    min-height: calc(100vh - 64px);

    margin: 0 !important;
    padding: 0 !important;

    position: relative !important;
    top: 0 !important;
    transform: none !important;
}

.physics-lab .sidebar {
    flex: 0 0 285px !important;
    width: 285px !important;
    min-width: 285px !important;

    align-self: flex-start !important;

    margin: 0 !important;

    position: sticky !important;
    top: 64px !important;

    height: calc(100vh - 64px) !important;
    overflow-y: auto !important;

    transform: none !important;
}

.physics-lab .content {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;

    align-self: flex-start !important;

    margin: 0 !important;
    padding: 28px !important;

    position: relative !important;
    top: 0 !important;
    transform: none !important;

    vertical-align: top !important;
}

.physics-lab .content > *,
.physics-lab .content section,
.physics-lab .hero,
.physics-lab .lab-card,
.physics-lab .topic-group {
    position: relative !important;
    top: 0 !important;
    transform: none !important;
}

.physics-lab .content > .hero:first-child {
    margin-top: 0 !important;
}

/* Elementor не должен влиять на внутреннюю геометрию лаборатории */
.physics-lab .layout,
.physics-lab .content,
.physics-lab .sidebar {
    float: none !important;
    clear: none !important;
}

.physics-lab .layout::before,
.physics-lab .layout::after,
.physics-lab .content::before,
.physics-lab .content::after {
    display: none !important;
    content: none !important;
}

/* Мобильная версия */
@media (max-width: 800px) {
    .physics-lab .layout {
        display: block !important;
        min-height: 0 !important;
    }

    .physics-lab .sidebar {
        position: fixed !important;
        top: 64px !important;
        left: -310px !important;

        width: 285px !important;
        min-width: 285px !important;
        height: calc(100vh - 64px) !important;

        z-index: 9999 !important;
        transition: left .2s ease !important;
    }

    .physics-lab .sidebar.open {
        left: 0 !important;
    }

    .physics-lab .content {
        width: 100% !important;
        min-width: 0 !important;

        margin: 0 !important;
        padding: 15px !important;

        position: relative !important;
        top: 0 !important;
    }
}


/* =========================================================
   СПРАВОЧНИК ФИЗИЧЕСКИХ ВЕЛИЧИН
   ========================================================= */

.units-lab{padding:24px;max-width:1200px;margin:auto}
.units-intro{text-align:center;margin-bottom:22px}
.units-badge{display:inline-flex;padding:7px 12px;border-radius:999px;background:#edf3ff;color:#356df3;font-size:12px;font-weight:800}
.units-intro h2{font-size:28px;margin:12px 0 8px}
.units-intro p{max-width:760px;margin:auto;color:#6c7688;line-height:1.6}

.units-toolbar{display:grid;grid-template-columns:1fr 280px;gap:12px;margin-bottom:26px}
.units-toolbar input,.units-toolbar select{width:100%;height:48px;border:1px solid #dfe5ef;border-radius:12px;background:#fff;padding:0 14px;font:inherit;outline:none}
.units-toolbar input:focus,.units-toolbar select:focus{border-color:#356df3;box-shadow:0 0 0 3px rgba(53,109,243,.1)}

.units-group{margin:0 0 28px}
.units-group-title{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.units-group-title h3{margin:0;font-size:19px}
.units-group-title .units-count{margin-left:auto;background:#eef1f6;color:#6c7688;border-radius:999px;padding:4px 9px;font-size:12px;font-weight:800}

.units-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.unit-card{min-height:116px;text-align:left;border:1px solid #e0e6ef;border-radius:14px;background:#fff;padding:15px;cursor:pointer;display:flex;flex-direction:column;gap:6px;transition:.15s;box-shadow:0 3px 12px rgba(25,40,70,.03)}
.unit-card:hover{transform:translateY(-2px);border-color:#9db7ff;box-shadow:0 8px 20px rgba(25,40,70,.08)}
.unit-name{font-weight:800;color:#172033;font-size:14px}
.unit-symbol{font-size:25px;font-weight:900;color:#356df3;line-height:1.15}
.unit-full{font-size:12px;color:#6c7688}

.unit-modal[hidden]{display:none}
.unit-modal{position:fixed;inset:0;z-index:100000;display:grid;place-items:center;padding:20px}
.unit-modal-backdrop{position:absolute;inset:0;background:rgba(15,24,40,.48)}
.unit-modal-card{position:relative;width:min(480px,100%);background:#fff;border-radius:20px;padding:30px;box-shadow:0 20px 60px rgba(0,0,0,.2);z-index:1}
.unit-close{position:absolute;right:15px;top:12px;width:36px;height:36px;border:0;background:#f2f4f8;border-radius:50%;font-size:25px;cursor:pointer}
.modal-symbol{font-size:42px;font-weight:900;color:#356df3}
.modal-name{font-size:24px;font-weight:900;margin-top:8px}
.modal-full{font-size:16px;color:#6c7688;margin-top:4px}
.unit-modal-card p{line-height:1.6;color:#465166;margin:18px 0 0}

@media(max-width:1000px){
    .units-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:700px){
    .units-lab{padding:14px}
    .units-toolbar{grid-template-columns:1fr}
    .units-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
    .unit-card{min-height:105px;padding:12px}
    .units-intro h2{font-size:23px}
}
@media(max-width:430px){
    .units-grid{grid-template-columns:1fr}
}

/* v14: modal inside iframe */
.unit-modal[hidden]{display:none !important}
.unit-modal{
    position:fixed !important;
    inset:0 !important;
    width:100vw !important;
    height:100vh !important;
    min-height:100dvh !important;
    margin:0 !important;
    padding:20px !important;
    box-sizing:border-box !important;
    display:grid !important;
    place-items:center !important;
    z-index:2147483647 !important;
}
.unit-modal-backdrop{
    position:absolute !important;
    inset:0 !important;
    width:100% !important;
    height:100% !important;
}
.unit-modal-card{
    position:relative !important;
    width:min(480px,100%) !important;
    max-height:calc(100dvh - 40px) !important;
    overflow:auto !important;
    margin:0 !important;
    transform:none !important;
    top:auto !important;
    right:auto !important;
    bottom:auto !important;
    left:auto !important;
    z-index:2 !important;
}



/* =========================================================
   v16 — стабильная работа внутри Elementor iframe
   ========================================================= */

html,
body.physics-lab {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    overflow-x: hidden !important;
}

.physics-lab .layout {
    min-height: 0 !important;
    height: auto !important;
    align-items: flex-start !important;
    overflow: visible !important;
}

.physics-lab .content {
    min-height: 0 !important;
    height: auto !important;
}

.physics-lab .sidebar {
    min-height: 0 !important;
}

/* Модалка полностью исключена из обычного потока. */
.unit-modal[hidden] {
    display: none !important;
}

.unit-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    display: grid !important;
    place-items: center !important;
    z-index: 2147483647 !important;
    overflow: hidden !important;
}

.unit-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

.unit-modal-card {
    position: relative !important;
    width: min(480px, calc(100vw - 40px)) !important;
    max-height: calc(100vh - 40px) !important;
    margin: 0 !important;
    overflow-y: auto !important;
    transform: none !important;
}

body.physics-lab:has(.unit-modal:not([hidden])) {
    overflow: hidden !important;
}


/* v17: модальное окно позиционируется относительно видимой области
   родительской страницы, а не относительно высокой высоты iframe. */
.unit-modal {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    display: block !important;
    overflow: visible !important;
    z-index: 2147483647 !important;
}

.unit-modal-backdrop {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.unit-modal-card {
    position: absolute !important;
    left: 50% !important;
    top: 100px;
    transform: translateX(-50%) !important;
    width: min(480px, calc(100% - 40px)) !important;
    max-height: 560px !important;
    overflow-y: auto !important;
    margin: 0 !important;
}


/* =========================================================
   v18 — центрирование всей лаборатории внутри iframe
   ========================================================= */

/* Вся связка sidebar + content теперь имеет общую ширину
   и находится по центру окна iframe. */
.physics-lab .layout {
    width: min(100%, 1400px) !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    box-sizing: border-box !important;
}

/* Контент занимает всё оставшееся место справа от меню,
   без дополнительного смещения вправо. */
.physics-lab .content {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

/* Меню сохраняет фиксированную ширину. */
.physics-lab .sidebar {
    flex: 0 0 285px !important;
    width: 285px !important;
    box-sizing: border-box !important;
}

@media (max-width: 800px) {
    .physics-lab .layout {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .physics-lab .content {
        width: 100% !important;
        max-width: none !important;
    }
}


/* =========================================================
   v19 — центрирование layout без пустого пространства справа
   ========================================================= */

/*
 * На широком экране весь блок лаборатории (меню + контент)
 * имеет одну общую ширину и центрируется относительно iframe.
 *
 * Важно: width задаём через calc(), а не только min()/max(),
 * чтобы старые правила width:100% не могли визуально прижать
 * layout к левому краю.
 */
@media (min-width: 801px) {
    .physics-lab .layout {
        display: flex !important;
        width: calc(100% - 40px) !important;
        max-width: 1400px !important;
        min-width: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        justify-content: flex-start !important;
    }

    .physics-lab .sidebar {
        flex: 0 0 285px !important;
        width: 285px !important;
        min-width: 285px !important;
    }

    .physics-lab .content {
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 28px !important;
    }
}

/* На узких экранах лаборатория занимает всю ширину. */
@media (max-width: 800px) {
    .physics-lab .layout {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}


/* =========================================================
   v21 — модальное окно единицы измерения
   Позиционирование относительно реальной видимой части iframe.
   ========================================================= */

.unit-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    overflow: visible !important;
}

.unit-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

.unit-modal-card {
    position: absolute !important;
    left: 50% !important;
    width: min(480px, calc(100vw - 40px)) !important;
    max-height: calc(100vh - 32px) !important;
    overflow-y: auto !important;
    margin: 0 !important;
}


/* =========================================================
   v22 — крупное центральное окно единицы измерения
   ========================================================= */

.unit-modal-card {
    width: min(620px, calc(100vw - 48px)) !important;
    min-height: 300px !important;
    max-height: calc(100vh - 48px) !important;
    padding: 32px !important;
    border-radius: 22px !important;
    box-sizing: border-box !important;
}

@media (max-width: 767px) {
    .unit-modal-card {
        width: calc(100vw - 28px) !important;
        min-height: 250px !important;
        max-height: calc(100vh - 28px) !important;
        padding: 24px !important;
        border-radius: 18px !important;
    }
}


/* =========================================================
   02-Mechanics / Равномерное движение
   ========================================================= */

.uniform-motion {
    color: #17233f;
}

.um-intro {
    margin-bottom: 20px;
}

.um-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border-radius: 999px;
    background: #eef4ff;
    color: #2f66df;
    font-weight: 800;
    font-size: 12px;
}

.um-intro h2 {
    margin: 12px 0 7px;
    font-size: clamp(23px, 3vw, 34px);
    line-height: 1.12;
}

.um-intro p {
    margin: 0;
    color: #7b879e;
    line-height: 1.55;
    max-width: 850px;
}

.um-controls,
.um-scene,
.um-formula,
.um-status {
    background: #fff;
    border: 1px solid #e4eaf3;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(36, 63, 110, .06);
}

.um-controls {
    padding: 20px;
    margin-bottom: 18px;
}

.um-label {
    font-size: 13px;
    color: #6d7890;
    font-weight: 800;
    margin-bottom: 9px;
}

.um-choice {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.um-choice-item {
    position: relative;
    cursor: pointer;
}

.um-choice-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.um-choice-item span {
    display: block;
    padding: 11px 18px;
    border: 1px solid #dce4f0;
    border-radius: 12px;
    background: #f8faff;
    font-weight: 800;
    color: #44516a;
    transition: .15s ease;
}

.um-choice-item.active span {
    color: #fff;
    background: #3775ef;
    border-color: #3775ef;
    box-shadow: 0 7px 16px rgba(55,117,239,.2);
}

.um-slider-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.um-slider-card {
    border: 1px solid #e5ebf4;
    background: #f8faff;
    border-radius: 16px;
    padding: 15px;
}

.um-slider-card.is-hidden {
    display: none;
}

.um-slider-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.um-slider-head span {
    color: #536078;
    font-weight: 700;
}

.um-slider-head strong {
    color: #2864db;
    white-space: nowrap;
}

.um-slider-card input[type="range"] {
    display: block;
    width: 100%;
    accent-color: #3775ef;
    cursor: pointer;
}

.um-range-note {
    margin-top: 8px;
    font-size: 11px;
    color: #8994a8;
}

.um-result {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 14px;
}

.um-result > div {
    background: #f0f5ff;
    border-radius: 13px;
    padding: 11px 13px;
}

.um-result span {
    display: block;
    font-size: 11px;
    color: #7b879d;
    margin-bottom: 4px;
}

.um-result b {
    color: #1f5fd8;
    font-size: 15px;
}

.um-scene {
    padding: 20px;
    margin-bottom: 18px;
    overflow: hidden;
}

.um-scene-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #5f6c83;
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 18px;
}

.um-road {
    position: relative;
    height: 180px;
    border-radius: 18px;
    background:
        linear-gradient(to bottom, transparent 0 34%, #dce5f1 34% 36%, transparent 36% 64%, #dce5f1 64% 66%, transparent 66%),
        #f4f7fb;
    border: 1px solid #e0e7f1;
    overflow: hidden;
}

.um-road-line {
    position: absolute;
    left: 3%;
    right: 3%;
    top: 50%;
    height: 6px;
    transform: translateY(-50%);
    border-radius: 99px;
    background: repeating-linear-gradient(
        to right,
        #aebbd0 0 28px,
        transparent 28px 46px
    );
    opacity: .7;
}

.um-cubes {
    position: absolute;
    left: 3%;
    right: 3%;
    top: 56%;
    height: 34px;
    pointer-events: none;
}

.um-cube-mark {
    position: absolute;
    top: 0;
    width: 2px;
    height: 34px;
    background: #a9b6ca;
    transform: translateX(-1px);
}

.um-cube-mark b {
    position: absolute;
    top: 38px;
    left: 50%;
    transform: translateX(-50%);
    color: #7c879b;
    font-size: 10px;
    font-weight: 800;
}

.um-cube-mark.target {
    background: #3775ef;
}

.um-cube-mark.target b {
    color: #2864db;
}

.um-start-mark,
.um-finish-mark {
    position: absolute;
    top: 16px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
}

.um-start-mark {
    left: 3%;
    color: #3c75df;
}

.um-finish-mark {
    right: 3%;
    color: #7d8799;
}

.um-car {
    --car-progress: 0%;
    position: absolute;
    z-index: 4;
    left: 3%;
    top: calc(50% - 34px);
    width: 68px;
    height: 52px;
    transform: translateX(calc((var(--car-progress)) * 13.72));
    transition: none;
    will-change: transform;
}

.um-car-body {
    position: absolute;
    left: 6px;
    bottom: 10px;
    width: 56px;
    height: 26px;
    border-radius: 11px 15px 7px 7px;
    background: linear-gradient(135deg, #3d7df2, #2059ce);
    box-shadow: 0 8px 16px rgba(39,91,210,.25);
}

.um-car-body::before {
    content: "";
    position: absolute;
    left: 16px;
    top: -13px;
    width: 28px;
    height: 18px;
    border-radius: 12px 13px 2px 2px;
    background: #4f8df7;
}

.um-car-window {
    position: absolute;
    left: 20px;
    top: -10px;
    width: 20px;
    height: 11px;
    border-radius: 8px 8px 2px 2px;
    background: #dcecff;
}

.um-car-light {
    position: absolute;
    right: -2px;
    top: 8px;
    width: 6px;
    height: 7px;
    border-radius: 3px;
    background: #ffd95c;
}

.um-wheel {
    position: absolute;
    bottom: 4px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #202b3d;
    border: 3px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,.2);
}

.um-wheel-a { left: 13px; }
.um-wheel-b { right: 7px; }

.um-axis {
    position: relative;
    height: 30px;
    margin: 5px 3% 0;
}

.um-axis > span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
}

.um-axis i {
    display: block;
    width: 2px;
    height: 8px;
    margin: 0 auto;
    background: #8997ad;
}

.um-axis b {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    color: #77849a;
}

.um-axis .muted {
    opacity: .35;
}

.um-formula {
    padding: 20px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #f4f8ff, #fbfcff);
}

.um-formula-title {
    color: #6e7a90;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 5px;
}

.um-formula-main {
    font-size: 27px;
    font-weight: 900;
    color: #235bc9;
}

.um-formula-text {
    color: #748198;
    line-height: 1.45;
    margin-top: 5px;
}

.um-status {
    padding: 14px 18px;
    color: #5d6b82;
    font-weight: 700;
    text-align: center;
    background: #f8faff;
}

.um-status.success {
    color: #18774d;
    background: #ecfaf3;
    border-color: #bfe9d2;
}

@media (max-width: 700px) {
    .um-slider-row,
    .um-result {
        grid-template-columns: 1fr;
    }

    .um-controls,
    .um-scene,
    .um-formula {
        padding: 14px;
        border-radius: 16px;
    }

    .um-road {
        height: 170px;
    }

    .um-scene-top {
        font-size: 12px;
    }

    .um-car {
        width: 60px;
    }

    .um-car-body {
        width: 50px;
    }
}


/* =========================================================
   MOBILE MENU FINAL FIX v2
   Меню должно прокручиваться пальцем независимо от страницы/iframe.
   ========================================================= */
@media (max-width: 800px) {
    html,
    body.physics-lab {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .physics-lab .sidebar {
        position: fixed !important;
        top: 64px !important;
        left: -310px !important;
        width: 285px !important;
        min-width: 285px !important;
        height: calc(100vh - 64px) !important;
        max-height: calc(100vh - 64px) !important;
        z-index: 2147483000 !important;

        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;

        overflow-y: scroll !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: contain !important;
        touch-action: pan-y !important;

        padding-bottom: 80px !important;
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
    }

    .physics-lab .sidebar.open {
        left: 0 !important;
        right: auto !important;
    }

    .physics-lab .sidebar a,
    .physics-lab .sidebar .nav-link,
    .physics-lab .sidebar .random-link {
        touch-action: manipulation !important;
    }
}


/* ===== MOBILE MENU CLEAN FIX FOR ELEMENTOR IFRAME ===== */
@media (max-width: 900px) {
    html,
    body {
        overflow-x: hidden !important;
    }

    .physics-lab .sidebar {
        position: fixed !important;
        top: 64px !important;
        left: 0 !important;

        width: min(88vw, 360px) !important;
        height: calc(var(--physics-parent-vh, 100vh) - 64px) !important;
        max-height: calc(var(--physics-parent-vh, 100vh) - 64px) !important;

        overflow-y: auto !important;
        overflow-x: hidden !important;

        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: contain !important;
        touch-action: pan-y !important;

        padding-bottom: 90px !important;

        z-index: 99999 !important;

        transform: translate3d(-105%, 0, 0) !important;
        transition: transform .22s ease !important;
    }

    .physics-lab .sidebar.open {
        transform: translate3d(0, 0, 0) !important;
    }

    .physics-lab .sidebar::-webkit-scrollbar {
        width: 4px !important;
    }
}

@media (min-width: 901px) {
    .physics-lab .sidebar {
        overflow-y: auto !important;
    }
}


/* =========================================================
   MOBILE OPTIMIZATION v1
   Optimized for Android / iPhone / Elementor iframe.
   Desktop styles above remain unchanged.
   ========================================================= */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }

@media (max-width: 900px) {
    .physics-lab .topbar {
        height: 58px !important;
        min-height: 58px !important;
        padding: 0 12px !important;
        position: sticky !important;
        top: 0 !important;
    }

    .physics-lab .brand {
        font-size: 16px !important;
        gap: 8px !important;
    }

    .physics-lab .brand-mark {
        width: 34px !important;
        height: 34px !important;
    }

    .physics-lab .menu-toggle {
        display: grid !important;
        place-items: center !important;
        width: 46px !important;
        height: 46px !important;
        min-width: 46px !important;
        padding: 0 !important;
        border-radius: 12px !important;
        background: var(--accent2) !important;
        color: var(--accent) !important;
        font-size: 25px !important;
        line-height: 1 !important;
    }

    .physics-lab .layout {
        min-height: calc(100dvh - 58px) !important;
        width: 100% !important;
    }

    .physics-lab .content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px !important;
        overflow: visible !important;
    }

    .physics-lab .hero,
    .physics-lab .lab-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px !important;
        margin-bottom: 14px !important;
        border-radius: 14px !important;
        box-shadow: 0 4px 18px rgba(25,40,70,.05) !important;
    }

    .physics-lab h1 {
        font-size: clamp(24px, 7vw, 30px) !important;
        line-height: 1.12 !important;
        overflow-wrap: anywhere;
    }

    .physics-lab h2 {
        font-size: 20px !important;
    }

    .physics-lab .hero p {
        font-size: 15px !important;
        line-height: 1.5 !important;
    }

    .physics-lab .hero-actions,
    .physics-lab .lab-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        margin-top: 14px !important;
    }

    .physics-lab .btn {
        min-height: 46px !important;
        padding: 12px 14px !important;
        border-radius: 10px !important;
        font-size: 14px !important;
    }

    .physics-lab .cards {
        grid-template-columns: 1fr !important;
        gap: 9px !important;
    }

    .physics-lab .topic-card {
        min-height: 88px !important;
        padding: 14px !important;
        border-radius: 12px !important;
    }

    .physics-lab .topic-card strong {
        font-size: 15px !important;
        line-height: 1.3 !important;
    }

    .physics-lab .topic-card small {
        font-size: 12px !important;
    }

    .physics-lab .lab-header {
        gap: 10px !important;
    }

    .physics-lab .lab-scene {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 300px !important;
        height: auto !important;
        margin-top: 14px !important;
        border-radius: 12px !important;
        overflow: hidden !important;
    }

    .physics-lab .lab-info {
        font-size: 14px !important;
        line-height: 1.5 !important;
        padding: 12px !important;
    }

    .physics-lab .crumb {
        font-size: 12px !important;
        margin-bottom: 8px !important;
    }

    /* Forms and sliders: comfortable touch targets */
    .physics-lab input[type="range"] {
        min-height: 32px !important;
        touch-action: pan-x !important;
    }

    .physics-lab input,
    .physics-lab select,
    .physics-lab button {
        font: inherit;
    }

    /* Avoid horizontal page scrolling caused by experiments. */
    .physics-lab .content,
    .physics-lab .lab-card,
    .physics-lab .lab-scene {
        overflow-x: hidden !important;
    }

    /* Sidebar: height comes from Elementor parent viewport variable. */
    .physics-lab .sidebar {
        top: 58px !important;
        height: calc(var(--physics-parent-vh, 100dvh) - 58px) !important;
        max-height: calc(var(--physics-parent-vh, 100dvh) - 58px) !important;
        width: min(88vw, 350px) !important;
        padding: 12px 10px 90px !important;
        overscroll-behavior-y: contain !important;
    }

    .physics-lab .sidebar .nav-link,
    .physics-lab .sidebar .random-link {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        padding: 10px 12px !important;
        margin: 3px 0 !important;
    }

    .physics-lab .sidebar .working-badge {
        flex: 0 0 auto;
    }

    /* Larger experiment controls on narrow screens. */
    .physics-lab .lab-actions {
        position: relative !important;
    }

    .physics-lab .lab-actions .btn {
        width: 100% !important;
    }
}

@media (max-width: 520px) {
    .physics-lab .content {
        padding: 8px !important;
    }

    .physics-lab .hero,
    .physics-lab .lab-card {
        padding: 13px !important;
        border-radius: 12px !important;
    }

    .physics-lab .lab-scene {
        min-height: 270px !important;
    }

    .physics-lab .eyebrow {
        font-size: 10px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .physics-lab *,
    .physics-lab *::before,
    .physics-lab *::after {
        scroll-behavior: auto !important;
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}

/* =========================================================
   v25 — мобильный быстрый Старт рядом с активным опытом
   ========================================================= */
.physics-lab .lab-stage-shell{
    position:relative;
    width:100%;
}
.physics-lab .mobile-quick-start{
    display:none;
}

@media (max-width:800px){
    .physics-lab .lab-stage-shell{
        margin-top:12px;
    }
    .physics-lab .lab-stage-shell .lab-scene{
        margin-top:0 !important;
    }
    .physics-lab .mobile-quick-start{
        display:inline-flex;
        align-items:center;
        justify-content:center;
        position:absolute;
        right:10px;
        bottom:10px;
        z-index:80;
        min-width:112px;
        min-height:44px;
        padding:10px 16px;
        border:2px solid #ff8b18;
        border-radius:14px;
        background:linear-gradient(135deg,#ffb347,#ff8b18);
        color:#fff;
        box-shadow:0 9px 24px rgba(255,139,24,.32);
        font-weight:950;
        font-size:15px;
        line-height:1;
        cursor:pointer;
        touch-action:manipulation;
    }
    .physics-lab .mobile-quick-start.fired{
        transform:scale(.96);
        box-shadow:0 4px 12px rgba(255,139,24,.26);
    }
    .physics-lab .lab-card{
        overflow:visible !important;
    }
    .physics-lab .lab-scene{
        border:1px solid #dfe7ef !important;
        box-shadow:0 8px 26px rgba(27,48,74,.06) !important;
        background:#fff !important;
    }
}

@media (max-width:430px){
    .physics-lab .mobile-quick-start{
        right:8px;
        bottom:8px;
        min-width:98px;
        min-height:42px;
        padding:9px 13px;
        font-size:14px;
    }
}

/* Унифицированный вид новых лабораторий и визуальных задач */
.physics-lab .v25-wrap{
    --v25-ink:#10233f;--v25-muted:#697b91;--v25-blue:#2878ff;--v25-orange:#ff9d32;
    max-width:1180px;margin:auto;padding:16px;color:var(--v25-ink);font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
}
.physics-lab .v25-wrap *{box-sizing:border-box}
.physics-lab .v25-hero{padding:22px;border:1px solid #e3ebf5;border-radius:24px;background:linear-gradient(135deg,#f3f8ff,#fff 56%,#fff8e9);box-shadow:0 14px 40px rgba(32,67,110,.08)}
.physics-lab .v25-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.physics-lab .v25-tag{display:inline-flex;padding:6px 10px;border-radius:999px;background:#edf5ff;color:#2465b8;font-size:11px;font-weight:900}
.physics-lab .v25-wrap h2{font-size:clamp(28px,4.5vw,46px);margin:10px 0 7px;line-height:1.05}
.physics-lab .v25-sub{margin:0;color:var(--v25-muted);line-height:1.5;max-width:720px}
.physics-lab .v25-formula{padding:12px 15px;border-radius:15px;background:#10233f;color:#fff;font-weight:950;font-size:18px;white-space:nowrap}
.physics-lab .v25-scene{position:relative;height:390px;margin-top:18px;border-radius:20px;overflow:hidden;background:linear-gradient(#cbeaff,#eef8ff);border:1px solid rgba(20,50,80,.08)}
.physics-lab .v25-scene canvas,.physics-lab .v25-scene svg{display:block;width:100%;height:100%}
.physics-lab .v25-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}
.physics-lab .v25-card,.physics-lab .v25-task{padding:18px;border:1px solid #e4ebf3;border-radius:18px;background:#fff;box-shadow:0 8px 24px rgba(32,67,110,.055)}
.physics-lab .v25-card h3,.physics-lab .v25-task h3{margin:0 0 12px;font-size:17px}
.physics-lab .v25-control{margin:0 0 14px}.physics-lab .v25-control:last-child{margin-bottom:0}
.physics-lab .v25-control-top{display:flex;justify-content:space-between;gap:10px;margin-bottom:7px;font-size:12px;font-weight:850}
.physics-lab .v25-val{padding:4px 8px;border-radius:8px;background:#edf5ff;color:#1763c6}
.physics-lab .v25-wrap input[type=range]{width:100%;accent-color:#2878ff}
.physics-lab .v25-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.physics-lab .v25-btn{border:0;border-radius:11px;padding:10px 13px;font-weight:900;cursor:pointer;touch-action:manipulation}
.physics-lab .v25-primary{background:#2878ff;color:#fff}.physics-lab .v25-soft{background:#edf3f8;color:#35516f}.physics-lab .v25-orange{background:#ff9d32;color:#fff}
.physics-lab .v25-result{padding:15px;border-radius:15px;background:linear-gradient(135deg,#10233f,#17406f);color:#fff}
.physics-lab .v25-result strong{display:block;font-size:32px;margin-top:3px}
.physics-lab .v25-task{margin-top:14px;background:linear-gradient(135deg,#fff9e8,#fff);border-color:#f1dfae;box-shadow:none}
.physics-lab .v25-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
.physics-lab .v25-opt{border:1px solid #dce5ef;border-radius:11px;background:#fff;padding:10px;font-weight:850;cursor:pointer}
.physics-lab .v25-feedback{margin-top:10px;padding:10px;border-radius:10px;font-size:12px;font-weight:850;display:none}.physics-lab .v25-feedback.show{display:block}.physics-lab .v25-feedback.ok{background:#e9fff5;color:#157351}.physics-lab .v25-feedback.no{background:#fff0f1;color:#a53643}
.physics-lab .v25-progress{font-size:12px;color:#718197;font-weight:850}

@media(max-width:800px){
    .physics-lab .v25-wrap{padding:8px 8px 28px}
    .physics-lab .v25-hero{padding:14px;border-radius:18px}
    .physics-lab .v25-head{display:block}
    .physics-lab .v25-formula{display:inline-block;margin-top:10px;font-size:15px}
    .physics-lab .v25-scene{height:315px;margin-top:12px;border-radius:16px}
    .physics-lab .v25-grid{grid-template-columns:1fr;gap:10px}
    .physics-lab .v25-card,.physics-lab .v25-task{padding:14px;border-radius:15px}
    .physics-lab .v25-btn,.physics-lab .v25-opt{min-height:42px}
}
@media(max-width:480px){
    .physics-lab .v25-scene{height:285px}
    .physics-lab .v25-options{grid-template-columns:1fr}
}
.physics-lab .mobile-quick-start[hidden]{display:none !important}
