.ex-page {
    --ex-primary: #1e3a8a;
    --ex-accent: #f59e0b;
    --ex-ink: #0f172a;
    --ex-muted: #64748b;
    --ex-line: #e2e8f0;
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 16px 48px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    flex-grow: 1;
    width: 100%;
}

.ex-page [hidden] {
    display: none !important;
}

.ex-stage {
    position: sticky;
    top: 96px;
}

.hmi-device {
    background: linear-gradient(160deg, #eceef0 0%, #cfd3d7 100%);
    border-radius: 30px;
    padding: 16px 20px 24px;
    box-shadow: 0 1px 0 #fff inset, 0 18px 40px -18px rgba(15, 23, 42, .45), 0 2px 6px rgba(15, 23, 42, .12);
    max-width: 700px;
    margin: 0 auto;
}

.hmi-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.hmi-brand {
    font: 600 13px/1 Arial, sans-serif;
    letter-spacing: .18em;
    color: #6b7280;
    margin: 0 6px;
}

.hmi-led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #9aa1a8;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
    transition: background .3s, box-shadow .3s;
}

.hmi-led.on-blue {
    background: #3b82f6;
    box-shadow: 0 0 10px 2px rgba(59, 130, 246, .7);
}

.hmi-led.on {
    background: #22c55e;
    box-shadow: 0 0 10px 2px rgba(34, 197, 94, .7);
}

.hmi-frame {
    background: #15181b;
    border-radius: 12px;
    padding: 10px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6);
}

.hmi-wrap {
    position: relative;
    width: 100%;
    height: 0;
    overflow: hidden;
    border-radius: 3px;
}

.hmi-screen {
    position: absolute;
    left: 0;
    top: 0;
    width: 480px;
    height: 272px;
    transform-origin: 0 0;
    background: #eef0f2;
    font-family: Arial, Helvetica, sans-serif;
    color: #333;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
}

.hmi-abs,
.hmi-status,
.hmi-inv,
.hmi-temp {
    position: absolute;
}

.hmi-status {
    left: 6px;
    top: 5px;
    width: 468px;
    height: 22px;
    background: #fff;
    border: 1px solid #b9bec4;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 6px;
    box-sizing: border-box;
    font-size: 11px;
    font-weight: 700;
}

.hmi-status-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hmi-clock {
    font-size: 10.5px;
    font-weight: 600;
    white-space: nowrap;
}

.hmi-wifi {
    width: 18px;
    height: 16px;
}

.hmi-inv {
    left: 185px;
    top: 30px;
    width: 111px;
    text-align: center;
    font-size: 11px;
    letter-spacing: .04em;
}

.hmi-temp {
    left: 42px;
    top: 40px;
    font-size: 18px;
    color: #b0413e;
}

.hmi-temp small {
    font-size: 13px;
}

.hmi-mode { left: 6px; top: 78px; width: 86px; height: 56px; object-fit: contain; }
.hmi-ticon { left: 10px; top: 33px; width: 28px; height: 28px; object-fit: contain; }
.hmi-minus { left: 114px; top: 74px; width: 63px; height: 63px; }
.hmi-tile { left: 185px; top: 44px; width: 111px; height: 111px; }
.hmi-plus { left: 304px; top: 74px; width: 63px; height: 63px; }
.hmi-set { left: 378px; top: 73px; width: 94px; height: 64px; }

.hmi-zone {
    top: 180px;
    width: 92px;
    height: 78px;
}

.hmi-zfan {
    position: absolute;
    left: 0;
    top: 0;
    width: 92px;
    height: 78px;
}

.hmi-zlabel {
    position: absolute;
    left: 0;
    top: 0;
    width: 92px;
    height: 20px;
}

.hmi-screen [data-act] {
    cursor: pointer;
    transition: transform .12s, filter .12s;
}

.hmi-screen .is-pressed {
    transform: scale(.94);
    filter: brightness(.85);
}

.hmi-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    background: rgba(15, 23, 42, .35);
}

.hmi-pop {
    position: absolute;
    background: #eceff1;
    border: 2px solid #5f6b75;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    display: flex;
    flex-direction: column;
}

.hmi-pop-fan { left: 66px; top: 46px; width: 348px; height: 176px; }
.hmi-pop-zone { left: 112px; top: 54px; width: 256px; height: 160px; }

.hmi-pop-head {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 0 12px;
    background: linear-gradient(#dfe5ea, #c3ccd4);
    border-bottom: 1px solid #9aa5ae;
    font-size: 15px;
    color: #333;
}

.hmi-x {
    width: 24px;
    height: 24px;
    border: 2px solid #333;
    background: #fff;
    font: 700 15px/1 Arial, sans-serif;
    color: #111;
    padding: 0;
}

.hmi-pop-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.hmi-key {
    width: 96px;
    height: 72px;
    border: 2px solid #4b5563;
    border-radius: 12px;
    background: linear-gradient(#fafafa, #bfc3c7);
    box-shadow: 0 3px 0 #6b7280, inset 0 1px 0 #fff;
    font: 700 14px/1.15 Arial, sans-serif;
    color: #333;
    padding: 0;
}

.hmi-o {
    color: #e11d1d;
    font-size: 22px;
    line-height: 1;
}

.hmi-i {
    display: inline-block;
    width: 6px;
    height: 18px;
    margin-top: 3px;
    background: #222;
    font-size: 0;
}

.hmi-pop-speed { left: 56px; top: 16px; width: 368px; height: 240px; }

.hmi-pop-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 16px 14px;
}

.hmi-spd {
    width: auto;
    height: auto;
    font-size: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hmi-spd span {
    font-size: 28px;
    line-height: 1;
    color: #dc2626;
}

.hmi-page {
    position: absolute;
    inset: 0;
    background: #f7f8fa;
    z-index: 5;
}

.hmi-menu {
    position: absolute;
    left: 74px;
    top: 20px;
    display: grid;
    grid-template-columns: 163px 163px;
    column-gap: 24px;
    row-gap: 9px;
}

.hmi-mbtn {
    height: 54px;
    background: linear-gradient(#dde1e9, #bfc5d2);
    border: 1px solid #8a93a6;
    box-shadow: 1px 1px 0 #6b7280;
    font: 12px/1.2 Arial, sans-serif;
    color: #4b5563;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.hmi-mbtn small,
.hmi-tlabel small,
.hmi-save small {
    display: block;
    font-size: 10.5px;
}

.hmi-back {
    left: 389px;
    top: 209px;
    width: 91px;
    height: 59px;
}

.hmi-tset-title {
    position: absolute;
    left: 12px;
    top: 14px;
    font: 800 14px/1 Georgia, 'Times New Roman', serif;
    letter-spacing: .03em;
    color: #111;
}

.hmi-tset-title span {
    font-weight: 700;
}

.hmi-trow {
    position: absolute;
    left: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hmi-tlabel {
    width: 100px;
    font: 11.5px/1.15 Arial, sans-serif;
    color: #333;
}

.hmi-tval,
.hmi-sval {
    height: 30px;
    display: flex;
    align-items: center;
    background: #a5ecf7;
    border: 2px solid #1f6f8b;
    font: 15px/1 Arial, sans-serif;
    color: #111;
    padding: 0 6px;
    box-sizing: border-box;
}

.hmi-tval {
    width: 80px;
}

.hmi-serial {
    position: absolute;
    left: 222px;
    top: 146px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hmi-serial .hmi-tlabel {
    width: 92px;
}

.hmi-sval {
    width: 112px;
    background: #c9f3e4;
    letter-spacing: .08em;
}

.hmi-save {
    left: 292px;
    top: 214px;
    width: 74px;
    height: 44px;
    background: linear-gradient(#eceff3, #c3c9d1);
    border: 1px solid #6b7280;
    border-radius: 6px;
    font: 700 11px/1.15 Arial, sans-serif;
    color: #374151;
    padding: 0;
}

.hmi-kp {
    position: absolute;
    left: 284px;
    top: 18px;
    width: 191px;
    height: 251px;
    z-index: 7;
}

.hmi-kp img {
    display: block;
    width: 191px;
    height: 251px;
}

.hmi-kp-display {
    position: absolute;
    left: 12px;
    top: 13px;
    width: 169px;
    height: 37px;
    padding: 0 8px;
    box-sizing: border-box;
    font: 700 22px/37px Arial, sans-serif;
    text-align: right;
    color: #111;
    letter-spacing: .1em;
    overflow: hidden;
}

.hmi-kp-key {
    position: absolute;
    width: 41px;
    height: 38px;
    background: transparent;
    border: 0;
    border-radius: 8px;
    padding: 0;
}

.hmi-kp-tall {
    height: 86px;
}

.hmi-screen .hmi-kp-key.is-pressed {
    background: rgba(255, 255, 255, .35);
}

.hmi-dwin {
    background: #000;
}

.hmi-dwin canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: manipulation;
}

.hmi-ring {
    position: absolute;
    z-index: 9;
    border: 3px solid var(--ex-accent);
    border-radius: 12px;
    pointer-events: none;
    opacity: 0;
    transition: left .35s, top .35s, width .35s, height .35s, opacity .2s;
    animation: hmi-pulse 1.4s ease-out infinite;
}

.hmi-ring.show {
    opacity: 1;
}

.hmi-ring.nudge {
    animation: hmi-nudge .4s ease-in-out, hmi-pulse 1.4s ease-out .4s infinite;
}

.hmi-hand {
    position: absolute;
    z-index: 10;
    font-size: 30px;
    color: #fff;
    -webkit-text-stroke: 1.5px #111;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45));
    pointer-events: none;
    opacity: 0;
    transition: left .5s ease, top .5s ease, opacity .2s;
}

.hmi-hand.show {
    opacity: 1;
}

.hmi-hand.tap {
    animation: hmi-tap .45s ease-in-out;
}

@keyframes hmi-pulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .6); }
    100% { box-shadow: 0 0 0 12px rgba(245, 158, 11, 0); }
}

@keyframes hmi-nudge {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes hmi-tap {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(.78) translateY(-3px); }
}

.ex-card {
    background: #fff;
    border: 1px solid var(--ex-line);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 10px 30px -18px rgba(15, 23, 42, .35);
}

.ex-langs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.ex-lang {
    border: 1px solid var(--ex-line);
    background: #f8fafc;
    color: #334155;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
}

.ex-lang.active {
    background: var(--ex-primary);
    border-color: var(--ex-primary);
    color: #fff;
}

.ex-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--ex-ink);
    line-height: 1.25;
    margin: 0;
}

.ex-sub {
    color: var(--ex-muted);
    font-size: 13px;
    margin: 6px 0 18px;
}

.ex-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 18px;
}

.ex-seg button {
    border: 0;
    background: transparent;
    border-radius: 9px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

.ex-seg button.active {
    background: #fff;
    color: var(--ex-primary);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .15);
}

.ex-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ex-muted);
    white-space: nowrap;
}

.ex-bar {
    flex: 1;
    height: 6px;
    background: var(--ex-line);
    border-radius: 999px;
    overflow: hidden;
}

.ex-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--ex-primary);
    border-radius: inherit;
    transition: width .35s;
}

.ex-step {
    min-height: 150px;
    padding: 16px 0 8px;
}

.ex-step h2 {
    font-size: 19px;
    font-weight: 700;
    color: var(--ex-ink);
    margin: 0 0 8px;
}

.ex-step p,
.ex-free {
    font-size: 15.5px;
    line-height: 1.6;
    color: #334155;
    margin: 0;
}

.ex-free {
    margin-bottom: 16px;
}

.ex-ctrl {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 8px;
}

.ex-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ex-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--ex-line);
    background: #fff;
    color: #1e293b;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.ex-btn:disabled {
    opacity: .4;
    cursor: default;
}

.ex-primary {
    background: var(--ex-primary);
    border-color: var(--ex-primary);
    color: #fff;
}

.ex-hint {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12.5px;
    color: var(--ex-muted);
    margin: 14px 0 8px;
}

.ex-hint i {
    margin-top: 2px;
    color: var(--ex-accent);
}

.ex-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: none;
    color: var(--ex-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 4px 0;
    cursor: pointer;
}

.ex-video {
    grid-column: 1 / -1;
    background: #f8fafc;
    border: 1px solid var(--ex-line);
    border-radius: 16px;
    padding: 12px 16px;
}

.ex-video summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.ex-video video {
    display: block;
    width: 100%;
    max-width: 300px;
    margin-top: 12px;
    border-radius: 12px;
}

@media (max-width: 900px) {
    .ex-page {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        padding-top: 16px;
    }

    .ex-stage {
        position: static;
    }

    .hmi-device {
        border-radius: 20px;
        padding: 10px 10px 14px;
    }

    .hmi-top {
        gap: 10px;
        margin-bottom: 8px;
    }

    .hmi-frame {
        padding: 6px;
    }

    .ex-card {
        padding: 14px 16px 18px;
        display: flex;
        flex-direction: column;
    }

    .ex-card > [data-el="guided"],
    .ex-card > [data-el="freeBox"] {
        order: -1;
    }

    .ex-card > [data-el="guided"] {
        display: flex;
        flex-direction: column;
    }

    .ex-card .ex-progress {
        order: -2;
        margin-bottom: 10px;
    }

    .ex-card .ex-ctrl {
        order: -1;
    }

    .ex-step {
        min-height: 0;
        padding-top: 12px;
    }

    .ex-card .ex-link {
        align-self: flex-start;
    }

    .ex-card > .ex-seg {
        margin: 18px 0 16px;
    }

    .ex-card > .ex-langs,
    .ex-card > .ex-title,
    .ex-card > .ex-sub {
        order: 1;
    }

    .ex-card > .ex-sub {
        margin-bottom: 0;
    }
}

@media (max-width: 560px) {
    .ex-ctrl {
        grid-template-columns: 52px minmax(0, 1fr) 52px;
    }

    .ex-ctrl [data-el="prev"] span,
    .ex-ctrl [data-el="next"] span {
        display: none;
    }
}


.ex-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--ex-line);
    background: #fff;
    color: #1e293b;
    border-radius: 10px;
    padding: 7px 12px;
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    max-width: 100%;
}

.ex-share:hover {
    border-color: var(--ex-primary);
    color: var(--ex-primary);
}

.ex-share span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .ex-card > .ex-share {
        order: 1;
        align-self: flex-start;
        margin: 12px 0 0;
    }
}
