/* ==========================================================================
   Centro de ayuda y Driver.js
   ========================================================================== */

.help-dialog {
    width: min(560px, calc(100vw - 26px));
}

.help-dialog__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-guides {
    display: grid;
    gap: 8px;
}

.help-guide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface-muted);
}

.help-guide__copy {
    min-width: 0;
}

.help-guide__copy strong {
    display: block;
    color: var(--ink);
    font-size: calc((11px) * var(--text-scale, 1));
    font-weight: 800;
    line-height: 1.3;
}

.help-guide__copy p {
    margin-top: 3px;
    color: var(--muted-strong);
    font-size: calc((9.5px) * var(--text-scale, 1));
    line-height: 1.5;
}

.help-guide__copy span {
    display: inline-block;
    margin-top: 5px;
    color: var(--muted);
    font-size: calc((7.5px) * var(--text-scale, 1));
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.help-guide > .btn {
    flex: 0 0 auto;
}

.help-empty {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 6px;
    padding: 28px 18px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-md);
    color: var(--muted);
    text-align: center;
}

.help-empty .icon {
    width: 27px;
    height: 27px;
    color: var(--muted-strong);
}

.help-empty strong {
    color: var(--ink);
    font-size: calc((11px) * var(--text-scale, 1));
    font-weight: 800;
}

.help-empty span {
    max-width: 330px;
    font-size: calc((9.5px) * var(--text-scale, 1));
    line-height: 1.5;
}

.help-dialog__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}

.help-dialog__hint {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: calc((8.5px) * var(--text-scale, 1));
}

/* Editor de pasos */
.help-steps-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.help-steps {
    display: grid;
    gap: 9px;
    margin-top: 7px;
}

.help-step-row {
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
}

.help-step-row__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.help-step-row__head strong {
    color: var(--muted-strong);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: calc((7.5px) * var(--text-scale, 1));
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.help-step-row__remove {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
}

.help-step-row__remove:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

.help-step-row__remove .icon {
    width: 13px;
    height: 13px;
}

.help-step-row .field-grid {
    gap: 8px;
}

.help-step-row .field + .field {
    margin-top: 8px;
}

.help-step-row .field-grid .field + .field {
    margin-top: 0;
}

.help-step-field {
    gap: 4px;
}

.help-step-field > span {
    color: var(--muted-strong);
    font-size: calc((7.5px) * var(--text-scale, 1));
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.help-step-field .input {
    min-height: 36px;
    font-size: calc((9px) * var(--text-scale, 1));
}

.help-step-field textarea.input {
    min-height: 58px;
    resize: vertical;
}

/* Driver.js con los tokens del sitio */
.driver-popover {
    max-width: 340px;
    min-width: 270px;
    padding: 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    color: var(--ink);
    background-color: var(--surface-elevated);
    box-shadow: var(--shadow-lg);
    font-family: var(--font-sans);
}

.driver-popover-title {
    padding-right: 24px;
    font-family: var(--font-display);
    font-size: calc((21px) * var(--text-scale, 1));
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.driver-popover-description {
    margin-top: 8px;
    color: var(--muted-strong);
    font-size: calc((11.5px) * var(--text-scale, 1));
    line-height: 1.6;
}

.driver-popover-footer {
    margin-top: 16px;
}

.driver-popover-progress-text {
    color: var(--muted);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: calc((8px) * var(--text-scale, 1));
    font-weight: 500;
}

.driver-popover-footer-btn {
    min-height: 30px;
    padding: 5px 11px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--ink);
    background: var(--surface);
    font-family: var(--font-sans);
    font-size: calc((9px) * var(--text-scale, 1));
    font-weight: 700;
    line-height: 1.2;
}

.driver-popover-footer-btn:hover,
.driver-popover-footer-btn:focus {
    border-color: var(--ink);
    background: var(--surface-muted);
}

.driver-popover-next-btn,
.driver-popover-done-btn {
    border-color: var(--accent);
    color: var(--inverse-ink);
    background: var(--accent);
}

.driver-popover-next-btn:hover,
.driver-popover-done-btn:hover,
.driver-popover-next-btn:focus,
.driver-popover-done-btn:focus {
    border-color: var(--accent-ink);
    color: var(--inverse-ink);
    background: var(--accent-ink);
}

.driver-popover-close-btn {
    top: 12px;
    right: 12px;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 17px;
}

.driver-popover-close-btn:hover,
.driver-popover-close-btn:focus-visible {
    color: var(--ink);
    background: var(--surface-muted);
}

.driver-popover-arrow {
    border-color: var(--surface-elevated);
}

@media (max-width: 560px) {
    .help-guide {
        align-items: stretch;
        flex-direction: column;
    }

    .help-guide > .btn {
        align-self: flex-start;
    }

    .driver-popover {
        max-width: calc(100vw - 22px);
        min-width: min(270px, calc(100vw - 22px));
    }
}
