/* Hive Assist – the help chat on the landing page and in the Resident Portal (assets/js/hive-assist.js).
   Self-contained colours, so it looks the same on both; follows the light / dark theme. */
.ha {
    --ha-bg: #17140F; --ha-bg2: #211C15; --ha-line: rgba(255,255,255,.1); --ha-ink: #F5F2EC; --ha-ink2: #C9C3B8; --ha-ink3: #9A9286;
    --ha-acc: var(--brand, #FF8A00); --ha-acc-ink: #1A0E05; --ha-user: var(--brand, #FF8A00); --ha-user-ink: #1A0E05; --ha-shadow: 0 24px 60px -18px rgba(0,0,0,.65);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    position: fixed; right: 22px; bottom: 22px; z-index: 1150;
    display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
    color: var(--ha-ink);
    pointer-events: none;   /* the empty part of the box never blocks the page; its pieces opt back in */
}
.ha > * { pointer-events: auto; }
[data-theme="light"] .ha {
    --ha-bg: #FFFDF9; --ha-bg2: #F6F1EA; --ha-line: rgba(26,20,13,.12); --ha-ink: #1A140D; --ha-ink2: #4A4136; --ha-ink3: #7A7064;
    --ha-acc: #E07800; --ha-shadow: 0 24px 60px -20px rgba(60,40,10,.35);
}
[data-tone="medium"] .ha {   /* Medium: the same mid-gray surfaces as the portals */
    --ha-bg: #2B2C30; --ha-bg2: #3A3B40; --ha-line: #55575D; --ha-ink: #FFFFFF; --ha-ink2: #E3E3E6; --ha-ink3: #CFCFD4;
    --ha-shadow: 0 24px 60px -20px rgba(0,0,0,.45);
}
.ha *, .ha *::before, .ha *::after { box-sizing: border-box; }

/* ---- launcher (always there – this is how the chat comes back after closing it) */
.ha-launch {
    display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 20px 0 8px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--ha-acc); color: var(--ha-acc-ink); font: inherit; font-size: 15px; font-weight: 800;
    box-shadow: 0 10px 26px -12px rgba(0,0,0,.65), 0 2px 0 rgba(255,255,255,.22) inset; transition: transform .18s, box-shadow .18s;   /* neutral depth, no orange halo (2026-10-22) */
}
.ha-launch:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px rgba(0,0,0,.7), 0 2px 0 rgba(255,255,255,.22) inset; }
.ha-launch:focus-visible { outline: 3px solid var(--ha-ink); outline-offset: 3px; }
.ha-launch[hidden] { display: none; }
.ha-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(26,14,5,.14); flex: none; }
.ha-ico svg { width: 24px; height: 24px; }
.ha-launch .ha-dot { width: 9px; height: 9px; border-radius: 50%; background: #1A0E05; box-shadow: 0 0 0 3px rgba(255,255,255,.5); margin-left: -2px; }
.ha-launch.small { width: 54px; padding: 0; justify-content: center; }
.ha-launch.small .ha-launch-t { display: none; }
.ha-launch.small .ha-ico { background: none; }
/* "compact": the resting look – just the hexagon; pointing at it shows the full "Ask …" button */
.ha-launch.compact { width: 54px; padding: 0; justify-content: center; }
.ha-launch.compact .ha-launch-t, .ha-launch.compact .ha-dot { display: none; }
.ha-launch.compact .ha-ico { background: none; }

/* little speech bubble next to the launcher */
.ha-hint {
    max-width: 260px; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--ha-bg); color: var(--ha-ink);
    border: 1px solid var(--ha-line); box-shadow: var(--ha-shadow); font-size: 13px; line-height: 1.4; font-weight: 600;
    animation: haIn .25s ease-out;
}
.ha-hint[hidden] { display: none; }

/* ---- panel */
.ha-panel {
    width: min(380px, calc(100vw - 24px)); height: min(600px, calc(100vh - 110px)); display: flex; flex-direction: column;
    border-radius: 22px; overflow: hidden; background: var(--ha-bg); border: 1px solid var(--ha-line); box-shadow: var(--ha-shadow);
    animation: haIn .22s ease-out;
}
.ha-panel[hidden] { display: none; }
@keyframes haIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.ha-head { position: sticky; top: 0; z-index: 15; flex: none; display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background-color: var(--ha-bg); background-image: linear-gradient(135deg, rgba(var(--brand-rgb, 255,138,0),.22), rgba(var(--brand-rgb, 255,138,0),.04)); border-bottom: 1px solid var(--ha-line); }
.ha-av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--ha-acc); color: var(--ha-acc-ink); flex: none; }
.ha-av svg { width: 24px; height: 24px; }
.ha-title { flex: 1; min-width: 0; }
.ha-title b { display: block; font-size: 15px; font-weight: 800; }
.ha-title span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ha-ink2); }
.ha-title span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #34D399; }
.ha-x { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--ha-line); background: transparent; color: var(--ha-ink); font-size: 20px; line-height: 1; cursor: pointer; flex: none; }
.ha-x:hover { border-color: var(--ha-acc); color: var(--ha-acc); }
.ha-x:focus-visible { outline: 2px solid var(--ha-acc); outline-offset: 2px; }

/* the conversation keeps at least ~160px; on short screens the quick questions shrink (and scroll) first */
.ha-log { position: relative; flex: 1 1 160px; min-height: 160px; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
/* Hive-styled scrollbars inside the assistant (no grey arrows) */
@supports not selector(::-webkit-scrollbar) { .ha-log, .ha-chips { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ha-acc) 45%, transparent) transparent; } }
.ha-log::-webkit-scrollbar, .ha-chips::-webkit-scrollbar { width: 8px; height: 8px; }
.ha-log::-webkit-scrollbar-track, .ha-chips::-webkit-scrollbar-track { background: transparent; }
.ha-log::-webkit-scrollbar-thumb, .ha-chips::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ha-acc) 40%, transparent); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.ha-log::-webkit-scrollbar-thumb:hover, .ha-chips::-webkit-scrollbar-thumb:hover { background-color: var(--ha-acc); }
.ha-log::-webkit-scrollbar-button, .ha-chips::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.ha-msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.5; word-wrap: break-word; animation: haIn .2s ease-out; }
.ha-msg p { margin: 0; }
.ha-msg p + p { margin-top: 6px; }
.ha-bot { align-self: flex-start; background: var(--ha-bg2); border: 1px solid var(--ha-line); border-bottom-left-radius: 5px; }
.ha-user { align-self: flex-end; background: var(--ha-user); color: var(--ha-user-ink); font-weight: 600; border-bottom-right-radius: 5px; }
.ha-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ha-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--ha-acc); background: var(--ha-acc);
          color: var(--ha-acc-ink); font: inherit; font-size: 13px; font-weight: 800; text-decoration: none; cursor: pointer; }
.ha-btn.ghost { background: transparent; color: var(--ha-acc); }
.ha-btn:hover { filter: brightness(1.08); }
.ha-btn:focus-visible { outline: 2px solid var(--ha-ink); outline-offset: 2px; }
.ha-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.ha-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ha-ink3); animation: haDot 1s infinite ease-in-out; }
.ha-typing i:nth-child(2) { animation-delay: .15s; } .ha-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes haDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ha-rel { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ha-ink3); margin: 4px 2px -2px; }

/* Suggested questions: wrap onto lines (no hidden sideways scroll, so mouse users see every question) */
.ha-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 10px; flex: none; max-height: 196px; overflow-y: auto; }
.ha-chip { flex: 0 1 auto; max-width: 100%; padding: 7px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--ha-acc) 45%, transparent); background: color-mix(in srgb, var(--ha-acc) 12%, transparent); color: var(--ha-ink); font: inherit; font-size: 12.5px; font-weight: 700; line-height: 1.3; cursor: pointer; text-align: left; white-space: normal; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.ha-chip:hover, .ha-chip:focus-visible { border-color: var(--ha-acc); background: var(--ha-acc); color: var(--ha-acc-ink); outline: none; transform: translateY(-1px); }
/* Quick questions header with Hide / Show */
.ha-qq { flex: 0 1 auto; min-height: 34px; display: flex; flex-direction: column; border-top: 1px solid var(--ha-line); }
.ha-qq[hidden] { display: none; }
.ha-qq-t { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 9px 14px 2px; border: 0; background: none; cursor: pointer;
           font: inherit; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ha-ink); }
.ha-qq-t > span:first-child { opacity: .75; }
.ha-qq-s { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; color: var(--ha-acc); letter-spacing: .03em; transition: background .15s; }
.ha-qq-s svg { width: 14px; height: 14px; transition: transform .2s; }
.ha-qq-t:hover .ha-qq-s, .ha-qq-t:focus-visible .ha-qq-s { background: color-mix(in srgb, var(--ha-acc) 14%, transparent); }
.ha-qq-t:focus-visible { outline: none; }
.ha-qq.is-min .ha-qq-t { padding-bottom: 9px; }
.ha-qq.is-min .ha-qq-s svg { transform: rotate(180deg); }
.ha-qq .ha-chips[hidden] { display: none; }
.ha-qq .ha-chips { flex: 0 1 auto; min-height: 0; overscroll-behavior: contain; }
.ha-log .ha-chips { padding: 0; flex-wrap: wrap; overflow: visible; }
/* Every quick question stays in full view (client feedback: on phones and tablets the box shrank to a sliver with a
   hidden scroll, so visitors never saw them all). The conversation gives up room instead – it scrolls on its own.
   Only on a very short screen (phone held sideways) do the questions get their own visible scroll. */
.ha-log { flex: 1 1 96px; min-height: 96px; }
.ha-qq { flex: none; }
.ha-qq .ha-chips { flex: none; max-height: none; overflow: visible; }
@media (max-height: 520px) {
    .ha-log { flex-basis: 64px; min-height: 64px; }
    .ha-qq .ha-chips { max-height: 24vh; max-height: 24dvh; overflow-y: auto; }
}.ha-log .ha-chip { white-space: normal; text-align: left; }

.ha-form { position: sticky; bottom: 0; z-index: 15; background: var(--ha-bg); display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--ha-line); flex: none; }
.ha-form input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--ha-line); background: var(--ha-bg2); color: var(--ha-ink); font: inherit; font-size: 14px; }
.ha-form input::placeholder { color: var(--ha-ink3); }
.ha-form input:focus { outline: none; border-color: var(--ha-acc); }
.ha-send { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--ha-acc); color: var(--ha-acc-ink); cursor: pointer; display: grid; place-items: center; flex: none; }
.ha-send:disabled { opacity: .45; cursor: default; }
.ha-send svg { width: 20px; height: 20px; }
.ha-foot { position: sticky; bottom: 0; z-index: 15; background: var(--ha-bg); display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 14px 10px; font-size: 11.5px; color: var(--ha-ink3); flex: none; }
.ha-foot button { border: 0; background: none; color: var(--ha-acc); font: inherit; font-weight: 800; cursor: pointer; padding: 2px 0; }
.ha-foot button:hover { text-decoration: underline; }
/* Admin Panel / Resident Portal: their top bar sits over the page, so the chat stops below it */
@media (min-width: 561px) {
    body:has(.sb) .ha-panel { height: min(600px, calc(100vh - 210px)); height: min(600px, calc(100dvh - 210px)); }
}
.ha-preview { padding: 6px 14px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-align: center; background: rgba(96,165,250,.16); color: #93C5FD; }

/* ---- the landing page's floating tips card sits above the launcher, and steps aside while the chat is open */
body.has-ha .suggest.is-floating { bottom: 92px !important; }
/* portal pages: room under the last card, so a pager at the very bottom can scroll clear of the button */
body.has-ha main .content { padding-bottom: 84px; }
body.ha-open .suggest.is-floating { display: none !important; }
body.ha-open .suggest { visibility: hidden; }   /* in the hero it keeps its space, it just doesn't peek out beside the chat */

@media (max-width: 560px) {
    .ha { right: 12px; bottom: 12px; left: 12px; align-items: flex-end; }
    .ha-panel { width: 100%; height: calc(100vh - 24px); height: calc(100dvh - 24px); border-radius: 18px; }
    .ha.is-open .ha-launch { display: none; }
    .ha-launch { height: 50px; }
    body.has-ha .suggest.is-floating { bottom: 74px !important; }
}
@media (prefers-reduced-motion: reduce) { .ha-panel, .ha-msg, .ha-hint { animation: none; } .ha-typing i { animation: none; opacity: .6; } }
@media print { .ha { display: none !important; } }

/* ---- phones & tablets: out of the way while reading (hive-assist.js adds ha-away / ha-tuck while the page scrolls) */
@media (max-width: 1024px) {
    .ha { --ha-edge: 22px; }
    .ha-launch.compact { width: 48px; height: 48px; }
    .ha-launch.compact .ha-ico svg { width: 22px; height: 22px; }
    .ha-launch { transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .25s, box-shadow .18s; }
    .ha.ha-away:not(.is-open) .ha-launch, .ha.ha-away:not(.is-open) .ha-hint { transform: translateY(160%); opacity: 0; pointer-events: none; }
    .ha.ha-tuck:not(.is-open) .ha-launch { transform: translateX(calc(50% + var(--ha-edge))); opacity: .92;
                                           box-shadow: 0 8px 20px -10px rgba(0,0,0,.6); }
    .ha.ha-tuck:not(.is-open) .ha-launch .ha-ico { transform: translateX(-9px); }   /* the hexagon stays in the visible half */
    .ha.ha-tuck:not(.is-open) .ha-launch:hover, .ha.ha-tuck:not(.is-open) .ha-launch:focus-visible { transform: none; opacity: 1; }
    .ha.ha-tuck:not(.is-open) .ha-hint { display: none; }
}
@media (max-width: 560px) { .ha { --ha-edge: 12px; } }
@media (prefers-reduced-motion: reduce) { .ha-launch { transition: none; } }

/* ---- unanswered question: "email me the answer" (visitors) / "it will be emailed to you" (residents) */
.ha-note { margin: 8px 0 0 !important; font-size: 12.5px; color: var(--ha-ink2); }
.ha-mail { display: grid; gap: 6px; margin-top: 10px; padding: 10px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--ha-acc) 55%, transparent); }
.ha-mail label { font-size: 12.5px; font-weight: 700; }
.ha-mail span { display: flex; gap: 6px; }
.ha-mail input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--ha-line); background: var(--ha-bg); color: var(--ha-ink); font: inherit; font-size: 13px; }
.ha-mail input:focus-visible { outline: 2px solid var(--ha-acc); outline-offset: 1px; }
.ha-mail button { flex: none; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--ha-acc); color: var(--ha-acc-ink); font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.ha-mail small { font-size: 11px; color: var(--ha-ink3); }

/* ---- open chat: from the top of the screen to the bottom, so the whole conversation is easy to read
   (tablets and computers; phones already use the full screen). The launcher steps aside while it is open –
   the × in the chat's header closes it. */
@media (min-width: 561px) {
    .ha.is-open { top: 12px; bottom: 12px; }
    .ha.is-open .ha-panel, body:has(.sb) .ha.is-open .ha-panel { flex: 1 1 auto; min-height: 0; height: auto; width: min(420px, calc(100vw - 24px)); }
    .ha.is-open .ha-launch, .ha.is-open .ha-hint { display: none; }
    .ha.is-open .ha-log { flex: 1 1 auto; }
}

/* ---- where the button sits, and moving it (hive-assist.js: --ha-bottom + .ha-left, remembered per browser) ----
   Phones and tablets: higher than before, clear of the phone's own back / gesture bar at the bottom of the screen. */
.ha:not(.is-open) { bottom: var(--ha-bottom, 22px); }
@media (max-width: 1024px) {
    .ha:not(.is-open) { bottom: var(--ha-bottom, calc(84px + env(safe-area-inset-bottom, 0px))); }
}
.ha.ha-left { left: 22px; right: auto; align-items: flex-start; }
.ha.ha-left .ha-hint { border-radius: 14px 14px 14px 4px; }
@media (max-width: 560px) { .ha.ha-left { left: 12px; right: 12px; } }
@media (max-width: 1024px) {
    .ha.ha-left.ha-tuck:not(.is-open) .ha-launch { transform: translateX(calc(-50% - var(--ha-edge))); }
    .ha.ha-left.ha-tuck:not(.is-open) .ha-launch .ha-ico { transform: translateX(9px); }
    .ha.ha-left.ha-tuck:not(.is-open) .ha-launch:hover, .ha.ha-left.ha-tuck:not(.is-open) .ha-launch:focus-visible { transform: none; }
}
.ha-launch { touch-action: none; -webkit-user-select: none; user-select: none; }   /* dragging it never scrolls the page */
.ha.ha-dragging .ha-launch { transition: none; cursor: grabbing; transform: scale(1.08); opacity: 1; box-shadow: 0 18px 36px -12px rgba(0,0,0,.7); }
