.repi-widget {
    --repi-ink: #102f3c;
    --repi-blue: #087ca7;
    --repi-blue-deep: #07526f;
    --repi-cyan: #17bebb;
    --repi-green: #159a72;
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    width: 84px;
    height: 84px;
    color: var(--repi-ink);
    font-family: Montserrat, sans-serif;
    line-height: 1.35;
    pointer-events: none;
}

.repi-widget,
.repi-widget * {
    box-sizing: border-box;
    letter-spacing: 0;
}

.repi-launch,
.repi-panel,
.repi-prompt {
    pointer-events: auto;
}

.repi-launch {
    position: relative;
    display: grid;
    width: 84px;
    height: 84px;
    place-items: center;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.repi-launch img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 11px 11px rgba(3, 73, 98, .28));
    animation: repi-patrol 4.5s ease-in-out infinite;
    transition: transform .18s ease, filter .18s ease;
}

.repi-launch:hover,
.repi-launch:focus-visible {
    border-radius: 18px;
    outline: 3px solid rgba(23, 190, 187, .32);
    outline-offset: 3px;
}

.repi-launch:hover img,
.repi-launch:focus-visible img {
    animation-play-state: paused;
    filter: drop-shadow(0 13px 12px rgba(3, 73, 98, .35));
    transform: translateY(-3px) scale(1.04);
}

.repi-launch-fallback {
    display: grid;
    width: 68px;
    height: 68px;
    margin: auto;
    place-items: center;
    border-radius: 50%;
    background: var(--repi-blue);
    box-shadow: 0 10px 25px rgba(3, 73, 98, .3);
    color: #fff;
    font-size: 28px;
}

.repi-prompt {
    position: absolute;
    right: 0;
    bottom: 96px;
    width: min(290px, calc(100vw - 28px));
    border: 1px solid #d0e4ec;
    border-radius: 13px 13px 0 13px;
    padding: 14px 38px 14px 16px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(12, 59, 76, .18);
    opacity: 1;
    transform: none;
    animation: repi-prompt-in .28s ease-out;
}

.repi-prompt[hidden] {
    display: none;
}

.repi-prompt strong,
.repi-prompt span {
    display: block;
}

.repi-prompt strong {
    color: #0b4d67;
    font-size: 15px;
}

.repi-prompt span {
    margin-top: 3px;
    color: #5d7380;
    font-size: 12px;
}

.repi-prompt-close,
.repi-close {
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.repi-prompt-close {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    color: #66808c;
}

.repi-prompt-close:hover {
    background: #edf7fa;
    color: #07526f;
}

.repi-panel {
    position: absolute;
    right: 0;
    bottom: 96px;
    width: min(400px, calc(100vw - 24px));
    max-height: min(680px, calc(100vh - 122px));
    overflow: hidden;
    border: 1px solid #d0e4ec;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 24px 58px rgba(8, 48, 66, .28);
    transform-origin: bottom right;
    animation: repi-panel-in .22s ease-out;
}

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

.repi-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 78px;
    padding: 13px 15px;
    background: linear-gradient(125deg, #07526f 0%, #087ca7 62%, #117f78 100%);
    color: #fff;
}

.repi-avatar {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 11px;
    background: rgba(255, 255, 255, .11);
}

.repi-head img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    filter: drop-shadow(0 4px 5px rgba(2, 34, 47, .25));
    transition: opacity .16s ease, transform .16s ease;
}

.repi-head strong,
.repi-head small {
    display: block;
}

.repi-head strong {
    font-size: 16px;
}

.repi-head small {
    margin-top: 2px;
    color: rgba(255, 255, 255, .8);
    font-size: 11px;
}

.repi-head small i {
    margin-right: 4px;
    color: #70f2ce;
    font-size: 6px;
    vertical-align: middle;
}

.repi-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
}

.repi-close:hover,
.repi-close:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, .14);
}

.repi-body {
    max-height: min(590px, calc(100vh - 200px));
    overflow-y: auto;
    padding: 17px;
    background: radial-gradient(circle at 100% 0, rgba(23, 190, 187, .06), transparent 200px), #fff;
    scrollbar-width: thin;
    scrollbar-color: #b7d3df transparent;
}

.repi-body p {
    margin: 0 0 14px;
    color: #496674;
    font-size: 13px;
    line-height: 1.55;
}

.repi-topics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 15px;
}

.repi-topics button {
    display: flex;
    min-width: 0;
    min-height: 47px;
    align-items: center;
    gap: 8px;
    border: 1px solid #cfe0e8;
    border-radius: 8px;
    padding: 8px 9px;
    background: #f6fafc;
    color: #294e5f;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.repi-topics button i {
    width: 22px;
    flex: 0 0 22px;
    color: var(--repi-blue);
    font-size: 15px;
    text-align: center;
}

.repi-topics button span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.repi-topics button:hover,
.repi-topics button.active {
    border-color: var(--repi-cyan);
    background: #eaf9f7;
    color: #075c59;
    transform: translateY(-1px);
}

.repi-topics button.active i {
    color: var(--repi-green);
}

.repi-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.repi-fields[hidden] {
    display: none !important;
}

.repi-field {
    display: grid;
    min-width: 0;
    gap: 4px;
    color: #355565;
    font-size: 11px;
    font-weight: 700;
}

.repi-field-wide {
    grid-column: 1 / -1;
}

.repi-field > span small {
    color: #7a8f99;
    font-size: 10px;
    font-weight: 500;
}

.repi-field input,
.repi-field textarea,
.repi-compose textarea {
    width: 100%;
    border: 1px solid #c7d9e2;
    border-radius: 8px;
    color: #123543;
    background: #fff;
    font: inherit;
    font-size: 13px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.repi-field input {
    min-height: 40px;
    padding: 8px 10px;
}

.repi-field textarea {
    min-height: 72px;
    padding: 10px;
    resize: vertical;
}

.repi-field input:focus,
.repi-field textarea:focus,
.repi-compose textarea:focus {
    border-color: var(--repi-blue);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(8, 124, 167, .12);
}

.repi-consent {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 7px;
    margin: 2px 0;
    color: #607783;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.45;
}

.repi-consent input {
    margin-top: 2px;
    accent-color: var(--repi-blue);
}

.repi-consent a {
    color: #08749a;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.repi-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.repi-primary {
    display: flex;
    grid-column: 1 / -1;
    width: 100%;
    min-height: 45px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 9px;
    padding: 11px 14px;
    background: linear-gradient(120deg, #087ca7, #086994);
    box-shadow: 0 8px 18px rgba(8, 105, 148, .2);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.repi-primary:hover {
    background: linear-gradient(120deg, #076f96, #075779);
    box-shadow: 0 10px 22px rgba(8, 91, 128, .25);
    transform: translateY(-1px);
}

.repi-primary:disabled,
.repi-compose button:disabled {
    opacity: .55;
    cursor: wait;
}

.repi-error {
    grid-column: 1 / -1;
    border: 1px solid #f0b8bd;
    border-radius: 7px;
    padding: 9px 10px;
    background: #fff0f1;
    color: #8b2630;
    font-size: 11px;
}

.repi-messages {
    display: grid;
    gap: 9px;
    max-height: 355px;
    overflow-y: auto;
    padding: 2px 3px 10px;
}

.repi-msg {
    max-width: 86%;
    justify-self: start;
    border: 1px solid #d5e5ec;
    border-radius: 10px 10px 10px 3px;
    padding: 9px 11px;
    background: #f3f8fa;
    color: #294e5f;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.repi-msg.visitor {
    justify-self: end;
    border-color: var(--repi-blue);
    border-radius: 10px 10px 3px 10px;
    background: var(--repi-blue);
    color: #fff;
}

.repi-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 45px;
    gap: 8px;
    margin-top: 11px;
}

.repi-compose textarea {
    min-height: 49px;
    padding: 9px 10px;
    resize: none;
}

.repi-compose button {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: var(--repi-blue);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.repi-compose button:hover {
    background: var(--repi-blue-deep);
}

.repi-note {
    display: block;
    margin-top: 9px;
    color: #718791;
    font-size: 10px;
    text-align: center;
}

.repi-note i {
    margin-right: 3px;
    color: var(--repi-green);
}

@keyframes repi-patrol {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-3px) rotate(-5deg); }
    50% { transform: translateY(0) rotate(0); }
    75% { transform: translateY(-2px) rotate(5deg); }
}

@keyframes repi-panel-in {
    from { opacity: 0; transform: translateY(11px) scale(.96); }
    to { opacity: 1; transform: none; }
}

@keyframes repi-prompt-in {
    from { opacity: 0; transform: translateY(10px) scale(.96); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 500px) {
    .repi-widget {
        right: 10px;
        bottom: 10px;
        width: 74px;
        height: 74px;
    }

    .repi-launch {
        width: 74px;
        height: 74px;
    }

    .repi-panel,
    .repi-prompt {
        right: 0;
        bottom: 86px;
    }

    .repi-panel {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 106px);
    }

    .repi-body {
        max-height: calc(100vh - 184px);
        padding: 14px;
    }

    .repi-head {
        min-height: 70px;
        padding: 10px 13px;
    }

    .repi-fields {
        grid-template-columns: 1fr;
    }

    .repi-field,
    .repi-field-wide,
    .repi-consent,
    .repi-error,
    .repi-primary {
        grid-column: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .repi-launch img,
    .repi-panel,
    .repi-prompt {
        animation: none;
    }

    .repi-primary,
    .repi-topics button {
        transition: none;
    }
}
