/*
 * Support widget styles.
 *
 * Everything here is the same for every tenant, so it is served as a cacheable
 * file instead of being re-sent inside the HTML on every widget load. The only
 * per-tenant values -- the accent, surface and text colours a customer picks in
 * LiveChat settings -- stay inline in widget.blade.php as :root custom
 * properties, and every rule below reads them through var().
 *
 * Edit alongside widget.blade.php and bump $widgetAssetVersion there so caches
 * roll over.
 */

button.message-box.tickets-card{
    width: 100%;
}
/* Added BeDesk-style animations */
@keyframes messageAnimation {
    0% {
        opacity: 0;
        translate: 0 4px;
    }
    to {
        opacity: 1;
        translate: 0 0;
    }
}

@keyframes iconAnimation {
    0% {
        opacity: 0;
        transform: scale(0.6);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #5B7FFF 0%, #4869EE 100%);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: rgba(0, 0, 0, 0.2) 0 3px 3px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 999;
    animation: iconAnimation 0.4s ease;
}

.chat-trigger:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 2px rgba(0, 0, 0, 0.09), 0 4px 10px rgba(0, 0, 0, 0.24);
}

/* Read aloud, drawn nowhere. Used for the "X said:" prefix on each
   message, which the layout conveys visually by side and colour. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/*
 * The focus ring was commented out, which left keyboard users with
 * nothing but the browser default over custom-coloured buttons it was
 * never picked to contrast with. It is drawn from the tenant accent, which
 * is a colour they chose to stand out against their own palette.
 *
 * No casing behind it. A solid band of --surface-0 was meant to keep the
 * ring legible on a dark accent, but on any control lighter than the panel
 * -- a search box, the message field -- it read as a black rectangle sitting
 * inside the control's own highlight.
 */
.chat-trigger:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.message-input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/*
 * Fields wrapped in a control that lights up on its own.
 *
 * .search-box, .help-search and .input-wrapper each style :focus-within, so
 * the whole control is already visibly focused. Ringing the bare <input>
 * inside as well drew a second box within the first.
 */
.search-box input:focus-visible,
.help-search input:focus-visible,
.input-wrapper input:focus-visible,
.input-wrapper .message-input:focus-visible {
    outline: none;
}

.chat-trigger i {
    font-size: 26px;
    color: white;
}

.chat-trigger.hidden {
    display: none;
}

body.chat-open .chat-trigger {
    display: none;
}

button,
.nav-btn,
.input-btn,
.quick-link,
.category-btn,
.message-box,
.submit-btn,
.new-conversation-btn,
.send-btn {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.25s ease;
}

button.pressed,
.nav-btn.pressed,
#backBtn.pressed,
#menuBtn.pressed,
.chat-trigger.pressed {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
}

/* Sized against the frame it was given, not a fixed 400x754 that assumed
   one. A host whose snippet opens the frame to 420x720 was clipping the
   panel; anything smaller squeezed it. */
.app-container {
    position: fixed;
    right: 10px !important;
    width: min(400px, calc(100% - 20px));
    height: min(754px, calc(100% - 20px));
    max-height: calc(100dvh - 20px);
    background: var(--surface-0);
    border-radius: var(--radius-xl);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(calc(100% + 48px));
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
    bottom: 10px !important;
}

@keyframes screenRise {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-container.active {
    transform: translateY(0);
    opacity: 1;
}

/* A 754px panel does not fit a 13" laptop once the browser chrome is
   accounted for, so it was being clipped rather than scaled. Below that
   the panel simply takes the height it can have. */
@media (max-height: 820px) {
    .app-container {
        height: calc(100dvh - 40px);
        bottom: 12px !important;
    }
}

@media (max-height: 700px) {
    .app-container {
        height: calc(100dvh - 24px);
        bottom: 8px !important;
    }

    .home-screen {
        padding-top: 20px;
    }

    .home-title {
        font-size: 22px;
    }

    .home-subtitle {
        margin-bottom: 18px;
    }
}

@media (max-width: 480px) {
    .app-container {
        width: calc(100% - 16px);
        right: 8px !important;
        bottom: 8px !important;
        height: calc(100% - 16px);
        max-height: calc(100% - 16px);
    }

    .chat-trigger {
        bottom: 16px;
        right: 16px;
    }
}

.header {
    background: var(--surface-1);
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line-soft);
    min-height: 58px;
}

.back-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 22px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #FFFFFF;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.logo-icon::before {
    content: '';
    width: 16px;
    height: 16px;
    background: #0F0F0F;
    border-radius: 50%;
    position: absolute;
}

.logo-icon::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #FFFFFF;
    border-radius: 50%;
    position: absolute;
    top: 10px;
}

.logo-icon.has-logo::before,
.logo-icon.has-logo::after {
    display: none;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 50%;
}

.menu-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-menu {
    position: absolute;
    top: 70px;
    right: 20px;
    background: #282828;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
    overflow: hidden;
    border: 1px solid #3A3A3A;
    min-width: 220px;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item {
    background: none;
    border: none;
    color: #FFFFFF;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    font-size: 15px;
    cursor: pointer;
    border-bottom: 1px solid #333333;
    transition: all 0.2s ease;
    font-weight: 500;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: #303030;
}

.menu-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.toggle-label {
    flex: 1;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: #5B7FFF;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    right: 3px;
    transition: all 0.3s ease;
}

.toggle-switch.off {
    background: #4A4A4A;
}

.toggle-switch.off::after {
    right: 23px;
}

.content {
    flex: 1;
    /*overflow-y: auto;*/
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.content .screen {
    /*padding-bottom: 80px;*/
}

/* BeDesk-style scrollbar */
.content::-webkit-scrollbar {
    width: 6px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.screen {
    /* display: none; */
    flex-direction: column;
    flex: 1;
    min-height: 0;
    /* opacity: 0; */
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.screen.active {
    display: flex;
    animation: screenRise 0.3s ease forwards;
}

/* Home Screen */
.home-screen {
    flex: 1;
    min-height: 0;
    padding: 24px 20px 90px;
    padding: 24px 20px calc(90px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.home-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
}

.home-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-minimize-btn {
    width: 36px;
    height: 14px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    font-size: 20px;
}

.home-minimize-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.widget-minimize-btn {
    position: absolute;
    top: 7px;
    right: 12px;
    z-index: 1002;
}

.home-hero-icon {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    background: linear-gradient(135deg, #1C2B45 0%, #111A2E 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 20px 35px rgba(0, 0, 0, 0.45);
    position: relative;
}

.home-hero-icon i {
    font-size: 22px;
    color: #fff;
    filter: drop-shadow(0 2px 10px rgba(91, 127, 255, 0.6));
}

.home-hero-icon::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    position: absolute;
    right: 8px;
    top: 8px;
}

.team-avatars {
    display: flex;
    justify-content: center;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--surface-1);
    margin-left: -12px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.avatar:first-child {
    margin-left: 0;
}

.avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.home-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-align: center;
}

/* Was line-height: 0, which collapsed the line box and left the subtitle
   sitting on top of the title. */
.home-subtitle {
    font-size: 15px;
    font-weight: 400;
    margin-bottom: 28px;
    color: var(--text-muted);
    letter-spacing: -0.01em;
    line-height: 1.5;
    text-align: center;
}

.message-box {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 14px;
    cursor: pointer;
    transition: background 0.22s var(--ease), border-color 0.22s var(--ease), transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-sm);
}

.message-box:hover {
    background: var(--surface-3);
    border-color: var(--accent-line);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.message-box-content {
    text-align: left;
    flex: 1;
    min-width: 0;
}

.message-box-content h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.message-box-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* A round accent chip rather than a bare icon floating off the edge -- the
   old rule pushed it 22px in from the right and 10px down for no reason. */
.message-box-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 14px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.22s var(--ease);
}

.message-box:hover .message-box-icon {
    background: rgba(var(--accent-rgb), 0.22);
}

.tickets-section .tickets-card {
    margin-top: 16px;
}

.search-box {
    background: var(--surface-1);
    border-radius: var(--radius);
    padding: 11px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--line-soft);
    transition: border-color 0.22s var(--ease), background 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.search-box:focus-within {
    border-color: var(--accent-line);
    background: var(--surface-2);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-icon {
    color: var(--text-faint);
    font-size: 14px;
}

.search-box input {
    background: none;
    border: none;
    color: var(--text);
    flex: 1;
    min-width: 0;
    outline: none;
    font-size: 14px;
}

.search-box input::placeholder {
    color: var(--text-faint);
}

/* Rows in a card, not naked text on a divider. Gives the list an edge to
   sit against so it stops looking like leftover markup. */
.quick-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--surface-1);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
}

.quick-link {
    background: none;
    border: none;
    color: var(--text);
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13.5px;
    text-align: left;
    transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.quick-link:last-child {
    border-bottom: none;
}

.quick-link i {
    font-size: 11px;
    color: var(--text-faint);
    transition: transform 0.18s var(--ease), color 0.18s var(--ease);
}

.quick-link:hover {
    background: var(--surface-2);
}

.quick-link:hover i {
    color: var(--accent);
    transform: translateX(2px);
}

/* Conversations List Screen */
.conversations-list-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
    min-height: 0;
    padding: 40px 20px 100px;
    padding: 40px 20px calc(100px + env(safe-area-inset-bottom));
    text-align: center;
    -webkit-overflow-scrolling: touch;
}

.conversation-history.hidden,
.conversation-empty.hidden {
    display: none;
}

.conversation-panel {
    width: 100%;
    margin: 0;
    padding: 20px 18px;
    border-radius: var(--radius-xl);
    background: var(--surface-1);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 0.25em tracking on 12px uppercase is a label, not a heading. Toned down
   so it reads as a caption instead of competing with the cards. */
.conversation-metadata {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    color: var(--text-faint);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.conversation-label {
    font-size: 10.5px;
    letter-spacing: 0.12em;
    opacity: 1;
}

.conversation-history {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.conversation-previews {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Three saturated blue slabs stacked on top of each other read as an error
   state, not a list. Neutral surface, one accent hairline down the side. */
.conversation-preview-item {
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-left: 2px solid var(--accent-line);
    border-radius: var(--radius);
    padding: 12px 14px;
    text-align: left;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.conversation-preview-item:hover {
    background: var(--surface-3);
    border-left-color: var(--accent);
    transform: translateX(1px);
}

.conversation-preview-item .preview-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-faint);
    margin-bottom: 6px;
    gap: 10px;
}

.conversation-preview-item .preview-meta span:first-child {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.conversation-preview-item .preview-body {
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.55;
    margin: 0;
}

.conversation-preview-item.waiting {
    border-color: var(--accent-line);
    border-left-color: var(--accent);
    background: var(--surface-2);
    box-shadow: var(--shadow-sm);
}

.conversation-preview-item.waiting .preview-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    font-size: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 0 1px rgba(91, 127, 255, 0.6);
}

.waiting-body {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
}

.waiting-body .preview-body {
    margin: 0;
    font-size: 15px;
}

.waiting-hint {
    font-size: 13px;
    color: #a0b5ff;
    opacity: 0.8;
    margin-top: 4px;
}

.live-chip {
    color: #7dd3fc;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.8);
}

.conversation-actions {
    width: 100%;
    display: flex;
    justify-content: center;
}

.conversation-actions-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.conversation-action-btn {
    width: 100%;
    border: none;
    border-radius: var(--radius);
    padding: 13px 0;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 6px 18px var(--accent-glow);
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), filter 0.18s var(--ease);
}

.conversation-action-btn i {
    font-size: 12px;
    transition: transform 0.18s var(--ease);
}

.conversation-action-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 10px 24px var(--accent-glow);
}

.conversation-action-btn:hover i {
    transform: translateX(2px);
}

/* The panel header already says "18 messages · Latest replies"; repeating
   it under the button was the same sentence twice on one screen. */
.conversation-action-meta {
    display: none;
}

.empty-icon {
    font-size: 40px;
    color: var(--text-faint);
    margin-bottom: 16px;
}

.empty-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.empty-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Email Screen */
.email-screen {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 24px 20px;
    padding: 24px 20px calc(100px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.agent-notice {
    margin: 0 0 12px;
    background: #1c1c1c;
    border-left: 3px solid #facc15;
    padding: 10px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notice-icon {
    font-size: 14px;
    color: #facc15;
    flex-shrink: 0;
}

.notice-text {
    margin: 0;
    font-size: 13px;
    color: #f8fafc;
    line-height: 1.4;
}

.prechat-info {
    margin: 12px 0 18px;
    color: #A0A0A0;
    font-size: 13px;
    line-height: 1.4;
}

.contact-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.contact-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-field label {
    font-size: 13px;
    color: #D0D0D0;
}

.contact-field input {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #2D2D2D;
    background: #101010;
    color: #FFFFFF;
    font-size: 15px;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.contact-field input:focus {
    border-color: #5B7FFF;
    outline: none;
}

.submit-btn {
    background: linear-gradient(135deg, #5B7FFF 0%, #4869EE 100%);
    border: none;
    border-radius: 999px;
    padding: 14px 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 18px 30px rgba(46, 67, 187, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 16px;
}

.submit-btn i {
    font-size: 18px;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 35px rgba(46, 67, 187, 0.45);
}

.submit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 14px 25px rgba(46, 67, 187, 0.35);
}

.submit-btn:hover {
    background: #4869EE;
}

#conversationScreen {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.message.ai-agent.agent {
    width: 100%;
}
/* Conversation Screen */
.conversation-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.conversation-area::-webkit-scrollbar {
    width: 6px;
}

.conversation-area::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 99px;
}

.conversation-area::-webkit-scrollbar-track {
    background: transparent;
}

.conversation-status {
    padding: 12px 20px;
    font-size: 13px;
    color: rgba(209, 213, 219, 0.8);
    border-top: 1px solid #2D2D2D;
    background: #0F0F0F;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    transition: opacity 180ms ease;
}
.conversation-status.is-fading {
    opacity: 0;
}

.human-notice {
    position: sticky;
    bottom: 96px;
    z-index: 4;
    margin: 10px 14px 0;
    padding: 10px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #dbeafe;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.human-notice i {
    color: #93c5fd;
}

/* Shown in the stream when the agent refers the guest on, so the handoff
   reads as the property looking after them rather than a dead end. */
.handoff-card {
    margin-top: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(59, 130, 246, 0.14));
    border: 1px solid rgba(16, 185, 129, 0.32);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.handoff-card-icon {
    flex: 0 0 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.22);
    color: #6ee7b7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.handoff-card-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #ecfdf5;
    margin-bottom: 3px;
}

.handoff-card-text {
    font-size: 12.5px;
    line-height: 1.5;
    color: #c7f2e2;
}

/* A reply can take a while to come back. Without this the guest sends a
   message into silence and assumes the chat is broken. */
.typing-indicator .message-bubble {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 14px;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.75);
    animation: typing-bounce 1.3s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.18s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes typing-bounce {
    0%, 70%, 100% {
        transform: translateY(0);
        opacity: 0.45;
    }
    35% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.typing-label {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.75);
}

@media (prefers-reduced-motion: reduce) {
    .typing-dots span {
        animation: none;
        opacity: 0.8;
    }
}

.conversation-error {
    padding: 12px 20px;
    margin: 0 20px 8px;
    border-radius: 12px;
    background: #3b1a1f;
    color: #ffcbd3;
    font-size: 13px;
    display: none;
}

#conversationScreen .header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #0F0F0F;
}

#conversationScreen .input-area {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: transparent;
}

.input-area {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: rgba(11, 11, 13, 0.88);
    border-top: 1px solid var(--line-soft);
    padding: 10px 14px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    padding: 7px 14px;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.input-wrapper:focus-within {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-wrapper .message-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    padding: 5px 0;
}

.input-wrapper .message-input::placeholder {
    color: var(--text-faint);
}

.input-wrapper .message-input:focus {
    outline: none;
}

.prechat-info {
    margin: 0 0 12px;
    background: #1c1c1c;
    border-left: 3px solid #facc15;
    padding: 10px 14px;
    border-radius: 10px;
    color: #f8fafc;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

p.notice-text {
    padding-top: 0;
    margin-top: 0;
}

.prechat-info::before {
    /* content: '\\f06a'; */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #facc15;
}

#conversationScreen .conversation-status,
#conversationScreen .conversation-error {
    position: sticky;
    bottom: 56px;
    z-index: 4;
}

/* Added message animation */
.message {
    display: flex;
    gap: 8px;
    animation: messageAnimation 0.125s ease;
}

.message.agent {
    justify-content: flex-start;
    align-self: flex-start;
}

.message.ai-agent {
    justify-content: flex-start;
    align-self: flex-start;
}

.message.user {
    justify-content: flex-end;
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 600;
    color: #0F0F0F;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 18px;
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05), 0 0 0 0 rgba(91, 127, 255, 0.2);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.message.user .message-avatar {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(91, 127, 255, 0.2);
}

.message.agent .message-avatar {
    border-color: rgba(255, 255, 255, 0.15);
}

.message.ai-agent .message-avatar {
    border-color: rgba(91, 127, 255, 0.4);
    background: #0f1734;
    color: #ffffff;
}

.message-avatar-user {
    background: var(--accent);
    color: #fff;
}

.message-avatar-ai {
    background: linear-gradient(135deg, #5b7fff, #4c6bfb);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 13px;
}

.message-content {
    flex: 1;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.55;
    display: inline-block;
    max-width: 88%;
    box-shadow: var(--shadow-sm);
    overflow-wrap: anywhere;
}
.message-bubble p {
    margin: 0;
}

/* A message that did not get through. Dimmed rather than hidden: the
   guest's words are still theirs, and the retry sits with them. */
.message.is-failed .message-bubble {
    opacity: 0.6;
}

.message-failure {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
}

.message.user .message-failure {
    justify-content: flex-end;
}

.message-failure-text {
    color: #ef7676;
}

.message-retry-btn {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
}
.message-bubble .message-list {
    margin: 5px 0 0 8px;
    padding-left: 0px;
    line-height: 1.5;
}
.message-bubble .message-list li {
    margin: 4px 0;
}
.message-bubble + .message-bubble {
    margin-top: 10px;
}

/* Incoming messages sit on a neutral surface and outgoing ones carry the
   accent. Three unrelated saturated colours -- sky blue, indigo, green --
   on the same thread was the single biggest reason it looked unfinished,
   and a solid block of brand colour makes long replies hard to read. */
.message.agent .message-bubble,
.message.ai-agent .message-bubble {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--line-soft);
    border-top-left-radius: 4px;
}

.message-actions {
    margin-top: 8px;
}

.human-assist-btn {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.human-assist-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.45);
}

.human-assist-btn:disabled {
    cursor: default;
    opacity: 0.7;
    box-shadow: none;
}

.human-assist-btn.is-complete {
    background: #1b4d2b;
    color: #d1fae5;
}

.message.user .message-bubble {
    background: var(--accent);
    color: #fff;
    border: 1px solid transparent;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.message.user .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.message.user .attachments-grid {
    align-self: flex-end;
    margin-left: auto;
    justify-content: flex-end;
}

.message-time {
    font-size: 10.5px;
    color: var(--text-faint);
    margin-top: 5px;
    display: block;
    letter-spacing: 0.01em;
}

.message.user .message-time {
    text-align: right;
}

.attachments-grid {
    margin-top: 10px;
    display: grid;
    /*grid-template-columns: repeat(2, minmax(130px, 1fr));*/
    gap: 10px;
    width: 100%;
}

@media (max-width: 360px) {
    .attachments-grid {
        grid-template-columns: repeat(1, minmax(120px, 1fr));
    }
}

.attachment-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.attachment-item.is-image {
    padding: 0;
    border: none;
    background: transparent;
}

.attachment-item:hover {
    transform: translateY(-2px);
    border-color: rgba(91, 127, 255, 0.35);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.25);
}

.attachment-thumb {
    height: 90px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    border: 2px solid rgba(91, 127, 255, 0.2);
}

.attachment-item.is-image .attachment-thumb {
    height: 130px;
    border: none;
    border-radius: 12px;
}

.attachment-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.attachment-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attachment-name {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.3;
    word-break: break-word;
}

.attachment-meta {
    font-size: 12px;
    color: rgba(226, 232, 240, 0.65);
}

/* A stack, not a carousel. The row of fixed-width cards forced the whole
   panel to scroll sideways, which broke the layout on a widget this
   narrow and hid most of what it was showing. */
.ai-context-grid {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

.ai-context-card {
    background: #090909;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    width: 100%;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.ai-context-card-image {
    flex: 0 0 92px;
    width: 92px;
    min-height: 92px;
    background: rgba(255, 255, 255, 0.02);
}

.ai-context-card-image img {
    width: 92px;
    height: 100%;
    min-height: 92px;
    object-fit: cover;
    display: block;
}

.ai-context-card-info {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    flex: 1 1 auto;
}

.ai-context-more {
    margin-top: 2px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
    color: #cbd5f5;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ai-context-more:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.3);
}

.ai-context-card-info h4 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
    overflow-wrap: anywhere;
}

.ai-context-card-meta {
    margin: 0;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.6);
    overflow-wrap: anywhere;
}

.ai-context-card-desc {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.ai-context-card-actions {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-context-card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #5b7fff, #4869ee);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-context-card-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(72, 105, 238, 0.3);
}

.ai-context-card-button.reserve {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.ai-context-card-button.reserve:hover {
    box-shadow: 0 10px 22px rgba(39, 174, 96, 0.3);
}

.ai-context-card-button.is-disabled,
.ai-context-card-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.input-area {
    padding: 0px 10px 8px;
    padding: 0px 10px calc(8px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(8, 8, 8, 0.95), rgba(14, 14, 14, 0.95));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 -18px 35px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(14px);
    position: relative;
    min-height: 70px;
}

.suggestion-trigger {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
    transition: all 0.2s ease;
}

.suggestion-trigger:hover {
    background: rgba(91, 127, 255, 0.25);
    border-color: rgba(91, 127, 255, 0.4);
    color: #ffffff;
}

.suggestion-panel {
    position: absolute;
    left: 20px;
    bottom: calc(100% + 10px);
    background: #101218;
    border-radius: 14px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    border: 1px solid rgba(91, 127, 255, 0.4);
    z-index: 30;
    min-width: 180px;
    max-width: min(320px, calc(100vw - 64px));
    max-height: 260px;
    overflow: auto;
}

.suggestion-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.suggestion-chip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    text-align: left;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

.suggestion-chip:hover {
    background: rgba(91, 127, 255, 0.2);
    border-color: rgba(91, 127, 255, 0.4);
    color: #ffffff;
}

.input-wrapper {
    flex: 1;
    background: linear-gradient(160deg, #0c0c0c, #141414);
    border-radius: 999px;
    padding: 1px 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
}

.input-wrapper:focus-within {
    border-color: rgba(91, 127, 255, 0.6);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 2px rgba(91, 127, 255, 0.15);
}

.message-input {
    background: none;
    border: none;
    color: #FFFFFF;
    flex: 1;
    outline: none;
    font-size: 16px;
}

.message-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.emoji-picker {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    background: #101218;
    border-radius: 20px;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(5, minmax(32px, 1fr));
    gap: 6px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    border: 1px solid rgba(91, 127, 255, 0.5);
    z-index: 20;
}

.emoji-picker.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.emoji-option {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.emoji-option:hover {
    background: rgba(91, 127, 255, 0.4);
}

.input-btn {
    background: none;
    border: none;
    color: #909090;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.input-btn:hover {
    color: #5B7FFF;
}

.input-wrapper .input-btn {
    width: 22px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: #cfd5ff;
    font-size: 20px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-wrapper .input-btn:hover {
    background: rgba(91, 127, 255, 0.25);
    color: #fff;
}

.input-wrapper .input-btn.is-active {
    background: rgba(91, 127, 255, 0.35);
    color: #ffffff;
}

.attachment-input {
    display: none;
}

.attachment-chip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + -10px);
    background: rgba(15, 18, 26, 0.95);
    color: #e2e8f0;
    border: 1px solid rgba(91, 127, 255, 0.4);
    border-radius: 14px;
    padding: 6px 10px;
    font-size: 12px;
    max-width: 260px;
    display: none;
    align-items: center;
    gap: 8px;
    transform: translateX(-50%);
    z-index: 30;
}

.attachment-chip.is-image {
    padding: 6px;
}

.attachment-preview {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.attachment-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-chip-name {
    font-size: 12px;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.3;
    word-break: break-word;
}

.attachment-chip-remove {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.attachment-chip-remove:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

/* Was a fixed orange-to-pink gradient, which belonged to no theme and
   fought the accent everywhere else on the panel. */
.send-btn {
    background: var(--accent);
    border: none;
    color: #FFFFFF;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
    flex-shrink: 0;
    box-shadow: 0 6px 18px var(--accent-glow);
}

.send-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 10px 24px var(--accent-glow);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: default;
    box-shadow: none;
    transform: none;
    filter: none;
}

.send-btn:active,
.new-conversation-btn:active,
.submit-btn:active,
.quick-link:active,
.category-btn:active,
.nav-btn:active,
.menu-item:active {
    transform: translateY(1px);
}
.search-results {
    flex-direction: column;
}
/* Help Screen */
.help-screen {
    flex: 1;
    min-height: 0;
    padding: 24px 20px 90px;
    padding: 24px 20px calc(90px + env(safe-area-inset-bottom));
    max-height: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
}

.help-search {
    background: #282828;
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

/* Matches .search-box on the home screen: same treatment, and the tenant's
   accent rather than a hardcoded blue that ignores their brand. */
.help-search:focus-within {
    border-color: var(--accent-line);
    background: var(--surface-2);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.help-search input {
    background: none;
    border: none;
    color: #FFFFFF;
    flex: 1;
    outline: none;
    font-size: 15px;
}

.help-search input::placeholder {
    color: #707070;
}

.categories {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.category-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid #2D2D2D;
    font-weight: 600;
    transition: all 0.2s ease;
}

.category-btn:hover {
    color: #5B7FFF;
}

.category-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1;
}

.category-count {
    font-size: 13px;
    color: #808080;
    font-weight: 400;
}

/* Feedback Screen */
.feedback-screen {
    flex: 1;
    min-height: 0;
    padding: 40px 20px 110px;
    padding: 40px 20px calc(110px + env(safe-area-inset-bottom));
    text-align: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.feedback-title {
    font-size: 24px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 12px;
}

.feedback-subtitle {
    font-size: 15px;
    color: #A0A0A0;
    margin-bottom: 32px;
}

.star-rating {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.star {
    font-size: 36px;
    color: #404040;
    cursor: pointer;
    transition: all 0.2s ease;
    /* Now a real <button>; strip the chrome it comes with so it still
       draws as nothing but the glyph. */
    background: none;
    border: 0;
    padding: 0;
    line-height: 1;
    font-family: inherit;
}

.star:hover,
.star.active {
    color: #FFB800;
}

.feedback-textarea {
    width: 100%;
    background: #282828;
    border: 1px solid #2D2D2D;
    border-radius: 14px;
    padding: 16px;
    color: #FFFFFF;
    font-size: 15px;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 24px;
    outline: none;
}

.feedback-textarea:focus {
    border-color: #5B7FFF;
}

.feedback-textarea::placeholder {
    color: #707070;
}

.feedback-actions {
    display: flex;
    gap: 12px;
}

.feedback-error {
    display: none;
    color: #ffcbd3;
    background: #3b1a1f;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    text-align: center;
}

.skip-btn {
    flex: 1;
    background: #282828;
    border: 1px solid #2D2D2D;
    color: #FFFFFF;
    padding: 16px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.skip-btn:hover {
    background: #303030;
}

.submit-feedback-btn {
    flex: 1;
    background: #5B7FFF;
    border: 1px solid #2D2D2D;
    color: #FFFFFF;
    padding: 16px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-feedback-btn:hover {
    background: #4869EE;
}

.feedback-thanks {
    margin-top: 18px;
    font-size: 14px;
    color: #A7F3D0;
}

/* Bottom Navigation */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(19, 19, 22, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line-soft);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}

/* Hide bottom nav on conversation screen */
#conversationScreen .bottom-nav {
    display: none;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-faint);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: color 0.18s var(--ease);
    padding: 6px 18px;
    border-radius: var(--radius-sm);
}

.nav-btn i {
    font-size: 16px;
}

.nav-btn.active {
    color: var(--accent);
}

.nav-btn:hover {
    color: var(--text);
}

.nav-btn.active:hover {
    color: var(--accent);
}
