.librya-copilot {
    position: fixed;
    right: 0.95rem;
    bottom: 0.95rem;
    z-index: 60;
    pointer-events: none;
}

.librya-copilot-panel,
.librya-copilot-launcher {
    pointer-events: auto;
}

.librya-copilot-panel {
    width: min(300px, calc(100vw - 1.25rem));
    max-height: calc(100vh - 1.25rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid rgba(116, 236, 255, 0.2);
    border-radius: 1.2rem;
    padding: 0.8rem;
    background:
        radial-gradient(circle at top, rgba(89, 220, 255, 0.16), transparent 28%),
        linear-gradient(180deg, rgba(7, 19, 39, 0.96), rgba(4, 12, 24, 0.97));
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.42),
        0 0 28px rgba(89, 220, 255, 0.12),
        inset 0 0 18px rgba(89, 220, 255, 0.05);
    backdrop-filter: blur(16px);
}

.librya-copilot-panel[hidden] {
    display: none;
}

.librya-copilot-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
}

.librya-copilot-hero {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.librya-copilot-hero-copy {
    min-width: 0;
}

.librya-copilot-kicker {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(178, 245, 255, 0.72);
}

.librya-copilot-hero-copy h3 {
    margin: 0.25rem 0 0;
    font-size: 0.92rem;
    line-height: 1.2;
    font-weight: 700;
    color: rgba(245, 254, 255, 0.96);
}

.librya-copilot-hero-copy p {
    margin: 0.25rem 0 0;
    font-size: 0.72rem;
    line-height: 1.35;
    color: rgba(206, 248, 255, 0.76);
}

.librya-copilot-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid rgba(116, 236, 255, 0.18);
    border-radius: 999px;
    background: rgba(7, 18, 34, 0.74);
    color: rgba(238, 253, 255, 0.78);
    font-size: 0.95rem;
    line-height: 1;
    transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.librya-copilot-close:hover {
    transform: translateY(-1px);
    border-color: rgba(146, 244, 255, 0.28);
    color: rgba(250, 254, 255, 1);
}

.librya-copilot-progress {
    margin-top: 0.8rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(116, 236, 255, 0.12);
    border-radius: 0.9rem;
    background: rgba(7, 20, 40, 0.54);
}

.librya-copilot-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(182, 245, 255, 0.7);
}

.librya-copilot-progress-meta strong {
    color: rgba(248, 254, 255, 0.96);
}

.librya-copilot-progress-track {
    margin-top: 0.45rem;
    height: 0.34rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 38, 66, 0.9);
}

.librya-copilot-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(66, 229, 255, 0.92), rgba(165, 120, 255, 0.92));
    box-shadow: 0 0 14px rgba(89, 220, 255, 0.24);
}

.librya-copilot-progress-caption {
    margin-top: 0.35rem;
    font-size: 0.66rem;
    color: rgba(204, 248, 255, 0.68);
}

.librya-copilot-next {
    margin-top: 0.8rem;
    padding: 0.7rem;
    border: 1px solid rgba(142, 244, 255, 0.16);
    border-radius: 0.95rem;
    background:
        linear-gradient(180deg, rgba(11, 34, 64, 0.72), rgba(6, 18, 34, 0.36));
}

.librya-copilot-pwa {
    margin-top: 0.8rem;
    padding: 0.68rem 0.72rem;
    border: 1px solid rgba(255, 209, 110, 0.16);
    border-radius: 0.95rem;
    background:
        linear-gradient(180deg, rgba(44, 30, 8, 0.54), rgba(12, 16, 32, 0.34));
    box-shadow: inset 0 0 16px rgba(255, 208, 106, 0.05);
}

.librya-copilot-pwa[hidden] {
    display: none;
}

.librya-copilot-pwa-kicker {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 222, 154, 0.78);
}

.librya-copilot-pwa-title {
    margin-top: 0.28rem;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.3;
    color: rgba(250, 254, 255, 0.95);
}

.librya-copilot-pwa-copy {
    margin-top: 0.24rem;
    font-size: 0.66rem;
    line-height: 1.42;
    color: rgba(230, 247, 255, 0.72);
}

.librya-copilot-pwa-actions {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    margin-top: 0.58rem;
}

.librya-copilot-pwa-install {
    flex: 1 1 auto;
    min-height: 2rem;
    margin-top: 0;
    padding-inline: 0.7rem;
    border-color: rgba(255, 214, 125, 0.18);
    background:
        linear-gradient(180deg, rgba(96, 68, 14, 0.54), rgba(24, 19, 7, 0.34));
    box-shadow:
        0 0 14px rgba(255, 214, 125, 0.08),
        inset 0 0 10px rgba(255, 214, 125, 0.05);
}

.librya-copilot-pwa-install:hover {
    border-color: rgba(255, 226, 153, 0.26);
    box-shadow:
        0 0 18px rgba(255, 214, 125, 0.12),
        inset 0 0 12px rgba(255, 214, 125, 0.07);
}

.librya-copilot-pwa-ok {
    flex: 0 0 auto;
    min-width: 2.7rem;
    min-height: 2rem;
    padding: 0.48rem 0.62rem;
    border: 1px solid rgba(116, 236, 255, 0.14);
    border-radius: 0.78rem;
    background: rgba(6, 18, 34, 0.54);
    color: rgba(237, 252, 255, 0.84);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.librya-copilot-pwa-ok:hover {
    transform: translateY(-1px);
    border-color: rgba(146, 244, 255, 0.24);
    color: rgba(250, 254, 255, 0.96);
}

.librya-copilot-next-kicker {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 214, 125, 0.82);
}

.librya-copilot-next-title {
    margin-top: 0.32rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: rgba(249, 254, 255, 0.96);
}

.librya-copilot-next-order {
    margin-top: 0.24rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(180, 245, 255, 0.62);
}

.librya-copilot-next-text {
    margin-top: 0.25rem;
    font-size: 0.7rem;
    line-height: 1.35;
    color: rgba(205, 248, 255, 0.72);
}

.librya-copilot-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.65rem;
    min-height: 2.15rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(146, 244, 255, 0.24);
    border-radius: 0.8rem;
    background:
        linear-gradient(180deg, rgba(17, 48, 90, 0.84), rgba(7, 19, 38, 0.38));
    color: rgba(245, 254, 255, 0.95);
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 0 16px rgba(89, 220, 255, 0.1), inset 0 0 10px rgba(89, 220, 255, 0.06);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.librya-copilot-primary:hover {
    transform: translateY(-1px);
    border-color: rgba(166, 247, 255, 0.34);
    box-shadow: 0 0 20px rgba(89, 220, 255, 0.14), inset 0 0 12px rgba(89, 220, 255, 0.08);
}

.librya-copilot-single-step {
    margin-top: 0.8rem;
}

.librya-copilot-step {
    display: grid;
    grid-template-columns: 1.55rem minmax(0, 1fr);
    gap: 0.6rem;
    padding: 0.62rem 0.68rem;
    border: 1px solid rgba(116, 236, 255, 0.1);
    border-radius: 0.85rem;
    background: rgba(5, 15, 28, 0.46);
}

.librya-copilot-step.is-done {
    border-color: rgba(96, 255, 193, 0.16);
    background: rgba(11, 36, 34, 0.44);
}

.librya-copilot-step-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    border: 1px solid rgba(146, 244, 255, 0.18);
    background: rgba(10, 28, 48, 0.72);
    color: rgba(188, 246, 255, 0.84);
    font-size: 0.74rem;
    font-weight: 700;
}

.librya-copilot-step.is-done .librya-copilot-step-marker {
    border-color: rgba(96, 255, 193, 0.24);
    background: rgba(10, 46, 34, 0.82);
    color: rgba(169, 255, 224, 0.92);
}

.librya-copilot-step-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
}

.librya-copilot-step-head strong {
    font-size: 0.72rem;
    color: rgba(245, 254, 255, 0.95);
}

.librya-copilot-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.05rem;
    padding: 0.1rem 0.34rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 214, 125, 0.18);
    background: rgba(255, 194, 86, 0.08);
    color: rgba(255, 224, 154, 0.88);
    font-size: 0.54rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.librya-copilot-step-copy p {
    margin: 0.32rem 0 0;
    font-size: 0.66rem;
    line-height: 1.45;
    color: rgba(206, 248, 255, 0.68);
}

.librya-copilot-after {
    margin-top: 0.6rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(116, 236, 255, 0.1);
    border-radius: 0.85rem;
    background: rgba(5, 15, 28, 0.38);
}

.librya-copilot-after.is-complete {
    margin-top: 1rem;
    border-color: rgba(96, 255, 193, 0.16);
    background: rgba(11, 36, 34, 0.36);
}

.librya-copilot-after-kicker {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(178, 245, 255, 0.64);
}

.librya-copilot-after-title {
    margin-top: 0.28rem;
    font-size: 0.7rem;
    line-height: 1.32;
    color: rgba(239, 253, 255, 0.88);
}

.librya-copilot-launcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.15rem;
    height: 3.15rem;
    padding: 0.4rem;
    border: 1px solid rgba(116, 236, 255, 0.18);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(7, 19, 39, 0.96), rgba(4, 12, 24, 0.92));
    color: rgba(242, 254, 255, 0.94);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38), 0 0 18px rgba(89, 220, 255, 0.1);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.librya-copilot-launcher[hidden] {
    display: none;
}

.librya-copilot-launcher:hover {
    transform: translateY(-1px);
    border-color: rgba(146, 244, 255, 0.28);
}

.librya-copilot-launcher-copy {
    display: none;
}

.librya-copilot-bot {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
}

.librya-copilot-bot--compact {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
}

.librya-copilot-bot-head,
.librya-copilot-bot-ring,
.librya-copilot-bot-eye,
.librya-copilot-bot-mouth {
    position: absolute;
}

.librya-copilot-bot-head {
    inset: 8px 8px 11px;
    border: 2px solid rgba(115, 238, 255, 0.98);
    border-radius: 13px 13px 15px 15px;
    box-shadow:
        0 0 14px rgba(76, 233, 255, 0.38),
        0 0 28px rgba(173, 106, 255, 0.22),
        inset 0 0 12px rgba(173, 106, 255, 0.12);
}

.librya-copilot-bot-head::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 6px;
    width: 22px;
    height: 10px;
    border-top: 2px solid rgba(115, 238, 255, 0.98);
    border-left: 2px solid rgba(115, 238, 255, 0.98);
    border-radius: 12px 0 0 0;
    transform: skewX(-22deg);
    box-shadow: 0 0 14px rgba(76, 233, 255, 0.28);
}

.librya-copilot-bot-ring {
    left: 3px;
    right: 3px;
    bottom: 0;
    height: 14px;
    border-left: 2px solid rgba(173, 106, 255, 0.88);
    border-bottom: 2px solid rgba(173, 106, 255, 0.88);
    border-radius: 0 0 21px 18px;
    opacity: 0.9;
    box-shadow: 0 0 16px rgba(173, 106, 255, 0.24);
}

.librya-copilot-bot-eye {
    top: 22px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(181, 248, 255, 1);
    box-shadow: 0 0 10px rgba(115, 238, 255, 0.8);
}

.librya-copilot-bot-eye--left {
    left: 16px;
}

.librya-copilot-bot-eye--right {
    right: 16px;
}

.librya-copilot-bot-mouth {
    left: 50%;
    bottom: 17px;
    width: 12px;
    height: 5px;
    margin-left: -6px;
    border-bottom: 2px solid rgba(181, 248, 255, 0.96);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 0 8px rgba(115, 238, 255, 0.36);
}

@media (max-width: 640px) {
    .librya-copilot {
        right: 0.55rem;
        bottom: 0.55rem;
        left: auto;
    }

    .librya-copilot-panel {
        width: min(260px, calc(100vw - 0.75rem));
        max-width: calc(100vw - 0.75rem);
    }

    .librya-copilot-launcher {
        width: 2.95rem;
        height: 2.95rem;
        padding: 0.35rem;
    }

    .librya-copilot-panel {
        max-height: calc(100vh - 0.85rem);
        padding: 0.7rem;
    }

    .librya-copilot-hero {
        gap: 0.55rem;
    }

    .librya-copilot-bot {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .librya-copilot-pwa-actions {
        flex-wrap: wrap;
    }

    .librya-copilot-pwa-install,
    .librya-copilot-pwa-ok {
        width: 100%;
    }
}
