:root {
    --shwsup-chat-primary: var(--shows-primary);
    --shwsup-chat-primary-dark: var(--shows-primary-hover);
    --shwsup-chat-ink: #1f1b18;
    --shwsup-chat-muted: #766a63;
    --shwsup-chat-surface: rgba(255, 255, 255, 0.98);
    --shwsup-chat-surface-soft: #f7f1ec;
    --shwsup-chat-border: rgba(94, 66, 46, 0.12);
    --shwsup-chat-shadow: 0 28px 60px rgba(58, 31, 12, 0.16);
    /* Surfaces that used to be fixed white, so night mode can change them. */
    --shwsup-chat-card: #fff;
    --shwsup-chat-thread-top: #fff8f3;
    --shwsup-chat-user-from: var(--shows-primary-soft);
    --shwsup-chat-user-to: color-mix(in srgb, var(--shows-primary) 22%, white);
    --shwsup-chat-warning-bg: #fff7ed;
    --shwsup-chat-clarify-bg: #f5f3ff;
    --shwsup-chat-selected-bg: #fff3e8;
    --shwsup-chat-notice-bg: linear-gradient(180deg, rgba(255, 248, 243, 0.96), rgba(255, 255, 255, 0.98));
    --shwsup-chat-tooltip-bg: #1f1b18;
    --shwsup-chat-tooltip-text: #fff;
    --shwsup-chat-layer: 1035;
}

.shwsup-chat-root,
.shwsup-chat-root *,
.shwsup-chat-root *::before,
.shwsup-chat-root *::after {
    box-sizing: border-box;
    font-family: 'Manrope', sans-serif;
}

.shwsup-chat-root {
    position: fixed;
    inset: 0;
    z-index: var(--shwsup-chat-layer);
    isolation: isolate;
    pointer-events: none;
    color: var(--shwsup-chat-ink);
}

.shwsup-chat-root a,
.shwsup-chat-root a:hover,
.shwsup-chat-root a:focus,
.shwsup-chat-root a:active {
    color: inherit !important;
    text-decoration: none !important;
}

.shwsup-chat-root button,
.shwsup-chat-root input {
    font: inherit;
}

.shwsup-chat-launcher__icon svg,
.shwsup-chat-form__field button svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* Compact round launcher: icon only, with the assistant's name as a hover/focus tooltip. */
.shwsup-chat-launcher {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2;
    width: 52px;
    height: 52px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--shwsup-chat-primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(58, 31, 12, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.shwsup-chat-launcher:hover,
.shwsup-chat-launcher:focus-visible {
    background: var(--shwsup-chat-primary-dark);
    transform: translateY(-1px);
}

.shwsup-chat-launcher:focus-visible {
    outline: 3px solid rgba(220, 91, 18, 0.35);
    outline-offset: 3px;
}

.shwsup-chat-root.is-open .shwsup-chat-launcher {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.shwsup-chat-launcher__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.shwsup-chat-launcher .shwsup-chat-launcher__icon svg {
    width: 30px;
    height: 26px;
}

.shwsup-chat-launcher__label {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--shwsup-chat-tooltip-bg);
    color: var(--shwsup-chat-tooltip-text);
    border: 1px solid var(--shwsup-chat-border);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(6px, -50%);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

@media (hover: hover) {
    .shwsup-chat-launcher:hover .shwsup-chat-launcher__label,
    .shwsup-chat-launcher:focus-visible .shwsup-chat-launcher__label {
        opacity: 1;
        transform: translate(0, -50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .shwsup-chat-launcher,
    .shwsup-chat-launcher__label {
        transition: none;
    }
}

.shwsup-chat-panel {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 3;
    width: min(420px, calc(100vw - 24px));
    height: min(720px, calc(100vh - 36px));
    background: var(--shwsup-chat-surface);
    border: 1px solid var(--shwsup-chat-border);
    border-radius: 28px;
    box-shadow: var(--shwsup-chat-shadow);
    overflow: hidden;
    display: none;
    flex-direction: column;
    backdrop-filter: blur(18px);
    pointer-events: auto;
}

.shwsup-chat-root.is-open .shwsup-chat-panel {
    display: flex;
}

.shwsup-chat-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 16px;
    color: #fff;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 34%),
        linear-gradient(135deg, var(--shwsup-chat-primary-dark), var(--shwsup-chat-primary));
}

.shwsup-chat-panel__identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shwsup-chat-panel__identity h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 668;
    line-height: 1.25;
    color: #fff;
}

.shwsup-chat-panel__identity p {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.88;
    color: rgba(255, 255, 255, 0.92);
}

.shwsup-chat-panel__avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.18);
    font-weight: 668;
    color: #fff;
}

.shwsup-chat-panel__close {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.shwsup-chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background:
        radial-gradient(circle at top right, rgba(220, 91, 18, 0.05), transparent 28%),
        linear-gradient(180deg, var(--shwsup-chat-thread-top), var(--shwsup-chat-card) 34%);
}

.shwsup-chat-row {
    display: flex;
    margin-bottom: 14px;
}

.shwsup-chat-row--user {
    justify-content: flex-end;
}

.shwsup-chat-bubble {
    max-width: 88%;
    padding: 14px 15px;
    border-radius: 20px;
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 13px;
    color: var(--shwsup-chat-ink);
}

.shwsup-chat-row--bot .shwsup-chat-bubble {
    background: var(--shwsup-chat-card);
    border: 1px solid var(--shwsup-chat-border);
    box-shadow: 0 10px 24px rgba(70, 46, 29, 0.05);
}

.shwsup-chat-row--user .shwsup-chat-bubble {
    background: linear-gradient(135deg, var(--shwsup-chat-user-from), var(--shwsup-chat-user-to));
    border: 1px solid rgba(220, 91, 18, 0.15);
}

.shwsup-chat-bubble--warning {
    background: var(--shwsup-chat-warning-bg) !important;
    border-color: rgba(217, 119, 6, 0.22) !important;
}

.shwsup-chat-bubble--clarification {
    background: var(--shwsup-chat-clarify-bg) !important;
    border-color: rgba(109, 40, 217, 0.14) !important;
}

.shwsup-chat-actions,
.shwsup-chat-feedback {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.shwsup-chat-action,
.shwsup-chat-feedback button,
.shwsup-chat-chip {
    border: 1px solid var(--shwsup-chat-border);
    background: var(--shwsup-chat-card);
    color: var(--shwsup-chat-ink);
    border-radius: 999px;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.shwsup-chat-action:hover,
.shwsup-chat-action:focus,
.shwsup-chat-chip:hover,
.shwsup-chat-chip:focus,
.shwsup-chat-feedback button:hover,
.shwsup-chat-feedback button:focus {
    color: inherit !important;
    text-decoration: none !important;
}

.shwsup-chat-action--primary {
    background: var(--shwsup-chat-primary);
    color: #fff !important;
    border-color: transparent;
}

.shwsup-chat-feedback button.is-selected {
    background: var(--shwsup-chat-selected-bg);
    border-color: rgba(220, 91, 18, 0.30);
    color: var(--shwsup-chat-primary-dark);
}

.shwsup-chat-suggestions {
    padding: 0 18px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--shwsup-chat-card);
}

.shwsup-chat-navnotice {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 12px;
    background: var(--shwsup-chat-notice-bg);
    border-top: 1px solid rgba(220, 91, 18, 0.10);
    color: var(--shwsup-chat-primary-dark);
    font-size: 12px;
    font-weight: 700;
}

.shwsup-chat-navnotice.is-visible {
    display: flex;
}

.shwsup-chat-navnotice::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--shwsup-chat-primary);
    box-shadow: 0 0 0 6px rgba(220, 91, 18, 0.10);
}

.shwsup-chat-form {
    border-top: 1px solid var(--shwsup-chat-border);
    background: var(--shwsup-chat-card);
    padding: 16px 18px 18px;
}

.shwsup-chat-form__field {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--shwsup-chat-surface-soft);
    border: 1px solid var(--shwsup-chat-border);
    border-radius: 18px;
    padding: 8px 10px 8px 14px;
}

.shwsup-chat-form__field input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 16px;
    color: var(--shwsup-chat-ink);
    padding: 0;
    margin: 0;
    line-height: 1.4;
}

.shwsup-chat-form__field button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 14px;
    background: var(--shwsup-chat-primary);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
    line-height: 0;
    flex: 0 0 40px;
}

.shwsup-chat-form__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
}

.shwsup-chat-form__meta button,
.shwsup-chat-form__hint {
    border: none;
    background: transparent;
    color: var(--shwsup-chat-muted);
    font-weight: 700;
}

.shwsup-chat-form__meta button {
    cursor: pointer;
}

.shwsup-chat-typing {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.shwsup-chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(130, 101, 79, 0.55);
    animation: shwsup-chat-bounce 1.2s infinite ease-in-out;
}

.shwsup-chat-typing span:nth-child(2) {
    animation-delay: 0.16s;
}

.shwsup-chat-typing span:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes shwsup-chat-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.55; }
    40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 767px) {
    .shwsup-chat-launcher {
        right: 14px;
        bottom: 14px;
        width: 48px;
        height: 48px;
    }

    .shwsup-chat-panel {
        right: 12px;
        left: 12px;
        bottom: 12px;
        width: auto;
        height: calc(100vh - 24px);
        max-height: none;
        border-radius: 26px;
    }
}

/* Event creation in the chat: chip that starts it, image steps. */
.shwsup-chat-chip--primary {
    background: var(--shwsup-chat-primary);
    border-color: transparent;
    color: #fff;
}

.shwsup-chat-chip--primary:hover,
.shwsup-chat-chip--primary:focus {
    color: #fff !important;
    background: var(--shwsup-chat-primary-dark);
}

.shwsup-chat-text {
    white-space: pre-wrap;
}

.shwsup-chat-image {
    display: block;
    max-width: 100%;
    max-height: 180px;
    margin-top: 8px;
    border-radius: 12px;
    object-fit: cover;
}

.shwsup-chat-form__field .shwsup-chat-attach {
    background: transparent;
    border: 1px solid var(--shwsup-chat-border);
    color: var(--shwsup-chat-primary);
}

.shwsup-chat-form__field .shwsup-chat-attach[hidden] {
    display: none;
}

/* Compact task workspace. Stage labels describe sections, not an estimated percentage. */
.shwsup-chat-panel { width: min(460px, calc(100vw - 24px)); border-radius: 20px; }
.shwsup-chat-panel__header { padding: 16px 18px; }
.shwsup-chat-panel__identity .shwsup-chat-panel__title {
    margin: 0; font-size: 16px; font-weight: 600; opacity: 1; color: #fff;
}
.shwsup-chat-stage {
    padding: 12px 18px; background: var(--shwsup-chat-surface-soft);
    color: var(--shwsup-chat-ink); font-size: 14px; font-weight: 500;
    border-bottom: 1px solid var(--shwsup-chat-border);
}
.shwsup-chat-stage[hidden] { display: none; }
.shwsup-chat-thread { min-height: 120px; overscroll-behavior: contain; scrollbar-width: thin; }
.shwsup-chat-bubble { font-size: 14px; border-radius: 14px; overflow-wrap: anywhere; }
.shwsup-chat-bubble--success { border-left: 3px solid #278445 !important; }
.shwsup-chat-action, .shwsup-chat-chip, .shwsup-chat-feedback button {
    min-height: 44px; font-size: 14px; font-weight: 500; border-radius: 10px;
}
.shwsup-chat-suggestions { flex-shrink: 0; max-height: 180px; overflow-y: auto; padding-top: 12px; }
.is-event-flow .shwsup-chat-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.is-event-flow .shwsup-chat-chip { text-align: left; overflow-wrap: anywhere; }
.shwsup-chat-form { padding: 12px 18px; flex-shrink: 0; }
.shwsup-chat-form__field { border-radius: 12px; align-items: flex-end; }
.shwsup-chat-form__field textarea {
    font: inherit; font-size: 16px; line-height: 1.5; width: 100%; min-width: 0;
    max-height: 150px; padding: 8px 0; border: 0; background: transparent;
    color: var(--shwsup-chat-ink); resize: none; outline: none; box-shadow: none;
}
.shwsup-chat-form__field:focus-within { border-color: var(--shwsup-chat-primary); }
.shwsup-chat-form__field .shwsup-chat-typed-input {
    font: inherit; font-size: 16px; min-width: 0; min-height: 44px;
    flex: 1; padding: 8px 0; box-shadow: none; border-radius: 0;
}
.shwsup-chat-form__field [hidden], .shwsup-chat-form__meta [hidden] { display: none !important; }
.shwsup-chat-typed-input::-webkit-date-and-time-value { text-align: left; }
.shwsup-chat-form__field .shwsup-chat-choice-input {
    flex: 1; width: 100%; min-width: 0; min-height: 44px;
    font: inherit; font-size: 16px; color: var(--shwsup-chat-ink);
    background: transparent; border: 0; border-radius: 0; padding: 8px 4px;
}
.shwsup-chat-form__field .shwsup-chat-duration-unit {
    flex: 0 1 auto; width: auto; max-width: 45%; min-height: 44px;
    font: inherit; font-size: 16px; color: var(--shwsup-chat-ink);
    background: transparent; border: 0; border-radius: 0; padding: 8px 4px;
}
.shwsup-chat-form__meta button { min-height: 32px; padding: 4px 0; }
.shwsup-chat-root button:focus-visible, .shwsup-chat-root a:focus-visible {
    outline: 2px solid var(--shwsup-chat-primary); outline-offset: 3px;
}
.shwsup-chat-root button:disabled { opacity: .5; cursor: wait; }
.shwsup-chat-root .shwsup-chat-action--primary,
.shwsup-chat-root .shwsup-chat-action--primary:hover,
.shwsup-chat-root .shwsup-chat-action--primary:focus { color: #fff !important; }
.shwsup-chat-form__field button { width: 44px; height: 44px; flex-basis: 44px; border-radius: 10px; }
.shwsup-chat-form__meta button { font-weight: 500; }
.is-attaching .shwsup-chat-attach { outline: 2px solid var(--shwsup-chat-primary); outline-offset: 2px; }
@media (max-width: 767px) {
    .shwsup-chat-panel {
        width: auto; height: calc(100dvh - 24px); border-radius: 18px;
        bottom: max(12px, env(safe-area-inset-bottom));
    }
    .shwsup-chat-suggestions { max-height: 140px; }
}
@media (prefers-reduced-motion: reduce) {
    .shwsup-chat-typing span { animation: none; }
}

.shwsup-chat-flow-tools {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px;
}
.shwsup-chat-flow-tools[hidden], .shwsup-chat-suggestions[hidden] { display: none; }
.shwsup-chat-flow-tools .shwsup-chat-chip {
    border: 0; background: transparent; padding: 6px 0; min-height: 36px;
    color: var(--shwsup-chat-muted); font-size: 13px;
}
.shwsup-chat-flow-tools .shwsup-chat-chip:hover { color: var(--shwsup-chat-primary-dark) !important; }
.shwsup-chat-bubble--review { max-width: 100%; width: 100%; }
.shwsup-chat-review { white-space: normal; }
.shwsup-chat-review__section + .shwsup-chat-review__section {
    border-top: 1px solid var(--shwsup-chat-border); margin-top: 12px; padding-top: 12px;
}
.shwsup-chat-review p { margin: 0; white-space: pre-wrap; }
.shwsup-chat-review__label { font-weight: 600; font-size: 14px; }
.shwsup-chat-review__value { margin-top: 5px !important; font-size: 14px; }
.is-attaching .shwsup-chat-form__field { flex-wrap: wrap; }
.shwsup-chat-form__field .shwsup-chat-attach--label {
    flex: 0 0 100%; width: 100%; font-size: 14px; font-weight: 500;
    line-height: 1.4; background: var(--shwsup-chat-card); outline: 0; border: 1px dashed var(--shwsup-chat-primary);
}
.is-attaching .shwsup-chat-form__field textarea { flex: 1; }

/* Small banner above the launcher: "waiting for your reply" or "Need help?". */
.shwsup-chat-nudge {
    position: fixed;
    right: 18px;
    bottom: 82px;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    width: min(300px, calc(100vw - 36px));
    border: 1px solid var(--shwsup-chat-border);
    border-radius: 16px;
    background: var(--shwsup-chat-card);
    box-shadow: var(--shwsup-chat-shadow);
    color: var(--shwsup-chat-ink);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.shwsup-chat-nudge.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.shwsup-chat-nudge[hidden] {
    display: none;
}

/* Pointer towards the launcher. */
.shwsup-chat-nudge::after {
    content: "";
    position: absolute;
    right: 20px;
    bottom: -7px;
    width: 12px;
    height: 12px;
    border-right: 1px solid var(--shwsup-chat-border);
    border-bottom: 1px solid var(--shwsup-chat-border);
    background: var(--shwsup-chat-card);
    transform: rotate(45deg);
}

.shwsup-chat-root.is-open .shwsup-chat-nudge {
    display: none;
}

.shwsup-chat-nudge__body {
    display: grid;
    flex: 1 1 auto;
    gap: 3px;
    min-width: 0;
    padding: 12px 4px 12px 14px;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 16px 0 0 16px;
}

.shwsup-chat-nudge__body:hover,
.shwsup-chat-nudge__body:focus-visible {
    background: var(--shwsup-chat-surface-soft);
    color: var(--shwsup-chat-ink);
}

.shwsup-chat-nudge__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.shwsup-chat-nudge__text {
    display: -webkit-box;
    overflow: hidden;
    color: var(--shwsup-chat-muted);
    font-size: 13px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.shwsup-chat-nudge__text[hidden] {
    display: none;
}

.shwsup-chat-nudge__close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    margin: 6px 6px 0 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--shwsup-chat-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.shwsup-chat-nudge__close:hover,
.shwsup-chat-nudge__close:focus-visible {
    background: var(--shwsup-chat-surface-soft);
    color: var(--shwsup-chat-ink);
}

@media (max-width: 767px) {
    .shwsup-chat-nudge {
        right: 14px;
        bottom: 74px;
        width: min(300px, calc(100vw - 28px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .shwsup-chat-nudge {
        transition: none;
    }
}

/* Night mode: the same layout on dark surfaces. night-mode.css colours every p grey,
   so text inside the widget keeps the widget's own colour. */
:is(html.night-mode, html[data-theme="dark"]) .shwsup-chat-root {
    --shwsup-chat-ink: #f3f4f6;
    --shwsup-chat-muted: #a1a1aa;
    --shwsup-chat-surface: rgba(26, 29, 31, 0.98);
    --shwsup-chat-surface-soft: #24272b;
    --shwsup-chat-border: rgba(255, 255, 255, 0.1);
    --shwsup-chat-shadow: 0 28px 60px rgba(0, 0, 0, 0.5);
    --shwsup-chat-card: #1a1d1f;
    --shwsup-chat-thread-top: color-mix(in srgb, var(--shows-primary) 6%, #1a1d1f);
    --shwsup-chat-user-from: color-mix(in srgb, var(--shows-primary) 20%, #1a1d1f);
    --shwsup-chat-user-to: color-mix(in srgb, var(--shows-primary) 28%, #1a1d1f);
    --shwsup-chat-warning-bg: color-mix(in srgb, var(--shows-primary) 20%, #1a1d1f);
    --shwsup-chat-clarify-bg: #261f3d;
    --shwsup-chat-selected-bg: var(--shows-primary-soft);
    --shwsup-chat-notice-bg: color-mix(in srgb, var(--shows-primary) 6%, #1a1d1f);
    --shwsup-chat-tooltip-bg: #24272b;
    --shwsup-chat-tooltip-text: #f3f4f6;
    color-scheme: dark;
}

:is(html.night-mode, html[data-theme="dark"]) .shwsup-chat-root p,
:is(html.night-mode, html[data-theme="dark"]) .shwsup-chat-root h3,
:is(html.night-mode, html[data-theme="dark"]) .shwsup-chat-root h4 {
    color: inherit;
}

:is(html.night-mode, html[data-theme="dark"]) .shwsup-chat-feedback button.is-selected {
    color: var(--shows-primary);
}
