/* Aqua Malacca — concierge chat */

.aqua-chat {
    --ac-ink: #1a1816;
    --ac-paper: #f7f4ef;
    --ac-paper-2: #fbfaf7;
    --ac-cream: #f3ead8;
    --ac-gold: #b68a45;
    --ac-gold-line: rgba(182, 138, 69, 0.45);
    --ac-text: #1a1816;
    --ac-muted: rgba(26, 24, 22, 0.52);
    --ac-faint: rgba(26, 24, 22, 0.34);
    --ac-line: rgba(26, 24, 22, 0.1);
    --ac-z: 10050;
    --ac-serif: "Cormorant Garamond", "Times New Roman", serif;
    --ac-sans: "Inter", "Segoe UI", sans-serif;
    position: fixed;
    right: max(22px, env(safe-area-inset-right, 0px));
    bottom: max(22px, env(safe-area-inset-bottom, 0px));
    z-index: var(--ac-z);
    font-family: var(--ac-sans);
    color: var(--ac-text);
    -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] .aqua-chat {
    --ac-ink: #f4efe6;
    --ac-paper: #121110;
    --ac-paper-2: #181614;
    --ac-cream: #f4efe6;
    --ac-gold: #d4b483;
    --ac-gold-line: rgba(212, 180, 131, 0.4);
    --ac-text: #f4efe6;
    --ac-muted: rgba(244, 239, 230, 0.58);
    --ac-faint: rgba(244, 239, 230, 0.38);
    --ac-line: rgba(244, 239, 230, 0.1);
}

html.aqua-chat-lock,
body.aqua-chat-lock {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.aqua-chat__panel,
.aqua-chat__messages,
.aqua-chat__channels,
.aqua-chat__composer textarea {
    overscroll-behavior: contain;
}

html.is-hero-top .aqua-chat__launcher {
    opacity: 0.42;
}

html.is-hero-top .aqua-chat__launcher:hover,
html.is-hero-top .aqua-chat__launcher:focus-visible {
    opacity: 1;
}

.aqua-chat__launcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    padding: 0;
    border: 1px solid rgba(182, 138, 69, 0.55);
    border-radius: 50%;
    background: #f7f4ef;
    color: #1a1816;
    cursor: pointer;
    box-shadow: 0 16px 40px rgba(26, 24, 22, 0.22);
}

.aqua-chat__launcher:focus-visible {
    outline: none;
}

.aqua-chat__launcher:focus-visible .aqua-chat__launcher-icon {
    outline: 1px solid var(--ac-gold);
    outline-offset: 4px;
}

.aqua-chat__launcher-ring {
    display: none;
}

.aqua-chat__launcher-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.aqua-chat__launcher-icon {
    position: relative;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: inherit;
}

.aqua-chat.is-open .aqua-chat__launcher {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.aqua-chat__launcher:hover {
    transform: translateY(-2px);
}

.aqua-chat__launcher-icon svg {
    width: 22px;
    height: 22px;
    grid-area: 1 / 1;
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.aqua-chat__icon-close {
    opacity: 0;
    transform: scale(0.6);
}

.aqua-chat.is-open .aqua-chat__icon-open {
    opacity: 0;
    transform: scale(0.6);
}

.aqua-chat.is-open .aqua-chat__icon-close {
    opacity: 1;
    transform: scale(1);
}

.aqua-chat.is-open .aqua-chat__launcher-label {
    opacity: 0;
    transform: translateX(8px);
    width: 0;
    overflow: hidden;
    pointer-events: none;
}

.aqua-chat__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 16px);
    width: min(380px, calc(100vw - 36px));
    height: min(600px, calc(100vh - 120px));
    display: none;
    flex-direction: column;
    border: 1px solid var(--ac-line);
    border-top: 1px solid var(--ac-gold-line);
    border-radius: 18px;
    background: var(--ac-paper);
    box-shadow: 0 28px 70px rgba(26, 24, 22, 0.12);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
}

html[data-theme="dark"] .aqua-chat__panel {
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
}

.aqua-chat__panel[hidden] {
    display: none !important;
}

.aqua-chat.is-open .aqua-chat__panel,
.aqua-chat.is-open .aqua-chat__panel[hidden] {
    display: flex !important;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.aqua-chat__panel-glow {
    display: none;
}

.aqua-chat__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 22px 16px;
    flex-shrink: 0;
}

.aqua-chat__header-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.aqua-chat__avatar {
    width: 36px;
    height: 36px;
    margin-top: 2px;
    border-radius: 50%;
    border: 1px solid var(--ac-gold-line);
    color: var(--ac-gold);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.aqua-chat__avatar svg {
    width: 18px;
    height: 18px;
}

.aqua-chat__header-copy {
    min-width: 0;
}

.aqua-chat__kicker {
    margin: 0 0 2px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ac-gold);
}

.aqua-chat__title {
    margin: 0;
    font-family: var(--ac-serif);
    font-size: 1.65rem;
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: 0.01em;
    color: var(--ac-text);
}

.aqua-chat__status {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 7px 0 0;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ac-faint);
}

.aqua-chat__status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ac-gold);
}

.aqua-chat__close {
    width: 32px;
    height: 32px;
    margin-top: 2px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ac-faint);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.aqua-chat__close:hover {
    color: var(--ac-text);
}

.aqua-chat__close:focus-visible {
    outline: 1px solid var(--ac-gold);
    outline-offset: 2px;
}

.aqua-chat__close svg {
    width: 14px;
    height: 14px;
}

.aqua-chat__tabs {
    display: flex;
    gap: 22px;
    margin: 0 22px;
    padding: 0;
    border-bottom: 1px solid var(--ac-line);
    flex-shrink: 0;
}

.aqua-chat__tab {
    position: relative;
    padding: 0 0 12px;
    border: 0;
    background: transparent;
    color: var(--ac-faint);
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.2s ease;
}

.aqua-chat__tab:hover {
    color: var(--ac-text);
}

.aqua-chat__tab.is-active {
    color: var(--ac-text);
}

.aqua-chat__tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: var(--ac-gold);
}

.aqua-chat__tab:focus-visible {
    outline: 1px solid var(--ac-gold);
    outline-offset: 3px;
}

.aqua-chat__body {
    flex: 1;
    min-height: 0;
    padding: 18px 22px 18px;
    display: flex;
    flex-direction: column;
}

.aqua-chat__view {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.aqua-chat__view[hidden] {
    display: none !important;
}

.aqua-chat__view.is-active,
.aqua-chat__view.is-active:not([hidden]) {
    display: flex !important;
}

.aqua-chat__intro {
    margin-bottom: 8px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ac-line);
    flex-shrink: 0;
}

.aqua-chat__intro-title {
    margin: 0 0 6px;
    font-family: var(--ac-serif);
    font-size: 1.55rem;
    font-weight: 400;
    font-style: italic;
    line-height: 1.1;
    color: var(--ac-text);
}

.aqua-chat__intro-text {
    margin: 0;
    max-width: 30ch;
    font-size: 13px;
    line-height: 1.55;
    color: var(--ac-muted);
}

.aqua-chat__channels {
    display: flex;
    flex-direction: column;
    overflow: auto;
    flex: 1;
    min-height: 0;
    margin: 0 -6px;
    padding: 0 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(182, 138, 69, 0.45) transparent;
}

.aqua-chat__channel {
    display: grid;
    grid-template-columns: 34px 1fr 14px;
    align-items: center;
    gap: 14px;
    padding: 14px 2px;
    border: 0;
    border-bottom: 1px solid var(--ac-line);
    border-radius: 0;
    background: transparent;
    color: inherit;
    text-decoration: none !important;
    transition: opacity 0.2s ease;
}

.aqua-chat__channel:last-child {
    border-bottom: 0;
}

.aqua-chat__channel:hover {
    opacity: 0.72;
}

.aqua-chat__channel:focus-visible {
    outline: 1px solid var(--ac-gold);
    outline-offset: 2px;
}

.aqua-chat__channel-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--ac-line);
    background: transparent;
    color: var(--ac-text);
    display: grid;
    place-items: center;
}

.aqua-chat__channel-icon svg {
    width: 15px;
    height: 15px;
}

.aqua-chat__channel-body {
    min-width: 0;
}

.aqua-chat__channel-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--ac-text);
}

.aqua-chat__channel-desc {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--ac-muted);
}

.aqua-chat__channel-value {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--ac-gold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aqua-chat__channel-arrow {
    color: var(--ac-faint);
    display: grid;
    place-items: center;
}

.aqua-chat__channel-arrow svg {
    width: 12px;
    height: 12px;
}

.aqua-chat__messages {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    padding: 2px 0 16px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(182, 138, 69, 0.45) transparent;
}

.aqua-chat__msg {
    max-width: 86%;
    font-size: 13.5px;
    line-height: 1.6;
    word-break: break-word;
}

.aqua-chat__msg--bot {
    align-self: flex-start;
    padding: 0 0 0 12px;
    border-left: 1px solid var(--ac-gold-line);
    color: var(--ac-text);
    background: transparent;
}

.aqua-chat__msg--user {
    align-self: flex-end;
    padding: 10px 14px;
    border-radius: 14px 14px 4px 14px;
    background: #1a1816;
    color: #f7f4ef;
}

html[data-theme="dark"] .aqua-chat__msg--user {
    background: #f4efe6;
    color: #1a1816;
}

.aqua-chat__typing {
    display: flex;
    gap: 5px;
    padding: 0 0 12px 12px;
    flex-shrink: 0;
}

.aqua-chat__typing[hidden] {
    display: none !important;
}

.aqua-chat__typing span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--ac-gold);
    animation: acTyping 1.2s infinite ease-in-out;
}

.aqua-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
.aqua-chat__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes acTyping {
    0%, 80%, 100% { opacity: 0.25; }
    40% { opacity: 1; }
}

.aqua-chat__composer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 0 0;
    border: 0;
    border-top: 1px solid var(--ac-line);
    border-radius: 0;
    background: transparent;
    flex-shrink: 0;
}

.aqua-chat__composer textarea {
    flex: 1;
    min-height: 24px;
    max-height: 110px;
    margin: 0 0 8px;
    padding: 0;
    border: none;
    background: transparent;
    resize: none;
    color: var(--ac-text);
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
}

.aqua-chat__composer textarea::placeholder {
    color: var(--ac-faint);
    font-family: var(--ac-serif);
    font-style: italic;
    font-size: 16px;
}

.aqua-chat__composer textarea:disabled {
    opacity: 0.5;
}

.aqua-chat__send {
    width: 36px;
    height: 36px;
    border: 1px solid var(--ac-line);
    border-radius: 50%;
    background: transparent;
    color: var(--ac-text);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.aqua-chat__send:hover:not(:disabled) {
    background: #1a1816;
    border-color: #1a1816;
    color: #f7f4ef;
}

html[data-theme="dark"] .aqua-chat__send:hover:not(:disabled) {
    background: #f4efe6;
    border-color: #f4efe6;
    color: #1a1816;
}

.aqua-chat__send:focus-visible {
    outline: 1px solid var(--ac-gold);
    outline-offset: 2px;
}

.aqua-chat__send:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.aqua-chat__send svg {
    width: 14px;
    height: 14px;
}

.aqua-chat__disclaimer {
    margin: 10px 0 0;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1.5;
    color: var(--ac-faint);
    text-align: center;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .aqua-chat {
        right: max(16px, env(safe-area-inset-right, 0px));
        bottom: max(16px, env(safe-area-inset-bottom, 0px));
    }

    .aqua-chat__launcher-label {
        display: none;
    }

    .aqua-chat__panel {
        position: fixed;
        inset: auto 0 0 0;
        width: 100%;
        height: min(86vh, 720px);
        max-width: none;
        border-radius: 20px 20px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        transform: translateY(16px);
    }

    .aqua-chat__panel::before {
        content: "";
        display: block;
        width: 36px;
        height: 1px;
        margin: 12px auto 0;
        background: var(--ac-line);
        flex-shrink: 0;
    }

    .aqua-chat.is-open .aqua-chat__panel,
    .aqua-chat.is-open .aqua-chat__panel[hidden] {
        transform: translateY(0);
    }

    .aqua-chat__header {
        padding-top: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aqua-chat__typing span {
        animation: none;
    }

    .aqua-chat__panel,
    .aqua-chat__launcher-icon,
    .aqua-chat__launcher-label,
    .aqua-chat__launcher-icon svg {
        transition: none;
    }
}
