/* Kai — First Mate chat panel for the DeepCast viewer.
   SeaLegs palette: navy surfaces #0F2041 / #1a2744, brand orange #FF8504
   (the map CTA), cyan #4fc3f7 for data accents. All selectors .kai-. */

/* Floating CTA (bottom-right chat-widget convention).
   The button itself is a chat bubble — rounded square with a tail —
   holding the SeaLegs logo. No circle, no ring. */
.kai-fab {
    /* bottom aligns the bubble's center with the viewer's orange + CTA
       (.dc-map-cta: bottom 80px, 60px tall → center 110px) */
    position: fixed; right: 22px; bottom: 83px; z-index: 2500;
    width: 60px; height: 54px; border-radius: 18px;
    background: #0F2041;
    border: 3px solid #fff; padding: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
    transition: transform .15s ease, opacity .2s ease;
}
/* bubble tail — two stacked triangles: white outline behind, navy fill
   in front, continuing the bordered-bubble look */
.kai-fab::after {
    content: ''; position: absolute; right: 9px; bottom: -12px;
    width: 0; height: 0;
    border-top: 12px solid #fff;
    border-left: 12px solid transparent;
}
.kai-fab::before {
    content: ''; position: absolute; right: 12px; bottom: -6px;
    width: 0; height: 0;
    border-top: 8px solid #0F2041;
    border-left: 8px solid transparent;
    z-index: 1;
}
.kai-fab:hover { transform: scale(1.07); }
.kai-fab-logo {
    width: 36px; height: 36px; pointer-events: none;
    user-select: none; -webkit-user-select: none;
}
.kai-fab-hidden { opacity: 0; pointer-events: none; transform: scale(.8); }

/* Backdrop — mobile only: opaque wall behind the panel so the map never
   bleeds through Safari's translucent chrome while the keyboard is up */
.kai-backdrop { display: none; }
@media (max-width: 640px) {
    .kai-backdrop.open {
        display: block; position: fixed; inset: -80px 0;
        background: #0f1423; z-index: 10040;
    }
}

/* Drawer */
.kai-panel {
    position: fixed; top: 64px; right: 0; bottom: 0; width: 400px;
    max-width: 100vw; z-index: 3000;
    background: linear-gradient(180deg, #0F2041 0%, #0f1423 100%);
    color: #e8eef4;
    border-left: 1px solid rgba(79, 195, 247, .16);
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s ease;
    font-family: 'Inter', -apple-system, sans-serif;
    box-shadow: -8px 0 30px rgba(0, 0, 0, .45);
}
.kai-panel.open { transform: translateX(0); }

.kai-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #16305e 0%, #0F2041 100%);
    flex: 0 0 auto; position: relative;
}
/* waterline — hairline gradient under the header */
.kai-head::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, #4fc3f7 0%, #1a6fae 45%,
                                #FF8504 100%);
    opacity: .85;
}
/* mini version of the FAB: white-outlined navy chat bubble + logo */
.kai-avatar {
    position: relative; flex: 0 0 auto;
    width: 40px; height: 36px; border-radius: 12px;
    background: #0F2041;
    border: 2px solid #fff;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 5px; /* room for the tail inside the header */
}
.kai-avatar::after {
    content: ''; position: absolute; right: 5px; bottom: -8px;
    width: 0; height: 0;
    border-top: 8px solid #fff;
    border-left: 8px solid transparent;
}
.kai-avatar::before {
    content: ''; position: absolute; right: 7px; bottom: -4px;
    width: 0; height: 0;
    border-top: 5px solid #0F2041;
    border-left: 5px solid transparent;
    z-index: 1;
}
.kai-avatar-logo {
    width: 24px; height: 24px; pointer-events: none;
    user-select: none; -webkit-user-select: none;
}
.kai-head-name {
    font-weight: 800; font-size: 22px; letter-spacing: .2px;
    /* same orange glow as "DEEP" in the viewer title bar */
    color: #fff;
    text-shadow: 0 0 6px rgba(255, 133, 4, .9),
                 0 0 16px rgba(255, 133, 4, .6),
                 0 0 32px rgba(255, 133, 4, .35);
}
.kai-head-role {
    font-weight: 600; font-size: 15px; color: #9fc3e0;
    text-shadow: none; /* glow is Kai's alone */
}
.kai-head-sub {
    font-size: 11px; color: #7da4c4;
    text-transform: uppercase; letter-spacing: .6px;
}
.kai-head-spacer { flex: 1; }
.kai-close {
    background: none; border: 0; color: #7da4c4; cursor: pointer;
    font-size: 28px; line-height: 1;
    /* 44px tap target (Apple HIG minimum) */
    min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
    margin: -4px -8px -4px 0;
}
.kai-close:hover { color: #fff; }
.kai-reset {
    background: none; border: 0; color: #7da4c4; cursor: pointer;
    /* 44px tap target (Apple HIG minimum) */
    min-width: 40px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
    margin: -4px -2px -4px 0;
}
.kai-reset:hover { color: #fff; }

.kai-log {
    flex: 1; overflow-y: auto; padding: 14px 12px;
    display: flex; flex-direction: column; gap: 9px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='24' viewBox='0 0 120 24'%3E%3Cpath d='M0 12c15-8 30-8 45 0s30 8 45 0 30-8 45 0' fill='none' stroke='%234fc3f7' stroke-opacity='0.05' stroke-width='1.5'/%3E%3C/svg%3E");
}
.kai-log::-webkit-scrollbar { width: 4px; }
.kai-log::-webkit-scrollbar-thumb {
    background: rgba(79, 195, 247, .25); border-radius: 2px;
}
.kai-row {
    display: flex; align-items: flex-end; gap: 7px; max-width: 92%;
    align-self: flex-start;
}
/* bare SeaLegs logo — no bubble chrome on message icons */
.kai-msg-icon {
    flex: 0 0 auto; width: 24px; height: 24px;
    display: flex; align-items: center;
    justify-content: center; margin-bottom: 2px;
}
.kai-icon-logo {
    width: 22px; height: 22px; pointer-events: none;
    user-select: none; -webkit-user-select: none;
}
.kai-row .kai-msg { max-width: none; }
.kai-msg, .kai-row, .kai-chip, .kai-chip-stack, .kai-card,
.kai-result-card, .kai-emergency, .kai-typing {
    animation: kai-in .22s ease both;
}
@keyframes kai-in {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: none; }
}
.kai-msg {
    padding: 9px 13px; border-radius: 16px; max-width: 88%;
    white-space: pre-wrap; overflow-wrap: break-word;
    font-size: 14px; line-height: 1.5;
}
.kai-msg.kai { white-space: normal; }
.kai-msg.kai ul { margin: 4px 0; padding-left: 18px; }
.kai-msg.kai li { margin: 2px 0; }
.kai-msg.kai b { color: #4fc3f7; }

/* Data chips — depth-sounder cards: navy glass, cyan numbers */
.kai-chip {
    align-self: flex-start; margin-left: 29px;
    background: linear-gradient(160deg, #1e3a6e, #1a2744);
    border: 1px solid rgba(79, 195, 247, .28); border-radius: 14px;
    padding: 10px 16px; min-width: 130px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.kai-chip-stack {
    align-self: flex-start; margin-left: 29px;
    display: flex; flex-direction: column; gap: 6px; max-width: 88%;
}
.kai-chip-big {
    font: 700 24px 'Inter', sans-serif; color: #4fc3f7;
    letter-spacing: -.5px;
}
.kai-chip-sub { font-size: 12px; color: #9fb6c8; margin-top: 1px; }
.kai-chip-date {
    font-size: 10px; color: #64809a; margin-top: 5px;
    text-transform: uppercase; letter-spacing: .5px;
}
.kai-chip-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.kai-chip.bearing {
    display: flex; align-items: center; gap: 12px;
}
.kai-bearing-arrow {
    width: 30px; height: 30px; color: #FF8504; flex: 0 0 auto;
}
.kai-bearing-arrow svg { width: 100%; height: 100%; }
.kai-tide-row {
    display: flex; align-items: baseline; gap: 10px;
    font-size: 13px; padding: 3px 0;
}
.kai-tide-kind { font-weight: 800; font-size: 11px; width: 38px; }
.kai-tide-kind.high { color: #66bb6a; }
.kai-tide-kind.low { color: #FF8504; }
.kai-tide-time { color: #d5e4f0; }
.kai-tide-ht { color: #9fb6c8; margin-left: auto; }
/* Conditions chip rows */
.kai-cond-row {
    display: flex; align-items: baseline; gap: 10px;
    font-size: 13px; padding: 3px 0;
}
.kai-cond-k {
    font-weight: 800; font-size: 11px; width: 42px; color: #7fbfe6;
    text-transform: uppercase; letter-spacing: .4px;
}
.kai-cond-v { color: #d5e4f0; }

.kai-advisory {
    border-radius: 11px; padding: 9px 13px;
    font: 600 13px 'Inter', sans-serif;
}
.kai-advisory-when {
    display: block; font-weight: 500; font-size: 11px;
    opacity: .8; margin-top: 2px;
}
.kai-advisory.red {
    background: #3d1414; border: 1px solid #a03636; color: #ff9d9d;
}
.kai-advisory.amber {
    background: #3a2c10; border: 1px solid #a07c2c; color: #ffd47f;
}
.kai-advisory.blue {
    background: #12305a; border: 1px solid #2f6a9e; color: #9fd2f7;
}
.kai-eddy {
    border-radius: 12px; padding: 9px 13px; font-size: 13px;
}
.kai-eddy.warm { background: #38220f; border: 1px solid #8a5a2a; }
.kai-eddy.cold { background: #142b4d; border: 1px solid #33608c; }
.kai-eddy-name { font-weight: 700; }
.kai-eddy-sub { color: #a8bccd; font-size: 12px; margin-top: 2px; }

/* User bubble — brand orange, same family as the map CTA */
.kai-msg.you {
    background: linear-gradient(160deg, #FF8504, #e66c00);
    color: #fff; font-weight: 500;
    align-self: flex-end; border-bottom-right-radius: 5px;
    box-shadow: 0 2px 8px rgba(255, 133, 4, .22);
}
.kai-msg.kai {
    background: linear-gradient(160deg, #2a4070, #223357);
    border: 1px solid rgba(79, 195, 247, .28);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
}
.kai-msg.error {
    background: #3d1a1a; border: 1px solid #6b2f2f; color: #f0b9b9;
    align-self: center; font-size: 12px;
}
.kai-msg.notice {
    background: #2e2a16; border: 1px solid #5d552b;
    align-self: flex-start; font-size: 13px;
}
.kai-upsell a { color: #4fc3f7; font-weight: 600; }

/* Starter chips — fresh-conversation empty state */
.kai-starters {
    align-self: flex-start; margin-left: 31px; margin-top: 2px;
    display: flex; flex-wrap: wrap; gap: 8px; max-width: 88%;
    animation: kai-in .22s ease both;
}
.kai-starter {
    background: rgba(79, 195, 247, .08);
    border: 1px solid rgba(79, 195, 247, .4);
    color: #9fd2f7; border-radius: 999px;
    padding: 8px 14px; font: 500 13px 'Inter', sans-serif;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.kai-starter:hover {
    background: rgba(79, 195, 247, .18); border-color: #4fc3f7;
}

/* Quick-reply chips — Kai's tappable answer options. Right-aligned and
   orange-tinted since tapping sends AS the captain. */
.kai-quick {
    align-self: flex-end; margin-top: 2px;
    display: flex; flex-wrap: wrap; justify-content: flex-end;
    gap: 8px; max-width: 92%;
    animation: kai-in .22s ease both;
}
.kai-quick-btn {
    background: rgba(255, 133, 4, .12);
    border: 1px solid rgba(255, 133, 4, .55);
    color: #ffb367; border-radius: 999px;
    padding: 9px 15px; font: 600 13px 'Inter', sans-serif;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.kai-quick-btn:hover {
    background: rgba(255, 133, 4, .22); border-color: #FF8504;
    color: #ffd0a0;
}

.kai-typing {
    align-self: flex-start; display: flex; gap: 4px; padding: 12px 15px;
    background: linear-gradient(160deg, #2a4070, #223357);
    border: 1px solid rgba(79, 195, 247, .28);
    border-radius: 16px; border-bottom-left-radius: 5px;
}
.kai-typing span {
    width: 6px; height: 6px; border-radius: 50%; background: #4fc3f7;
    animation: kai-bounce 1.2s infinite;
}
.kai-typing span:nth-child(2) { animation-delay: .15s; }
.kai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes kai-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Confirmation card — primary action in brand orange */
.kai-card {
    align-self: flex-start; max-width: 92%;
    background: linear-gradient(160deg, #1e3a6e, #1a2744);
    border: 1px solid rgba(79, 195, 247, .35);
    border-radius: 14px; padding: 12px 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}
.kai-card h4 {
    margin: 0 0 6px; font-size: 13px; color: #4fc3f7;
    text-transform: uppercase; letter-spacing: .6px;
}
.kai-card .line { font-size: 13px; margin: 2px 0; }
.kai-card .credit {
    margin-top: 7px; font-size: 12px; font-weight: 700; color: #FF8504;
}
.kai-card .actions { margin-top: 10px; display: flex; gap: 8px; }
.kai-card button {
    border: 0; border-radius: 9px; padding: 8px 18px;
    font: 600 13px 'Inter', sans-serif; cursor: pointer;
}
.kai-card .confirm {
    background: linear-gradient(160deg, #FF8504, #e66c00); color: #fff;
}
.kai-card .cancel {
    background: transparent; color: #9fb6c8;
    border: 1px solid rgba(159, 182, 200, .35);
}
.kai-card.resolved { opacity: .55; }
.kai-card.resolved button { pointer-events: none; }

/* ---- money-shot success card (SpotCast / TripCast / DeepCast) ------ */
.kai-result-card {
    --krc-accent: #4f87ff;
    align-self: flex-start; max-width: 92%;
    background: linear-gradient(160deg, #16233f, #101a30);
    border: 1px solid color-mix(in srgb, var(--krc-accent) 55%, transparent);
    border-left: 3px solid var(--krc-accent);
    border-radius: 14px; padding: 13px 15px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .38);
}
.kai-result-card .krc-head {
    display: flex; align-items: center; gap: 11px; margin-bottom: 9px;
}
.kai-result-card .krc-badge {
    flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--krc-accent);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--krc-accent) 45%, transparent);
}
.kai-result-card .krc-kicker {
    font-size: 11px; font-weight: 700; letter-spacing: .7px;
    text-transform: uppercase; color: var(--krc-accent);
}
.kai-result-card .krc-headline {
    font-size: 16px; font-weight: 700; color: #f2f6fb;
    line-height: 1.25; margin-top: 1px;
}
.kai-result-card .krc-line {
    font-size: 13px; color: #cdd8e6; margin: 3px 0; padding-left: 47px;
}
.kai-result-card .krc-status {
    margin-top: 10px; margin-left: 47px; display: inline-block;
    font-size: 12px; font-weight: 600; color: #eaf2fb;
    background: color-mix(in srgb, var(--krc-accent) 22%, transparent);
    border: 1px solid color-mix(in srgb, var(--krc-accent) 45%, transparent);
    padding: 4px 10px; border-radius: 999px;
}
/* pending: a small pulsing dot ahead of the text */
.kai-result-card .krc-status.krc-pending::before {
    content: ''; display: inline-block; width: 7px; height: 7px;
    border-radius: 50%; background: var(--krc-accent);
    margin-right: 7px; vertical-align: middle;
    animation: krc-pulse 1.1s ease-in-out infinite;
}
@keyframes krc-pulse {
    0%, 100% { opacity: .35; transform: scale(.8); }
    50% { opacity: 1; transform: scale(1.15); }
}
.kai-result-card.krc-done { border-color: var(--krc-accent); }
.kai-result-card.krc-done .krc-status {
    background: color-mix(in srgb, var(--krc-accent) 34%, transparent);
    color: #fff;
}
/* ready state: the actual forecast (the money shot) */
.kai-result-card .krc-forecast {
    margin-top: 11px; margin-left: 47px;
    padding-top: 11px; border-top: 1px solid rgba(255, 255, 255, .1);
}
.kai-result-card .krc-verdict {
    display: inline-block; font-size: 13px; font-weight: 800;
    letter-spacing: .8px; padding: 3px 12px; border-radius: 6px;
    color: #0d1220; margin-bottom: 7px;
}
.kai-result-card .krc-verdict.go { background: #4caf50; }
.kai-result-card .krc-verdict.caution { background: #ffb300; }
.kai-result-card .krc-verdict.nogo { background: #ef5350; color: #fff; }
.kai-result-card .krc-fc-read {
    font-size: 13px; line-height: 1.45; color: #eaf2fb;
    white-space: pre-wrap;
}
.kai-result-card .krc-fc-row {
    margin-top: 7px; font-size: 12.5px; line-height: 1.4;
    display: flex; gap: 7px;
}
.kai-result-card .krc-fc-label {
    flex: 0 0 auto; font-weight: 700; color: var(--krc-accent);
    text-transform: uppercase; letter-spacing: .4px; font-size: 11px;
    padding-top: 1px;
}
.kai-result-card .krc-fc-val { color: #cdd8e6; }
/* expandable "more details" */
.kai-result-card .krc-fc-toggle {
    margin-top: 10px; background: none; border: 0; cursor: pointer;
    padding: 2px 0; font: 600 12px 'Inter', sans-serif;
    color: var(--krc-accent); letter-spacing: .2px;
}
.kai-result-card .krc-fc-toggle::after {
    content: ' ▾'; font-size: 10px;
}
.kai-result-card .krc-fc-toggle[aria-expanded="true"]::after {
    content: ' ▴';
}
.kai-result-card .krc-fc-details { margin-top: 8px; }
.kai-result-card .krc-fc-day {
    margin-top: 9px; padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}
.kai-result-card .krc-fc-day-head {
    display: flex; align-items: center; gap: 8px; margin-bottom: 3px;
}
.kai-result-card .krc-fc-day-date {
    font-size: 12px; font-weight: 700; color: #eaf2fb;
}
.kai-result-card .krc-day-verdict {
    font-size: 10px; font-weight: 800; letter-spacing: .5px;
    padding: 1px 7px; border-radius: 4px; color: #0d1220;
}
.kai-result-card .krc-day-verdict.go { background: #4caf50; }
.kai-result-card .krc-day-verdict.caution { background: #ffb300; }
.kai-result-card .krc-day-verdict.nogo { background: #ef5350; color: #fff; }
.kai-result-card .krc-fc-day-sum {
    font-size: 12.5px; line-height: 1.45; color: #cdd8e6;
}
@media (max-width: 640px) {
    .kai-result-card .krc-forecast { margin-left: 0; }
}
@media (max-width: 640px) {
    .kai-result-card .krc-line,
    .kai-result-card .krc-status { padding-left: 0; margin-left: 0; }
}

/* Emergency */
.kai-emergency {
    align-self: stretch; background: #3a1212;
    border: 2px solid #e05252; border-radius: 14px; padding: 13px 15px;
}
.kai-emergency h4 { margin: 0 0 6px; color: #ff8080; font-size: 14px; }
.kai-emergency .pos {
    margin-top: 8px; font-family: monospace; font-size: 15px;
    font-weight: 700;
}

/* Image bubbles (pasted photos + Kai's report imagery) */
.kai-img-wrap {
    max-width: 78%; animation: kai-in .22s ease both;
}
.kai-img-wrap.you { align-self: flex-end; }
.kai-img-wrap.kai { align-self: flex-start; margin-left: 29px; }
.kai-img {
    display: block; max-width: 100%; border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.kai-img-wrap.you .kai-img {
    border: 2px solid rgba(255, 133, 4, .65);
    border-bottom-right-radius: 5px;
}
.kai-img-wrap.kai .kai-img {
    border: 1px solid rgba(79, 195, 247, .35);
    border-bottom-left-radius: 5px;
}
.kai-img-cap {
    font-size: 11px; color: #9fb6c8; margin-top: 4px; padding: 0 4px;
}
.kai-img-wrap.you .kai-img-cap { text-align: right; }

/* Attachment preview strip above the composer */
.kai-attach {
    flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; background: #0f1423;
    border-top: 1px solid rgba(79, 195, 247, .16);
}
.kai-attach-thumb {
    width: 44px; height: 44px; object-fit: cover; border-radius: 8px;
    border: 1px solid rgba(79, 195, 247, .35);
}
.kai-attach-label { font-size: 12px; color: #9fb6c8; flex: 1; }
.kai-attach-x {
    background: none; border: 0; color: #7da4c4; cursor: pointer;
    font-size: 22px; line-height: 1; min-width: 36px; min-height: 36px;
}
.kai-attach-x:hover { color: #fff; }

.kai-composer {
    flex: 0 0 auto; display: flex; gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(79, 195, 247, .16);
    background: #0f1423;
}
/* Add-photo button — quiet "+", deliberately less prominent than send */
.kai-attach-btn {
    flex: 0 0 auto; width: 30px; height: 30px; padding: 0;
    align-self: center;
    border: 1px solid #2a3d4f; border-radius: 50%;
    background: transparent; color: #6e8ba3; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color .15s ease, border-color .15s ease;
}
.kai-attach-btn:hover { color: #9fc3e0; border-color: #3a5570; }
.kai-attach-btn svg { width: 16px; height: 16px; }
.kai-composer input[type="text"] {
    flex: 1; min-width: 0;
    border: 1px solid #263a5e; border-radius: 11px;
    /* 16px minimum — iOS Safari auto-zooms the page on focus of any
       input below 16px, blowing the layout off-screen */
    padding: 10px 13px; font: 16px 'Inter', sans-serif;
    background: #0F2041; color: #e8eef4; outline: none;
    transition: border-color .15s ease;
}
.kai-composer input::placeholder { color: #64809a; }
.kai-composer input:focus {
    border-color: #4fc3f7;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, .15);
}
/* Send button (submit) — the prominent orange action */
.kai-composer button[type="submit"] {
    border: 0; border-radius: 11px; width: 42px;
    background: linear-gradient(160deg, #FF8504, #e66c00); color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform .12s ease;
}
.kai-composer button[type="submit"]:hover { transform: scale(1.05); }
.kai-composer button[type="submit"]:disabled {
    background: #263a5e; color: #64809a; transform: none;
    cursor: default;
}
.kai-composer button[type="submit"] svg { width: 18px; height: 18px; }

@media (max-width: 640px) {
    /* left+right anchoring, not 100vw — iOS viewport-unit quirks.
       Height uses dvh so the panel tracks the dynamic viewport; the
       visualViewport handler refines it while the keyboard is up. */
    .kai-panel { top: 0; left: 0; right: 0; bottom: auto;
                 width: auto; max-width: none;
                 height: 100dvh; z-index: 10050;
                 border-left: 0; }
    .kai-fab {
        right: 16px;
        bottom: 86px; /* 48px tall bubble — same 110px center as + CTA */
        width: 54px; height: 48px; border-radius: 16px;
    }
    .kai-fab-logo { width: 32px; height: 32px; }
}

/* ---- Kai-placed map pins (drop_pin tool) ------------------------- */
.kai-map-pin {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}
.kai-map-arrow {
    width: 20px;
    height: 20px;
    transform-origin: center center;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}
/* Leaflet tooltip carrying a pin/line label — style appearance only,
   never position (Leaflet owns that via direction/offset). */
.leaflet-tooltip.kai-map-label {
    background: rgba(30, 30, 50, 0.95);
    color: #fff;
    font: 600 11px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 3px 8px;
    border-radius: 5px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.leaflet-tooltip.kai-map-label.leaflet-tooltip-top:before {
    border-top-color: rgba(30, 30, 50, 0.95);
}
