:root {
    --iw-guide-bg: rgba(11, 12, 15, .985);
    --iw-guide-surface: rgba(22, 23, 28, .985);
    --iw-guide-border: rgba(213, 180, 91, .38);
    --iw-guide-gold: #d5b45b;
    --iw-guide-gold-strong: #f0d783;
    --iw-guide-text: #f4f0e6;
    --iw-guide-muted: #aaa59b;
}

body.iw-guide-active {
    overflow-x: hidden;
}

.iw-guide-root {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: none;
    font-family: inherit;
}

.iw-guide-root *,
.iw-guide-root *::before,
.iw-guide-root *::after {
    box-sizing: border-box;
}

.iw-guide-focus {
    position: fixed;
    z-index: 2147483001;
    border: 2px solid rgba(240, 215, 131, .98);
    border-radius: 14px;
    box-shadow:
        0 0 0 9999px rgba(2, 3, 5, .72),
        0 0 0 5px rgba(213, 180, 91, .13),
        0 0 34px rgba(213, 180, 91, .42);
    transition: left .22s ease, top .22s ease, width .22s ease, height .22s ease;
    pointer-events: none;
}

.iw-guide-focus::after {
    content: '';
    position: absolute;
    inset: -7px;
    border: 1px solid rgba(240, 215, 131, .22);
    border-radius: 18px;
    animation: iw-guide-pulse 1.8s ease-in-out infinite;
}

@keyframes iw-guide-pulse {
    0%, 100% { opacity: .3; transform: scale(1); }
    50% { opacity: .85; transform: scale(1.015); }
}

.iw-guide-tooltip {
    position: fixed;
    z-index: 2147483002;
    width: min(470px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    overflow: auto;
    padding: 17px 18px 15px;
    color: var(--iw-guide-text);
    background:
        radial-gradient(circle at 94% 0, rgba(213, 180, 91, .10), transparent 34%),
        linear-gradient(180deg, rgba(22, 23, 28, .992), rgba(8, 9, 12, .994));
    border: 1px solid var(--iw-guide-border);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .58), inset 0 1px rgba(255, 255, 255, .035);
    backdrop-filter: blur(18px);
    pointer-events: auto;
}

.iw-guide-tooltip__topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--iw-guide-muted);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: .02em;
}

.iw-guide-speaking {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 7px;
    color: var(--iw-guide-gold-strong);
}

.iw-guide-speaking__icon {
    width: 21px;
    height: 21px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 21px;
    border: 1px solid rgba(213, 180, 91, .26);
    border-radius: 7px;
    background: rgba(213, 180, 91, .08);
}

.iw-guide-speaking[data-speaking="true"] .iw-guide-speaking__icon {
    animation: iw-guide-speaker 1.05s ease-in-out infinite;
}

@keyframes iw-guide-speaker {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(213, 180, 91, .05); }
    50% { transform: scale(1.08); box-shadow: 0 0 0 5px rgba(213, 180, 91, .08); }
}

.iw-guide-progress {
    flex: 0 0 auto;
    color: #c8c2b6;
    font-variant-numeric: tabular-nums;
}

.iw-guide-tooltip h2 {
    margin: 0 0 8px;
    color: #fffaf0;
    font-size: 18px;
    line-height: 1.3;
    letter-spacing: -.01em;
}

.iw-guide-tooltip p {
    margin: 0;
    color: #ddd8cd;
    font-size: 14px;
    line-height: 1.62;
}

.iw-guide-tooltip__hint {
    display: block;
    margin-top: 8px;
    color: #969188;
    font-size: 11px;
    line-height: 1.45;
}

.iw-guide-voice-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 11px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.iw-guide-voice-row__label {
    margin-right: 2px;
    color: var(--iw-guide-muted);
    font-size: 11px;
    font-weight: 720;
}

.iw-guide-rate {
    min-width: 38px;
    color: var(--iw-guide-gold-strong);
    text-align: center;
    font-size: 11px;
    font-weight: 820;
    font-variant-numeric: tabular-nums;
}

.iw-guide-small-button,
.iw-guide-button {
    border: 1px solid rgba(255, 255, 255, .13);
    background: rgba(255, 255, 255, .045);
    color: #eeebe3;
    font: inherit;
    cursor: pointer;
}

.iw-guide-small-button {
    min-width: 32px;
    height: 30px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 780;
}

.iw-guide-small-button[aria-pressed="true"] {
    color: #171107;
    background: linear-gradient(145deg, var(--iw-guide-gold-strong), #b68b31);
    border-color: rgba(255, 235, 166, .48);
}

.iw-guide-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 13px;
}

.iw-guide-button {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 760;
}

.iw-guide-button--exit {
    border-color: transparent;
    background: transparent;
    color: #aaa59b;
}

.iw-guide-button--primary {
    margin-left: auto;
    color: #171107;
    background: linear-gradient(145deg, var(--iw-guide-gold-strong), #b68b31);
    border-color: rgba(255, 235, 166, .48);
    box-shadow: inset 0 1px rgba(255, 255, 255, .28);
}

.iw-guide-button:disabled,
.iw-guide-small-button:disabled {
    opacity: .42;
    cursor: default;
}

.iw-guide-button:not(:disabled):hover,
.iw-guide-button:not(:disabled):focus-visible,
.iw-guide-small-button:not(:disabled):hover,
.iw-guide-small-button:not(:disabled):focus-visible {
    filter: brightness(1.08);
    outline: 2px solid rgba(240, 215, 131, .34);
    outline-offset: 2px;
}

.iw-guide-target {
    scroll-margin: 110px 24px;
}

.iw-guide-target.iw-guide-target--attention {
    animation: iw-guide-target-attention .72s ease;
}

@keyframes iw-guide-target-attention {
    0%, 100% { outline-color: transparent; }
    44% { outline: 2px solid rgba(240, 215, 131, .74); outline-offset: 4px; }
}

@media (max-width: 720px) {
    .iw-guide-tooltip {
        left: 10px !important;
        right: 10px !important;
        bottom: max(10px, env(safe-area-inset-bottom)) !important;
        top: auto !important;
        width: auto;
        max-height: min(52vh, 520px);
        border-radius: 16px;
    }

    .iw-guide-focus {
        border-radius: 11px;
    }

    .iw-guide-tooltip h2 { font-size: 16px; }
    .iw-guide-tooltip p { font-size: 13px; line-height: 1.55; }
    .iw-guide-actions { gap: 6px; }
    .iw-guide-button { padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .iw-guide-focus,
    .iw-guide-focus::after,
    .iw-guide-speaking[data-speaking="true"] .iw-guide-speaking__icon,
    .iw-guide-target.iw-guide-target--attention {
        animation: none !important;
        transition: none !important;
    }
}
