:root {
    --botan-graphite: #3f413d;
    --botan-graphite-deep: #30322f;
    --botan-paper: #f4f1ea;
    --botan-white: #fff;
    --botan-orange: #ff5a14;
    --botan-ink: #3f413d;
    --botan-muted: #777872;
    --botan-line: #c9c7c0;
}

.botan-widget,
.botan-widget * {
    box-sizing: border-box;
}

.botan-widget {
    position: fixed;
    z-index: 9100;
    right: 24px;
    bottom: 88px;
    color: var(--botan-ink);
    font-family: Manrope, Arial, sans-serif;
}

.botan-widget button,
.botan-widget textarea {
    font: inherit;
}

.botan-widget__launcher {
    display: grid;
    grid-template-columns: 52px auto;
    align-items: center;
    min-height: 58px;
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--botan-orange);
    border-radius: 4px;
    background: var(--botan-graphite);
    color: var(--botan-white);
    box-shadow: 0 18px 46px rgb(25 27 24 / 22%);
    cursor: pointer;
}

.botan-widget__invitation {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(320px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid rgb(34 36 33 / 24%);
    border-top: 3px solid var(--botan-orange);
    border-radius: 4px;
    background: var(--botan-paper);
    box-shadow: 0 22px 60px rgb(25 27 24 / 26%);
}

.botan-widget__invitation[hidden] {
    display: none;
}

.botan-widget__invitation-main {
    display: grid;
    width: 100%;
    gap: 5px;
    padding: 17px 48px 17px 18px;
    border: 0;
    background: transparent;
    color: var(--botan-ink);
    text-align: left;
    cursor: pointer;
}

.botan-widget__invitation-main > span {
    color: var(--botan-orange);
    font: 600 11px/1 Oswald, sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.botan-widget__invitation-main > strong {
    font: 500 22px/1 Oswald, sans-serif;
    text-transform: uppercase;
}

.botan-widget__invitation-main > small {
    color: var(--botan-muted);
    font-size: 12px;
    line-height: 1.42;
}

.botan-widget__invitation-close {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.botan-widget__invitation-close span::before,
.botan-widget__invitation-close span::after {
    position: absolute;
    top: 16px;
    left: 9px;
    width: 16px;
    height: 1px;
    background: var(--botan-ink);
    content: '';
}

.botan-widget__invitation-close span::before { transform: rotate(45deg); }
.botan-widget__invitation-close span::after { transform: rotate(-45deg); }

.botan-widget__launcher > span {
    display: grid;
    align-self: stretch;
    place-items: center;
    border-right: 1px solid rgb(255 255 255 / 18%);
    font: 600 30px/1 Oswald, sans-serif;
}

.botan-widget__launcher small {
    padding: 0 16px;
    font: 600 12px/1 Oswald, sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.botan-widget__launcher:focus-visible,
.botan-widget button:focus-visible,
.botan-widget textarea:focus-visible,
.botan-widget__voice:focus-visible,
.botan-widget__attach:focus-within {
    outline: 3px solid #fff;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px var(--botan-orange);
}

.botan-widget__panel {
    position: absolute;
    display: flex;
    flex-direction: column;
    right: 0;
    bottom: 0;
    width: min(402px, calc(100vw - 32px));
    max-height: min(680px, calc(100vh - 32px));
    overflow: hidden;
    border: 1px solid rgb(34 36 33 / 24%);
    border-radius: 6px;
    background: var(--botan-paper);
    box-shadow: 0 28px 80px rgb(25 27 24 / 32%);
}

.botan-widget__panel[hidden] {
    display: none;
}

.botan-widget__header {
    position: relative;
    min-height: 112px;
    padding: 22px 72px 18px 24px;
    overflow: hidden;
    background: var(--botan-graphite);
    color: var(--botan-white);
}

.botan-widget__header p,
.botan-widget__intro > p {
    margin: 0 0 5px;
    color: var(--botan-orange);
    font: 600 12px/1.2 Oswald, sans-serif;
    letter-spacing: .08em;
}

.botan-widget__header h2 {
    margin: 0;
    font: 500 30px/1 Oswald, sans-serif;
}

.botan-widget__status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    font-size: 11px;
    text-transform: uppercase;
}

.botan-widget__status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #38c56c;
    box-shadow: 0 0 0 3px rgb(56 197 108 / 15%);
}

.botan-widget__route {
    position: absolute;
    right: 42px;
    bottom: -1px;
    width: 84px;
    height: 84px;
    border-right: 3px solid var(--botan-orange);
    border-bottom: 3px solid var(--botan-orange);
    transform: skewY(-48deg) translateY(52px);
    transform-origin: right bottom;
}

.botan-widget__header > button {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.botan-widget__header > button span::before,
.botan-widget__header > button span::after {
    position: absolute;
    top: 17px;
    left: 8px;
    width: 20px;
    height: 1px;
    background: #fff;
    content: '';
}

.botan-widget__header > button span::before { transform: rotate(45deg); }
.botan-widget__header > button span::after { transform: rotate(-45deg); }

.botan-widget__body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(min(680px, 100vh - 32px) - 112px);
    padding: 20px 20px 14px;
    overflow: auto;
    overscroll-behavior: contain;
}

.botan-widget__intro h3 {
    max-width: 330px;
    margin: 0 0 16px;
    font: 500 clamp(25px, 4vw, 31px)/.98 Oswald, sans-serif;
    letter-spacing: -.025em;
    text-transform: uppercase;
}

.botan-widget__conversation {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.botan-widget__message {
    width: 91%;
    padding: 13px 14px;
    border: 1px solid var(--botan-line);
    background: var(--botan-white);
}

.botan-widget__message--visitor {
    justify-self: end;
    border-color: var(--botan-orange);
    background: #fff5ef;
}

.botan-widget__message--pending {
    width: auto;
    min-width: 126px;
    color: var(--botan-muted);
}

.botan-widget__message--pending p::after {
    display: inline-block;
    width: 1.2em;
    overflow: hidden;
    vertical-align: bottom;
    content: '...';
}

.botan-widget__message span {
    display: block;
    margin-bottom: 5px;
    color: var(--botan-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.botan-widget__message p {
    margin: 0;
    font-size: 13px;
    line-height: 1.48;
}

.botan-widget__quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.botan-widget__quick-actions button {
    display: grid;
    gap: 4px;
    min-height: 54px;
    padding: 8px 9px;
    border: 1px solid var(--botan-orange);
    border-radius: 3px;
    background: transparent;
    color: var(--botan-orange);
    font: 500 13px/1 Oswald, sans-serif;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
}

.botan-widget__quick-actions button span {
    color: var(--botan-muted);
    font: 700 9px/1 Manrope, sans-serif;
}

.botan-widget__estimate-now {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    width: 100%;
    gap: 3px 12px;
    margin: 0 0 10px;
    padding: 10px 42px 10px 12px;
    border: 1px solid var(--botan-graphite);
    border-radius: 3px;
    background: transparent;
    color: var(--botan-graphite);
    text-align: left;
    cursor: pointer;
}

.botan-widget__estimate-now strong {
    font: 600 13px/1 Oswald, sans-serif;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.botan-widget__estimate-now span {
    grid-column: 1;
    color: var(--botan-muted);
    font-size: 10px;
    line-height: 1.35;
}

.botan-widget__estimate-now i {
    position: absolute;
    top: 50%;
    right: 13px;
    color: var(--botan-orange);
    font: normal 20px/1 Manrope, sans-serif;
    transform: translateY(-50%);
}

.botan-widget__estimate-now:disabled {
    cursor: wait;
    opacity: .55;
}

.botan-widget__composer {
    border-top: 1px solid var(--botan-line);
    padding-top: 10px;
}

.botan-widget__input-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.botan-widget__composer textarea {
    display: block;
    width: 100%;
    min-height: 112px;
    max-height: 180px;
    resize: none;
    border: 1px solid var(--botan-line);
    border-radius: 3px 3px 0 0;
    padding: 12px 58px 12px 12px;
    background: var(--botan-white);
    color: var(--botan-ink);
    font-size: 13px;
    line-height: 1.4;
}

.botan-widget__input-shell {
    position: relative;
}

.botan-widget__voice {
    position: absolute;
    right: 9px;
    bottom: 9px;
    display: grid;
    width: 40px;
    height: 40px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--botan-orange);
    color: #fff;
    cursor: pointer;
}

.botan-widget__voice svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentcolor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.botan-widget__voice > span {
    display: none;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: currentcolor;
}

.botan-widget__voice[aria-pressed="true"] {
    background: var(--botan-graphite-deep);
    box-shadow: 0 0 0 4px rgb(255 90 20 / 24%);
}

.botan-widget__voice[aria-pressed="true"] svg {
    display: none;
}

.botan-widget__voice[aria-pressed="true"] > span {
    display: block;
}

.botan-widget__voice:disabled {
    cursor: wait;
    opacity: .62;
}

.botan-widget__recording-status {
    min-height: 0;
    margin: 6px 2px 0;
    color: var(--botan-orange);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
}

.botan-widget__recording-status:empty {
    display: none;
}

.botan-widget__composer-actions {
    display: grid;
    grid-template-columns: 1fr 1.08fr;
}

.botan-widget__attach,
.botan-widget__composer-actions > button {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 12px;
    border: 0;
    cursor: pointer;
}

.botan-widget__attach {
    gap: 5px;
    border: 1px solid var(--botan-line);
    border-top: 0;
    background: #ebe8e1;
    color: var(--botan-muted);
    font-size: 11px;
    font-weight: 700;
}

.botan-widget__attach input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.botan-widget__composer-actions > button {
    justify-content: space-between;
    background: var(--botan-orange);
    color: #fff;
    font: 600 13px/1 Oswald, sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.botan-widget__file-status {
    min-height: 0;
    margin: 6px 0 0;
    color: var(--botan-muted);
    font-size: 10px;
}

.botan-widget__file-status:empty {
    display: none;
}

.botan-widget__trust {
    display: grid;
    gap: 3px;
    margin-top: 10px;
    color: var(--botan-muted);
    font-size: 10px;
}

.botan-widget__trust p,
.botan-widget__trust strong {
    margin: 0;
}

.botan-widget__trust p:first-child span {
    color: #38a861;
}

.botan-widget__trust strong {
    color: var(--botan-orange);
    font-size: 9px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

@media (hover: hover) {
    .botan-widget__launcher:hover,
    .botan-widget__composer-actions > button:hover,
    .botan-widget__voice:hover {
        background: #282a27;
    }

    .botan-widget__quick-actions button:hover {
        background: var(--botan-orange);
        color: #fff;
    }

    .botan-widget__estimate-now:hover {
        border-color: var(--botan-orange);
        color: var(--botan-orange);
    }
}

@media (max-width: 640px) {
    .botan-widget {
        right: 12px;
        bottom: 76px;
    }

    .botan-widget__launcher small {
        display: none;
    }

    .botan-widget__launcher {
        grid-template-columns: 54px;
        min-width: 54px;
    }

    .botan-widget__invitation {
        right: 0;
        bottom: 68px;
        width: min(316px, calc(100vw - 24px));
    }

    .botan-widget__panel {
        position: fixed;
        inset: 8px 8px calc(76px + env(safe-area-inset-bottom));
        width: auto;
        max-height: none;
    }

    .botan-widget__body {
        display: flex;
        flex-direction: column;
        max-height: none;
    }

    .botan-widget__conversation {
        flex: 1 1 auto;
        align-content: start;
        min-height: 72px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .botan-widget__message--pending p::after {
        animation: botan-typing-dots 1s steps(4, end) infinite;
    }

    .botan-widget__invitation:not([hidden]) {
        animation: botan-invitation-in 220ms ease-out both;
        transform-origin: right bottom;
    }

    .botan-widget__panel:not([hidden]) {
        animation: botan-panel-in 180ms ease-out both;
        transform-origin: right bottom;
    }

    @keyframes botan-panel-in {
        from { opacity: 0; transform: translateY(12px) scale(.98); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }

    @keyframes botan-typing-dots {
        from { width: 0; }
        to { width: 1.2em; }
    }

    @keyframes botan-invitation-in {
        from { opacity: 0; transform: translateY(8px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

@media (prefers-reduced-motion: reduce) {
    .botan-widget *,
    .botan-widget *::before,
    .botan-widget *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
