
body {
    margin: 0;
    /*font-family: 'Roboto Mono', monospace;*/
    /*background: #CDC9C0;*/
    background: linear-gradient(90deg, rgb(189 188 188) 0%, rgb(101 111 116) 100%);
    /*color: #000;*/
    color: var(--wiz-title);
    font-family: 'Nunito', sans-serif;
    /*overflow: hidden;*/
    /*user-select: none;*/
}

/* Header у стилі wizard */
.wizard-header {
    --wiz-bg: #f3f2f7;
    --wiz-card: #ffffff;
    --wiz-border: rgba(30, 41, 59, 0.12);
    --wiz-title: #4b5563;
    --wiz-muted: #7b8190;
    --wiz-accent: #f04aa6;
    --wiz-accent-2: #ff5aa7;

    width: min(1200px, 96vw);
    margin: 18px auto 0;
    padding: 14px 16px;
    border-radius: 22px;
    background: rgba(243, 242, 247, 0.88);
    border: 1px solid rgba(30, 41, 59, 0.10);
    box-shadow: 0 18px 55px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(6px);
}

.wizard-header--row .wizard-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
}

.wizard-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 110px;
}

.wizard-header-logo {
    height: 44px;
    width: auto;
}

.wizard-header-title {
    font-weight: 800;
    color: var(--wiz-title);
    font-size: 20px;
    line-height: 1.1;
}

.wizard-header-subtitle {
    color: var(--wiz-muted);
    font-size: 14px;
    margin-top: 2px;
}

.wizard-header-row-items {
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 10px;
    flex-wrap: wrap;
}

.wizard-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 2px solid rgba(30, 41, 59, 0.10);
    color: var(--wiz-title);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

/* wizard-chip--calib прибрано: min/max/avg тепер показуємо як tooltip у chip "Калібрування" */

.wizard-chip--tooltip {
    position: relative;
    outline: none;
}

.wizard-chip--tooltip:focus-visible {
    box-shadow: 0 0 0 4px rgba(240, 74, 166, 0.18), 0 10px 26px rgba(15, 23, 42, 0.06);
}

.wizard-chip-tooltip {
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%);
    min-width: 220px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 2px solid rgba(30, 41, 59, 0.10);
    box-shadow: 0 18px 55px rgba(15, 23, 42, 0.16);
    color: var(--wiz-title);
    display: none;
    z-index: 1000;
    white-space: nowrap;
}

.wizard-title-with-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.wizard-title-help {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.wizard-title-help-btn {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid rgba(240, 74, 166, 0.45);
    background: rgba(255, 255, 255, 0.85);
    color: rgba(240, 74, 166, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    cursor: help;
}

.wizard-title-tooltip {
    min-width: 280px;
    width: min(520px, 86vw);
    white-space: normal; /* дозволяємо переноси рядків для довгих підказок */
    text-align: left;
    font-size: 16px;
    line-height: 1.35;
}

.wizard-chip--tooltip .wizard-chip-tooltip {
    min-width: 140px;
    text-align: center;
}

.wizard-chip-tooltip::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -7px;
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.96);
    border-left: 2px solid rgba(30, 41, 59, 0.10);
    border-top: 2px solid rgba(30, 41, 59, 0.10);
}

.wizard-chip-tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.wizard-chip--tooltip:hover .wizard-chip-tooltip,
.wizard-chip--tooltip:focus-within .wizard-chip-tooltip,
.wizard-chip--tooltip:focus .wizard-chip-tooltip {
    display: grid;
    gap: 6px;
}

.wizard-chip-label {
    color: var(--wiz-muted);
    font-weight: 700;
    font-size: 13px;
}

.wizard-chip-value {
    font-weight: 800;
    color: var(--wiz-title);
}

.wizard-header-select {
    border-radius: 18px;
    padding: 10px 14px;
    border: 2px solid rgba(30, 41, 59, 0.14);
    background: rgba(255, 255, 255, 0.75);
    color: var(--wiz-title);
    font-weight: 700;
    outline: none;
}

.wizard-header button {
    border-radius: 18px;
    padding: 10px 16px;
    font-weight: 600;
    min-height: 40px;
    border: none;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}
.wizard-header .wizard-chip{
    padding: 0px 12px;
    height: 40px;
 
}


.wizard-header button.primary {
    background: linear-gradient(135deg, var(--wiz-accent), var(--wiz-accent-2));
    color: #fff;
    box-shadow: 0 14px 35px rgba(240, 74, 166, 0.28);
}

.wizard-header button.secondary {
    border: 2px solid rgba(30, 41, 59, 0.14);
    background: rgba(255, 255, 255, 0.70);
    color: var(--wiz-title);
}

.wizard-header button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.wizard-header button.primary:hover:not(:disabled),
.wizard-header button.secondary:hover:not(:disabled) {
    transform: translateY(-1px);
}

.wizard-header button.primary:hover:not(:disabled) {
    box-shadow: 0 18px 45px rgba(240, 74, 166, 0.42);
}

.wizard-header button.secondary:hover:not(:disabled) {
    border-color: rgba(240, 74, 166, 0.55);
    box-shadow: 0 14px 35px rgba(240, 74, 166, 0.12);
}

.wizard-header-select {
    transition: box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.wizard-header-select:hover {
    border-color: rgba(240, 74, 166, 0.55);
    box-shadow: 0 14px 35px rgba(240, 74, 166, 0.12);
}

.wizard-header-row-items button.primary:active:not(:disabled),
.wizard-header-row-items button.secondary:active:not(:disabled) {
    transform: translateY(0px);
}

@media (max-width: 980px) {
    .wizard-header--row .wizard-header-row {
        align-items: flex-start;
    }
}

.training-wizard {
    /* Глобальна кольорова гама для візарда */
    --wiz-bg: #f3f2f7;
    --wiz-surface: rgba(255, 255, 255, 0.65);
    --wiz-card: #ffffff;
    --wiz-border: rgba(30, 41, 59, 0.12);
    --wiz-text: #4b5563;
    --wiz-title: #4b5563;
    --wiz-muted: #7b8190;
    --wiz-accent: #f04aa6;
    --wiz-accent-2: #ff5aa7;
    --wiz-accent-shadow: rgba(240, 74, 166, 0.35);
    --wiz-section-width: min(760px, 100%);

    /* Типографіка (однакова на всіх кроках) */
    --wiz-h2-size: clamp(28px, 4vw, 30px);
    --wiz-desc-size: clamp(18px, 2.3vw, 18px);
    --wiz-hint-size: clamp(16px, 2vw, 14px);
    --wiz-btn-font: clamp(16px, 2vw, 16px);

    margin: 40px auto;
    width: min(900px, 95vw);
    padding: 30px;
    background: var(--wiz-bg);
    border-radius: 28px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
    color: var(--wiz-text);
    display: none;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 10000;
    max-height: 90vh;
    min-height: 650px;
    overflow-y: auto;
}

.training-wizard.wizard-popup-active {
    display: flex;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    overflow: visible;
}

/* Кнопка закриття модалки (праворуч зверху) */
.training-wizard .wizard-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #c3c3c3d9;
    color: rgba(17, 24, 39, 0.92);
    display: none; /* показуємо тільки у попап-режимі */
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    transition: box-shadow 0.2s ease, transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
    z-index: 10002;
}

.training-wizard.wizard-popup-active .wizard-close {
    display: inline-flex;
}

.training-wizard.wizard-popup-active .wizard-close:hover {
    background: #c3c3c3d9;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
    filter: saturate(1.05);
}

.training-wizard.wizard-popup-active .wizard-close:active {
    transform: translateY(0px);
}

.training-wizard.wizard-popup-active .wizard-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(240, 74, 166, 0.25), 0 14px 32px rgba(0, 0, 0, 0.22);
}

/* Оверлей для попапу */
.wizard-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.wizard-overlay.active {
    display: block;
}

.wizard-card {
    background: transparent;
    border-radius: 22px;
    padding: 0px 14px 10px;
    border: none;
    display: none;
    flex-direction: column;
    gap: 10px;
    min-height: 610px;
    max-width:  var(--wiz-section-width);;
    width: 100%;
    margin: 0 auto;
}

.wizard-card.active {
    display: flex;
}

.wizard-hero {
    display: flex;
    justify-content: center;
    padding-top: 6px;
}

.wizard-hero-icon {
    width: 45px;
    height: 45px;
    border-radius: 999px;
    background: transparent;
    border: 6px solid rgba(240, 74, 166, 0.65);
    box-shadow: none;
    position: relative;
}

.wizard-hero-icon::after {
    content: "";
}

/* .wizard-hero-icon[data-hero-icon="1"]::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
} */

/* Іконки для кроків (плейсхолдери по контексту) */
.wizard-hero-icon {
    padding: 10px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 56%;
}
.wizard-hero-icon svg{
    width: 100%;
    height: 100%;
}
.wizard-step-icon {
    background-repeat: no-repeat;
    background-position: center;
    background-size: 92%;
}

 

/* Плейсхолдер “годинник” для кроку 2 (можна замінити своїм SVG) */
/* .wizard-hero-icon[data-hero-icon="2"]::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 26px;
    background: rgba(240, 74, 166, 0.9);
    border-radius: 4px;
    transform-origin: bottom center;
    transform: translate(-50%, -82%) rotate(0deg);
}

.wizard-hero-icon[data-hero-icon="2"]::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 4px;
    background: rgba(240, 74, 166, 0.9);
    border-radius: 4px;
    transform-origin: left center;
    transform: translate(-2px, -50%) rotate(35deg);
} */

.wizard-card h2 {
    margin: 10px 0 0;
    text-align: center;
    font-size: var(--wiz-h2-size);
    letter-spacing: -0.02em;
    color: var(--wiz-title);
}

.wizard-description {
    font-weight: 600;
    color: var(--wiz-title);
    margin: 0;
    text-align: center;
    font-size: var(--wiz-desc-size);
    width: var(--wiz-section-width);
    margin-left: auto;
    margin-right: auto;
}

.wizard-detail {
    margin: 0;
    color: var(--wiz-text);
    line-height: 1.6;
    text-align: center;
}

.wizard-hint {
    margin: 0;
    font-size: var(--wiz-hint-size);
    color: var(--wiz-muted);
    text-align: center;
    width: var(--wiz-section-width);
    margin-left: auto;
    margin-right: auto;
}

.wizard-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.wizard-actions--layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: var(--wiz-section-width);
    margin-left: auto;
    margin-right: auto;
    margin-top: 18px;
    margin-top: auto;
    padding-top: 15px;
}

.wizard-actions-left,
.wizard-actions-center,
.wizard-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wizard-actions-left { justify-content: flex-start; }
.wizard-actions-center { justify-content: center; flex-wrap: wrap; }
.wizard-actions-right { justify-content: flex-end; }

.wizard-actions--split {
    justify-content: space-between;
}

.wizard-actions button {
    border-radius: 18px;
    padding: 10px 20px;
    font-weight: 700;
    min-height: 46px;
    font-size: var(--wiz-btn-font);
}

.wizard-actions--layout .wizard-actions-right > button {
    min-width: 130px;
}

.wizard-actions--layout .wizard-actions-left > button {
    min-width: 130px;
}

.wizard-actions button.primary {
    background: linear-gradient(135deg, var(--wiz-accent), var(--wiz-accent-2));
    border: none;
    color: #fff;
    box-shadow: 0 14px 35px rgba(240, 74, 166, 0.28);
}

.wizard-actions button.secondary {
    border: 2px solid rgba(30, 41, 59, 0.14);
    background: rgba(255, 255, 255, 0.6);
    color: var(--wiz-title);
}

.wizard-actions button.secondary:disabled,
.wizard-actions button.primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.training-wizard .wizard-actions button.primary:hover:not(:disabled) {
    box-shadow: 0 18px 45px rgba(240, 74, 166, 0.42);
    transform: translateY(-1px);
}
.wizard-header button.primary:hover:not(:disabled){
    box-shadow: 0 18px 45px rgba(240, 74, 166, 0.42);
    transform: translateY(-1px);
}

.training-wizard .wizard-actions button.secondary:hover:not(:disabled) {
    border-color: rgba(240, 74, 166, 0.55);
    box-shadow: 0 14px 35px rgba(240, 74, 166, 0.12);
    transform: translateY(-1px);
}

/* Перекриваємо глобальні сині hover-правила тільки всередині візарда */
.training-wizard button:hover:not(:disabled) {
    background: unset;
    color: inherit;
    box-shadow: none;
}

.training-wizard .wizard-actions button.primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--wiz-accent), var(--wiz-accent-2));
    color: #fff;
}

.training-wizard .wizard-actions button.secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.72);
    color: var(--wiz-title);
}

.training-wizard .btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--wiz-accent), var(--wiz-accent-2));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 14px 35px rgba(240, 74, 166, 0.28);
}

.wizard-choice-card {
    margin: 14px auto 0;
    width: min(760px, 100%);
    background: var(--wiz-card);
    border-radius: 22px;
    border: 2px solid rgba(30, 41, 59, 0.10);
    padding: 18px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
    cursor: pointer;
}

.wizard-choice-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--wiz-title);
    margin-bottom: 6px;
}

.wizard-choice-subtitle {
    color: var(--wiz-muted);
    font-size: 16px;
    line-height: 1.35;
}

.wizard-choice-check {
    width: 45px;
    height: 45px;
    border-radius: 999px;
    background: rgba(240, 74, 166, 0.16);
    position: relative;
    flex: 0 0 45px;
}

.wizard-choice-card.is-selected .wizard-choice-check {
    background: linear-gradient(135deg, var(--wiz-accent), var(--wiz-accent-2));
}

.wizard-choice-check::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 900;
    color: #fff;
}

.wizard-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
}

.wizard-step {
    display: inline-block;
    width: 14px;
    height: 14px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(30, 41, 59, 0.10);
    background: rgba(30, 41, 59, 0.22); /* сірий для непройдених */
    box-shadow: none;
    outline: none;
    user-select: none;
}

.wizard-step.is-active {
    background: #fff; /* білий для активного */
    border-color: rgba(240, 74, 166, 0.35);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
}

.wizard-step.is-completed {
    background: rgba(240, 74, 166, 0.65); /* рожевий для пройдених */
    border-color: rgba(240, 74, 166, 0.25);
}

.wizard-step.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.wizard-step:not(.is-disabled) {
    cursor: pointer;
}

.wizard-step:not(.is-disabled):hover {
    filter: brightness(1.04);
}

.wizard-step:not(.is-disabled):focus-visible {
    box-shadow: 0 0 0 3px rgba(240, 74, 166, 0.25);
}

.wizard-step-number {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    font-size: 0.85rem;
    line-height: 1;
}

.wizard-step.is-active .wizard-step-number {
    border-color: rgba(240, 74, 166, 0.75);
}

.wizard-step.is-completed .wizard-step-number {
    border-color: rgba(240, 74, 166, 0.45);
}

.wizard-step-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: rgba(240, 74, 166, 0.35);
    flex: 0 0 18px;
    /* Плейсхолдер: заміниш на свої іконки через background-image */
}

.wizard-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: var(--wiz-section-width);
    margin: 16px auto 0;
}

.wizard-option-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 90px; /* місце під індикатор справа */
}

.wizard-option-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--wiz-title);
    line-height: 1.1;
}

.wizard-option-subtitle {
    font-size: 16px;
    color: var(--wiz-muted);
    line-height: 1.25;
}

.wizard-radio-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 18px;
    border: 2px solid rgba(30, 41, 59, 0.10);
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.75);
    position: relative;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.wizard-radio-label:hover {
    border-color: rgba(240, 74, 166, 0.35);
}

.wizard-radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wizard-radio-label:has(input[type="radio"]:checked) {
    border-color: rgba(240, 74, 166, 0.55);
    background: rgba(255, 255, 255, 0.88);
}

.wizard-radio-label::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border-radius: 999px;
    border: 2px solid rgba(0, 0, 0, 0.28);
    background: rgba(255, 255, 255, 0.92);
}

.wizard-radio-label:has(input[type="radio"]:checked)::after {
    border-color: rgba(240, 74, 166, 0.55);
    background: linear-gradient(135deg, var(--wiz-accent), var(--wiz-accent-2));
}

.wizard-radio-label:has(input[type="radio"]:checked)::before {
    content: "✓";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    font-size: 23px;
    z-index: 1;
}

.wizard-duration-input {
    margin: 0px 0 16px 0;
    background: rgb(255 255 255);
    border-radius: 18px;
    border: 2px solid rgba(240, 74, 166, 0.55);
    width: var(--wiz-section-width);
    margin-left: auto;
    margin-right: auto;
}
.wizard-duration-input .block{
    padding: 12px;
}

.wizard-duration-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--wiz-title);
}

.wizard-duration-input .input-range {
    width: 100%;
}

/* Range: заливка треку зліва до повзунка (рожевий акцент) */
.input-range {
    accent-color: var(--wiz-accent);
    --fill: 0%;
    --track-h: 8px;
    --thumb-size: 15px;
    outline: none;
}

/* Chrome / Edge */
.input-range::-webkit-slider-runnable-track {
    height: var(--track-h);
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        var(--wiz-accent) 0%,
        var(--wiz-accent) var(--fill),
        rgba(30, 41, 59, 0.18) var(--fill),
        rgba(30, 41, 59, 0.18) 100%
    );
}

.input-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--thumb-size);
    height: var(--thumb-size);
    border-radius: 999px;
    background: #f04aa6;
    border: 4px solid #fff;
    box-shadow: 0 10px 26px rgba(240, 74, 166, 0.25);
    /* Центруємо thumb відносно треку незалежно від розмірів */
    margin-top: calc((var(--track-h) - var(--thumb-size)) / 2);
}

/* Firefox */
.input-range::-moz-range-track {
    height: var(--track-h);
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.18); /* права (не заповнена) частина */
}

.input-range::-moz-range-progress {
    height: var(--track-h);
    border-radius: 999px;
    background: var(--wiz-accent); /* ліва (заповнена) частина */
}

.input-range::-moz-range-thumb {
    width: var(--thumb-size);
    height: var(--thumb-size);
    border-radius: 999px;
    background: #f04aa6;
    border: 4px solid #fff;
    box-shadow: 0 10px 26px rgba(240, 74, 166, 0.25);
}

.range-ticks {
    /* margin-top: 10px; */
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--wiz-muted);
    font-size: 14px;
    user-select: none;
}

.range-ticks span {
    min-width: 20px;
    text-align: center;
}

.range-ticks--threshold span {
    min-width: 28px;
}

.wizard-channels {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: var(--wiz-section-width);
    margin: 16px auto 0;
}

.wizard-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 18px;
    border: 2px solid rgba(30, 41, 59, 0.10);
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.75);
    position: relative;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.wizard-checkbox-label:hover {
    border-color: rgba(240, 74, 166, 0.35);
}

.wizard-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wizard-checkbox-label:has(input[type="checkbox"]:checked) {
    border-color: rgba(240, 74, 166, 0.55);
    background: rgba(255, 255, 255, 0.88);
}

.wizard-checkbox-label::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border-radius: 999px;
    border: 2px solid rgba(30, 41, 59, 0.12);
    background: rgba(240, 74, 166, 0.08);
}

.wizard-checkbox-label:has(input[type="checkbox"]:checked)::after {
    border-color: rgba(240, 74, 166, 0.55);
    background: linear-gradient(135deg, var(--wiz-accent), var(--wiz-accent-2));
}

.wizard-checkbox-label:has(input[type="checkbox"]:checked)::before {
    content: "✓";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    font-size: 22px;
    z-index: 1;
}

/* Чекбокси у форматі title/subtitle — як у radio */
.wizard-checkbox-label .wizard-option-text {
    width: 100%;
}

.wizard-parameters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.wizard-parameters .wizard-checkbox-label {
    margin: 0;
}

.wizard-custom-range {
    margin: 0px 0 16px 0;
    background: rgb(255 255 255);
    border-radius: 18px;
    border: 2px solid rgba(240, 74, 166, 0.55);
    width: var(--wiz-section-width);
    margin-left: auto;
    margin-right: auto;
}

.wizard-custom-range label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--wiz-title);
}

.wizard-custom-range .block{
    padding: 12px;
}

.wizard-custom-range .input-range{
    width: 100%;
}

#adminPanel {
    color: var(--wiz-title);
}

.admin-actions {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

#adminStopTest.btn {
    background: rgba(255, 255, 255, 0.78);
    color: var(--wiz-title);
    border: 2px solid rgba(30, 41, 59, 0.14);
    border-radius: 18px;
    padding: 10px 20px;
    min-height: 46px;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

#adminStopTest.btn:hover:not(:disabled) {
    border-color: rgba(240, 74, 166, 0.55);
    box-shadow: 0 14px 35px rgba(240, 74, 166, 0.12);
    transform: translateY(-1px);
}

#adminStopTest.btn:active:not(:disabled) {
    transform: translateY(0px);
}

.range-slider-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.range-slider {
    position: relative;
    height: 50px;
    margin: 20px 0;
    padding: 0 10px;
}

.range-slider input[type="range"] {
    position: absolute;
    width: calc(100% - 20px);
    height: 6px;
    background: transparent;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #f04aa6;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    pointer-events: all;
    position: relative;
    z-index: 2;
}

.range-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #f04aa6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    pointer-events: all;
    position: relative;
    z-index: 2;
}

.range-slider::before {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    top: 22px;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    z-index: 0;
}

.range-slider #rangeStart {
    z-index: 3;
}

.range-slider #rangeEnd {
    z-index: 1;
}

.range-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #f04aa6;
}

.range-values strong {
    color: #f04aa6;
    font-size: 1.1rem;
}

.wizard-list {
    margin: 0;
    padding-left: 1.1rem;
    color: #1d2732;
}

.wizard-list li::marker {
    color: var(--wiz-accent);
}

.impedance-indicator {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 16px 0;
}

.wizard-signal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: var(--wiz-section-width);
    margin: 16px auto 0;
}

@media (max-width: 820px) {
    .wizard-signal-grid {
        grid-template-columns: 1fr;
    }
}

/* Калібрування: 2 колонки */
.wizard-calibration-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: var(--wiz-section-width);
    margin: 16px auto 0;
}

@media (max-width: 820px) {
    .wizard-calibration-grid {
        grid-template-columns: 1fr;
    }
}

.wizard-calibration-card.wizard-radio-label {
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 18px 18px;
}

.wizard-calibration-card.wizard-radio-label::after,
.wizard-calibration-card.wizard-radio-label::before {
    content: none !important;
    display: none !important;
}

.wizard-calibration-card .wizard-description {
    width: 100%;
    text-align: left;
    margin: 0;
}

.wizard-calibration-card .wizard-list {
    margin-top: 6px;
}

/* Картки “як wizard-radio-label”, але без радіо-індикатора справа */
.wizard-signal-card.wizard-radio-label {
    cursor: default;
    align-items: center;
    flex-direction: column;
    padding: 18px 18px;
}

.wizard-signal-card.wizard-radio-label::after,
.wizard-signal-card.wizard-radio-label::before {
    content: none !important;
    display: none !important;
}

.wizard-signal-card-title {
    font-weight: 800;
    color: var(--wiz-title);
    margin-bottom: 10px;
    font-size: 16px;
}

.signal-legend {
    display: grid;
    gap: 8px;
}

.signal-legend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--wiz-muted);
    font-weight: 600;
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.55);
    border: 2px solid rgba(30, 41, 59, 0.06);
}

.signal-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    flex: 0 0 14px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.10);
}

.signal-dot.good { background: #7ed957; }
.signal-dot.normal { background: #f7c948; }
.signal-dot.bad { background: #ff3b3b; }

.impedance-status {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.impedance-box {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    border: 1px solid;
    display: inline-block;
}

.impedance-box.good { border-color: #3ddc84; color: #116837; background: rgba(61, 220, 132, 0.1); }
.impedance-box.normal { border-color: #f7c948; color: #854900; background: rgba(247, 201, 72, 0.1); }
.impedance-box.bad { border-color: #ff7b7b; color: #7b0f0f; background: rgba(255, 123, 123, 0.1); }

.impedance-channels {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.impedance-channel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.55);
    border: 2px solid rgba(30, 41, 59, 0.06);
}

.impedance-channel-item .channel-name {
    font-weight: 600;
    min-width: 150px;
}

.impedance-channel-item .channel-status {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.impedance-value {
    padding: 12px;
    background: rgba(41, 171, 226, 0.1);
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
}

#wizardSignalValue {
    transition: color 0.3s ease, font-weight 0.2s ease;
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
}

#wizardSignalValue.signal-value-good {
    color: #116837;
    background: rgba(61, 220, 132, 0.15);
}

#wizardSignalValue.signal-value-normal {
    color: #854900;
    background: rgba(247, 201, 72, 0.15);
}

#wizardSignalValue.signal-value-bad {
    color: #7b0f0f;
    background: rgba(255, 123, 123, 0.15);
}

.wizard-start-actions {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.calibration-panel {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 16px;
}

.calibration-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 8px 4px;
}

.calibration-success-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    filter: drop-shadow(0 14px 28px rgba(240, 74, 166, 0.28));
}

.calibration-success-title {
    font-weight: 900;
    color: var(--wiz-title);
    font-size: 18px;
}

.calibration-success-subtitle {
    color: var(--wiz-muted);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.35;
    max-width: 520px;
}

.calibration-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 16px;
}

.calibration-actions .wizard-next-right {
    margin-left: auto;
}

.calibration-animation {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(41,171,226,0.5) 20%, rgba(41,171,226,0) 70%);
    animation: pulse 1.6s ease-in-out infinite;
}

.calibration-timer {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f3547;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

.calibration-actions button.secondary {
    background: transparent;
    border: 1px solid #29abe2;
    color: #29abe2;
}

.hidden {
    display: none !important;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /*background: #CDC9C0;*/
    /*background: linear-gradient(90deg,rgba(205, 201, 192, 1) 0%, rgba(127, 166, 189, 1) 100%);*/
    background: linear-gradient(90deg, rgb(236 234 229) 0%, rgb(172 194 207) 100%);
    /*border-bottom: 1px solid rgba(0, 255, 255, 0.2);*/
    padding: 8px 16px;
    /*font-family: 'Orbitron', sans-serif;*/
}

.controls {
    width: 40%;
    display: flex;
    gap: 10px;
}

button {
    background: transparent;
    border: 1px solid #29ABE2;
    /*color: #29ABE2;*/
    color: #000;
    /*font-family: 'Orbitron', sans-serif;*/
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover:not(:disabled) {
    background: #f04aa6;
    color: #000;
    box-shadow: 0 0 10px #f04aa6;
}

button:disabled,
button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.stats {
    width: 40%;
    justify-content: end;
    display: flex;
    gap: 16px;
    font-size: 14px;
}

.stats span {
    color: #f04aa6;
}

.container {
    display: flex;
    height: calc(100vh - 55px);
    padding: 30px 20px;
    box-sizing: border-box;
}

.left-panel {
    width: 27%;
    /*display: flex;*/
    /*flex-direction: column;*/
    /*justify-content: flex-start;*/
    /*gap: 30px;*/
    padding-right: 20px;
}

.right-panel {
    width: 73%;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/*.right-panel img {*/
/*    width: 80%;*/
/*    max-width: 420px;*/
/*    opacity: 0.85;*/
/*    filter: drop-shadow(0 0 30px #00ffff);*/
/*    animation: glowPulse 3s ease-in-out infinite;*/
/*}*/

@keyframes glowPulse {
    0%, 100% { filter: drop-shadow(0 0 20px #00ffff); }
    50% { filter: drop-shadow(0 0 40px #00ffff); }
}

canvas {
    width: 100%;
    height: 120px;
    /*background: radial-gradient(circle at top, #0d1625 0%, #050816 100%);*/
    border-radius: 4px;
    /*box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);*/
    animation: panelFade 1s ease;
}

@keyframes panelFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

#overlayCard {
    background: #0a1120;
    /*border: 1px solid #00ffff;*/
    border-radius: 6px;
    padding: 40px;
    /*color: #29ABE2;*/
    color: #000;

    /*box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);*/
    background: linear-gradient(90deg, rgb(236 234 229) 0%, rgb(172 194 207) 100%);
}

#fullscreen-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1000;
}
#fullscreen-btn img {
    width: 100%;
    height: 100%;
}
.form-select{
    outline: none;
    background: transparent;
    color: #f04aa6;
    border-color: #f04aa6;
    border-radius: 4px;
    cursor: pointer;
}
.brain-block{
    position: relative;
    max-width: 100vh;
    max-height: 100vh;
}
.scannerLine{
    position: absolute;
    right: 10px;
    bottom: 0px;
    left: 10px;
    height: 85%;
    width: 95%;
    pointer-events: none;
    display: block;
    top: 0% !important;
}

.plot-block {
    display: block;
    height: 140px; /* або яка у тебе висота графіка */
    margin-bottom: 30px;
}

.plot-hidden {
    opacity: 0;
    height: 0 !important;
    overflow: hidden;
    pointer-events: none;
    transition: all 0.25s ease;
    margin-bottom: 0px;
}

@keyframes fadeIn {
    from { opacity:0; transform:scale(0.92); }
    to   { opacity:1; transform:scale(1); }
}


#videoGallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.video-card {
    width: 110px;
    cursor: pointer;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.video-card.selected {
    border-color: #f04aa6;
    box-shadow: 0 0 0 1px rgba(41,171,226,0.6);
}

.video-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-color: #333;
}

.video-title {
    padding: 4px 6px 6px;
    font-size: 12px;
    text-align: center;
    color: #222;
    word-break: break-word;
    line-height: 13px;
    min-height: 30px;
}

/* Панель */
.test-panel {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(4px);
    padding: 20px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.15);

    font-family: "Segoe UI", sans-serif;
    color: #1a3c5c;

    display: none;
}

/* Заголовок */
.test-panel-title {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a3c5c;
}

/* Рядок із підписом */
.form-row {
    margin-bottom: 15px;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.input-number {
    padding: 4px 6px;
    width: 70px;
    border: 1px solid #8aa8c5;
    border-radius: 4px;
    background: white;
}

/* Кнопки */
.btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #5ca3ff;
    background: rgba(92,163,255,0.12);
    color: #1a3c5c;
    cursor: pointer;
    transition: 0.2s ease;
    font-size: 14px;
}

.btn:hover {
    background: #5ca3ff;
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Статус */
.status-text {
    font-size: 13px;
    opacity: 0.7;
}

/* Текст інфо */
.info-text {
    font-size: 13px;
    opacity: 0.7;
    margin-bottom: 10px;
}

/* Галерея відео */
.video-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Wizard: крок 3 — карусель (слайдер) по центру, як на макеті */
.wizard-card[data-step="3"] .wizard-video-carousel {
    width: var(--wiz-section-width);
    margin: 0 auto;
    position: relative;
    width: 100%;
    padding: 0;
    display: flex;
    justify-content: center;
    /* тінь/підкладка позаду як “плашка” */
    background: rgba(255, 255, 255, 0.55);
    border: 2px solid rgba(30, 41, 59, 0.08);
    border-radius: 999px;
    box-shadow: 0 18px 55px rgba(15, 23, 42, 0.10);
}

.wizard-card[data-step="3"] #videoSwiper.swiper {
    width: min(900px, 100%);
    padding: 26px 26px;
    overflow: hidden;
    border-radius: 200px;
}

.wizard-card[data-step="3"] #videoGallery.video-gallery.swiper-wrapper {
    /* Swiper керує позиціюванням, нам лише треба не ламати wrapper */
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    user-select: none;
}

.wizard-card[data-step="3"] .video-card {
    width: 110px;
    background: transparent;
    border: none;
    border-radius: 999px;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.wizard-card[data-step="3"] .video-card:hover {
    transform: scale(1.03);
    box-shadow: none;
}

.wizard-card[data-step="3"] .video-thumb {
    width: 80px;
    height: 80px;
    aspect-ratio: auto;
    border-radius: 999px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat!important;
    border: 6px solid transparent;
    /* box-shadow: 0 14px 38px rgba(15, 23, 42, 0.14); */
}

.wizard-card[data-step="3"] .video-card.selected {
    box-shadow: none;
    transform: scale(1.08);
 
}

.wizard-card[data-step="3"] .video-card.selected .video-thumb {
    /* box-shadow: 0 0 20px 10px rgba(240, 74, 166, 0.18), 0 18px 55px rgba(240, 74, 166, 0.25); */
    border: 6px solid rgb(245 79 166);
}

/* Хвилі (чекбокси) */
.wave-options {
    display: flex;
    align-items: center;
    justify-content: flex-start;
flex-wrap: wrap;
    gap: 6px;
}


.wave-options label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

/* Рядок дій */
.action-row {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.up-chart {
    width: 100%;
    height: 160px;
    margin-bottom: 18px;
    border-radius: 6px;
    overflow: hidden;
}

.uplot{
    width: 100%;
}

.test-panel--hidden {
    display: none;
}
.plot-block{
    position: relative;
}
.plot-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #6fc3ff;
    padding-left: 4px;
    position: absolute;
    right: 20px;
    top: 0px;
}

.toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 180, 90, 0.95);
    color: #fff;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    /*margin-right: 6px;*/
    border-radius: 50%;
    background: gray;
    vertical-align: middle;
}

.status-dot.online {
    background: #3ccf4e; /* зелений */
}

.status-dot.offline {
    background: #ff4b4b; /* червоний */
}
