body>#chatbot-toggle-btn {
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 2000;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #4F70B9;
    border: 2px solid #FFFFFF;
    box-shadow: 0 3px 12px rgba(54, 82, 150, 0.28);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

body>#chatbot-toggle-btn:hover {
    transform: scale(1.08);
    box-shadow: 0px 6px 22px 0px rgba(54, 82, 150, 0.6);
}

.chatbot-map-btn {
    position: relative;
    cursor: pointer;
}

.chatbot-map-btn svg {
    color: #365296;
    transition: color 0.3s ease;
}

.chatbot-map-btn:hover svg,
.chatbot-map-btn.active svg {
    color: #ffffff;
}

.chatbot-profile-picker {
    position: absolute;
    right: calc(100% - 2px);
    top: 50%;
    z-index: 2001;
    width: 128px;
    height: 60px;
    box-sizing: border-box;
    display: flex;
    align-items: stretch;
    padding: 0;
    margin: 0;
    gap: 0;
    border: 1px solid #C8D5EE;
    border-radius: 31px;
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(56, 79, 128, 0.16);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-50%) translateX(7px);
    transform-origin: right center;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.chatbot-profile-picker.open {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}

.profile-pill {
    position: relative;
    flex: 1 1 50%;
    width: 50%;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s ease;
}

.profile-pill+.profile-pill {
    border-left: 1px solid #A7B5CF;
}

.profile-pill:hover {
    background: rgba(242, 246, 255, 0.7);
}

.profile-pill:active {
    background: rgba(232, 238, 252, 0.9);
}

.profile-pill-icon {
    display: block;
    width: 50px;
    height: 50px;
    pointer-events: none;
    user-select: none;
}

.maptool-btn:hover .profile-pill-icon,
.maptool-btn:active .profile-pill-icon,
.maptool-btn.active .profile-pill-icon {
    filter: none;
}

.profile-pill.is-disabled {
    opacity: 0.5;
    filter: grayscale(0.2);
    cursor: not-allowed;
}

.profile-pill.is-disabled:hover,
.profile-pill.is-disabled:active {
    background: transparent;
}

@media (max-width: 520px) {
    .chatbot-profile-picker {
        width: 122px;
        height: 58px;
    }

    .profile-pill-icon {
        width: 46px;
        height: 46px;
    }
}

.chatbot-mode-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    cursor: pointer;
    vertical-align: middle;
    transition: opacity 0.15s ease;
}

.chatbot-mode-badge:empty {
    display: none;
}

.chatbot-mode-badge:hover {
    opacity: 0.85;
}

.chatbot-mode-badge.badge-pro {
    background: linear-gradient(135deg, #4F8CFF 0%, #8B5CF6 100%);
    color: #fff;
}

.chatbot-mode-badge.badge-core {
    background: linear-gradient(135deg, #EC4899 0%, #D946EF 100%);
    color: #fff;
}

.chatbot-notif-pulse {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FF451C;
    border: 2px solid #fff;
    display: none;
}

#chatbot-toggle-btn .chat-icon,
#chatbot-toggle-btn .close-icon {
    width: 29px;
    height: 29px;
    position: absolute;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#chatbot-toggle-btn .close-icon {
    opacity: 0;
    transform: rotate(90deg);
}

#chatbot-toggle-btn.active .chat-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

#chatbot-toggle-btn.active .close-icon {
    opacity: 1;
    transform: rotate(0deg);
}

#chatbot-toggle-btn .notif-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #FF451C;
    border: 2px solid #fff;
    animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#chatbot-panel {
    --cb-grad1: #6A8BDA;
    --cb-grad2: #365296;

    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: 1999;
    width: 360px;
    height: 520px;
    border-radius: 16px;
    background: #ffffff;
    border: 1.2px solid #A5B9E9;
    box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;

    transform: translateY(20px) scale(0.97) translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#chatbot-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1) translateZ(0);
    pointer-events: all;
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(144.01deg, var(--cb-grad1) -4.67%, var(--cb-grad2) 63.12%);
    flex-shrink: 0;
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

#chatbot-panel.dragging {
    transition: none !important;
    box-shadow: 0px 14px 48px 0px rgba(0, 0, 0, 0.28);
}

#chatbot-panel.dragging .chatbot-header {
    cursor: grabbing;
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-avatar svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.chatbot-title {
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

.chatbot-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 400;
    margin: 0;
}

.chatbot-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ADE80;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    margin-left: 4px;
    display: inline-block;
    animation: pulse-dot 2s infinite;
}

.chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: default;
}

.chatbot-header-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
    padding: 0;
}

.chatbot-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-header-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 14px 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #F5F8FF;
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #C3CFF5;
    border-radius: 4px;
}

.chat-date-separator {
    text-align: center;
    font-size: 10px;
    color: #9CA3AF;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 0.04em;
    margin: 4px 0;
}

.chat-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: msgSlideIn 0.22s ease;
}

@keyframes msgSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.bot-msg {
    flex-direction: row;
}

.chat-message.user-msg {
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(144deg, var(--cb-grad1), var(--cb-grad2));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.msg-avatar svg {
    width: 15px;
    height: 15px;
    fill: #fff;
}

.msg-bubble-wrap {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    min-width: 0;
    gap: 2px;
}

.chat-message.user-msg .msg-bubble-wrap {
    align-items: flex-end;
}

.msg-bubble {
    padding: 9px 13px;
    border-radius: 14px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    line-height: 1.55;
    word-break: break-word;
}

.bot-msg .msg-bubble {
    background: #ffffff;
    color: #1F2937;
    border: 1px solid #E5EDFF;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(54, 82, 150, 0.08);
}

.user-msg .msg-bubble {
    background: linear-gradient(144.01deg, var(--cb-grad1) -4.67%, var(--cb-grad2) 63.12%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(54, 82, 150, 0.3);
}

.msg-time {
    font-size: 10px;
    color: #9CA3AF;
    font-family: 'Roboto', sans-serif;
    padding: 0 3px;
}


.typing-indicator {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.typing-wrap {
    flex: 1 1 auto;
    max-width: 82%;
    min-width: 0;
}

.think-panel {
    position: relative;
    border: 1px solid #E5EDFF;
    border-radius: 12px;
    background: #FBFCFF;
    box-shadow: 0 1px 4px rgba(54, 82, 150, 0.07);
    overflow: hidden;
    animation: thinkPanelIn 0.28s ease both;
}

.think-panel.is-live::before {
    content: '';
    position: absolute;
    top: 0;
    left: -36%;
    width: 36%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #6A8BDA, transparent);
    animation: thinkSweep 1.7s ease-in-out infinite;
    pointer-events: none;
}

.msg-bubble-wrap>.think-panel {
    margin-bottom: 5px;
}

.chat-message.has-think {
    align-items: flex-start;
}

.think-head {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    background: transparent;
    font-family: 'Roboto', sans-serif;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease;
}

.think-head:hover {
    background: #F4F7FF;
}

.think-head:focus-visible {
    outline: 2px solid #6A8BDA;
    outline-offset: -2px;
}

.think-caret {
    display: flex;
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    color: #8FA3CE;
    transition: transform 0.22s ease;
}

.think-caret svg {
    width: 100%;
    height: 100%;
}

.think-panel.is-collapsed .think-caret {
    transform: rotate(-90deg);
}

.think-bulb {
    display: flex;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    color: #E0A63C;
}

.think-bulb svg {
    width: 100%;
    height: 100%;
}

.think-panel.is-live .think-bulb {
    animation: bulbGlow 1.9s ease-in-out infinite;
}

.think-title {
    flex: 0 0 auto;
    font-size: 12.5px;
    font-weight: 600;
    color: #2F4372;
    white-space: nowrap;
}

.think-now {
    display: none;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 11.5px;
    color: #7286AE;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.think-panel.is-collapsed .think-now {
    display: block;
}

.think-meta {
    flex: 0 0 auto;
    margin-left: auto;
    padding-left: 8px;
    font-size: 10.5px;
    color: #9AA7C7;
    white-space: nowrap;
}

.think-body {
    padding: 0 10px 10px;
}

.think-panel.is-collapsed .think-body {
    display: none;
}

.think-steps {
    list-style: none;
    margin: 0;
    padding: 8px 11px;
    border: 1px solid #EDEAFA;
    border-radius: 9px;
    background: #ffffff;
}

.think-step {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 5px 0;
    font: 400 12px/1.5 'Roboto', sans-serif;
    color: #7C8AA8;
    animation: statusFadeSlide 0.3s ease both;
    --stage: #A5B9E9;
}

.think-step[data-stage="think"] {
    --stage: #6A8BDA;
}

.think-step[data-stage="fetch"] {
    --stage: #4FA3E3;
}

.think-step[data-stage="compute"] {
    --stage: #7C6CE0;
}

.think-step[data-stage="lookup"] {
    --stage: #46B08C;
}

.think-step[data-stage="synth"] {
    --stage: #E0A63C;
}

.think-step[data-stage="recall"] {
    --stage: #9AA7C7;
}

.think-step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 4.5px;
    top: 15px;
    bottom: -1px;
    width: 2px;
    background: #DCE4F7;
    border-radius: 2px;
}

.think-step-mark {
    position: relative;
    flex: 0 0 auto;
    width: 11px;
    height: 11px;
    margin-top: 3px;
    border: 2px solid var(--stage);
    border-radius: 50%;
    background: #ffffff;
    box-sizing: border-box;
}

.think-step.is-done .think-step-mark {
    background: var(--stage);
}

.think-step.is-done .think-step-mark::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 0;
    width: 2px;
    height: 5px;
    border: solid #ffffff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.think-step.is-active .think-step-mark {
    background: var(--stage);
}

.think-panel.is-live .think-step.is-active .think-step-mark::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid var(--stage);
    border-radius: 50%;
    animation: markRing 1.5s ease-out infinite;
}

.think-step-text {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.think-step.is-active {
    color: #2F4372;
    font-weight: 500;
}

.think-panel.is-live .think-step.is-active .think-step-text {
    background: linear-gradient(90deg, #2F4372 20%, #9FB0D6 50%, #2F4372 80%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: textShimmer 2.4s linear infinite;
}


.status-swap {
    animation: statusFadeSlide 0.32s ease both;
}

@keyframes thinkPanelIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes thinkSweep {
    0% {
        left: -36%;
    }

    60%,
    100% {
        left: 100%;
    }
}

@keyframes statusFadeSlide {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes markRing {
    0% {
        transform: scale(0.55);
        opacity: 0.6;
    }

    70% {
        transform: scale(1.6);
        opacity: 0;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

@keyframes textShimmer {
    from {
        background-position: 120% 0;
    }

    to {
        background-position: -120% 0;
    }
}

@keyframes bulbGlow {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.92);
    }
}

@media (prefers-reduced-motion: reduce) {

    .think-panel,
    .think-panel *,
    .think-panel *::before,
    .think-panel *::after {
        animation: none !important;
    }

    .think-panel.is-live .think-step.is-active .think-step-text {
        color: #2F4372;
        -webkit-text-fill-color: #2F4372;
        background: none;
    }
}

.chatbot-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px 12px;
    background: #ffffff;
    border-top: 1px solid #E5EDFF;
    flex-shrink: 0;
}

#chatbot-input {
    flex: 1;
    border: 1.5px solid #D1DCFF;
    border-radius: 12px;
    padding: 8px 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #1F2937;
    background: #F5F8FF;
    resize: none;
    outline: none;
    max-height: 100px;
    overflow-y: auto;
    transition: border-color 0.15s ease;
}

#chatbot-input:focus {
    border-color: #365296;
    background: #fff;
}

#chatbot-input::placeholder {
    color: #9CA3AF;
}

#chatbot-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(144.01deg, var(--cb-grad1) -4.67%, var(--cb-grad2) 63.12%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    outline: none;
}

#chatbot-send-btn:hover:not(:disabled) {
    opacity: 0.85;
    transform: scale(1.05);
}

#chatbot-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#chatbot-send-btn svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#chatbot-send-btn.stop-mode .send-icon {
    display: none !important;
}

#chatbot-send-btn.stop-mode .stop-icon {
    display: block !important;
    fill: #ffffff !important;
    stroke: none !important;
}

.error-bubble {
    background: #FFF0EE !important;
    border-color: #FF6B6B !important;
    color: #D93025 !important;
}

.scroll-to-bottom {
    position: absolute;
    bottom: 82px;
    right: 30px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #365296;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.scroll-to-bottom.visible {
    opacity: 1;
}

.cb-record-heading {
    font-weight: 600;
    font-size: 13px;
    color: #1a2f60;
    margin-top: 8px;
    margin-bottom: 3px;
    letter-spacing: 0.01em;
}

.cb-record-heading:first-child {
    margin-top: 0;
}

.cb-field-row {
    font-size: 12.5px;
    color: #374151;
    padding: 1px 0 1px 10px;
    border-left: 2px solid #C3CFF5;
    margin-bottom: 2px;
    line-height: 1.5;
}

.cb-field-name {
    color: #6B7DC2;
    font-weight: 500;
}

.cb-record-gap {
    height: 8px;
}

.msg-bubble strong {
    color: #1a2f60;
    font-weight: 600;
}

.msg-bubble code {
    background: #F1F4FC;
    color: #365296;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.92em;
    font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
}

.cb-subheading {
    font-weight: 600;
    font-size: 13px;
    color: #1a2f60;
    margin: 10px 0 4px;
    letter-spacing: 0.01em;
}

.cb-subheading:first-child {
    margin-top: 0;
}

.cb-list {
    margin: 2px 0 6px;
    padding-left: 18px;
}

.cb-list li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.cb-list li::marker {
    color: #6A8BDA;
}

.msg-bubble-wrap.has-table,
.msg-bubble-wrap.has-card {
    flex: 1 1 auto;
    max-width: calc(100% - 50px);
}

.cb-table-wrap {
    max-width: 100%;
    max-height: 240px;
    margin: 6px 0;
    overflow: auto;
    border: 1px solid #E5EDFF;
    border-radius: 8px;
    scrollbar-width: thin;
    scrollbar-color: #C3CFF5 transparent;
}

.cb-table-wrap::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.cb-table-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.cb-table-wrap::-webkit-scrollbar-thumb {
    background: #C3CFF5;
    border-radius: 4px;
}

.cb-table-wrap::-webkit-scrollbar-corner {
    background: transparent;
}

.cb-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Roboto', sans-serif;
    font-size: 11.5px;
}

.cb-table th,
.cb-table td {
    padding: 7px 10px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid #EEF2FC;
}

.cb-table th:not(:last-child),
.cb-table td:not(:last-child) {
    border-right: 1px solid #F3F6FE;
}

.cb-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #F3F6FF;
    color: #2F4372;
    font-weight: 600;
    border-bottom: 1px solid #E0E7FA;
}

.cb-table tbody tr:nth-child(even) {
    background: #FAFBFF;
}

.cb-table tbody tr:hover {
    background: #EEF3FF;
}

.cb-table tbody tr.cb-row-clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}

.cb-table tbody tr.cb-row-clickable:hover {
    background: #E4ECFC;
}

.cb-table tbody tr.cb-row-clickable:hover td:first-child {
    color: #365296;
}

.cb-table tbody tr.cb-row-clickable td:first-child {
    position: relative;
    padding-left: 22px;
}

.cb-table tbody tr.cb-row-clickable td:first-child::before {
    content: '📍';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.5;
}

.cb-table tbody tr.cb-row-clickable.is-selected {
    background: #DCE9FB;
    box-shadow: inset 3px 0 0 #365296;
}

.cb-table tbody tr.cb-row-clickable.is-selected td:first-child::before {
    opacity: 1;
}

.cb-map-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    outline: none;
    white-space: nowrap;
}

.cb-map-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26, 115, 232, 0.50);
    background: linear-gradient(135deg, #2979ff 0%, #1565c0 100%);
}

.cb-map-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(26, 115, 232, 0.30);
}

.cb-map-btn-icon {
    font-size: 13px;
    line-height: 1;
}


#chatbot-panel {
    --cb-bg: #F5F8FF;
    --cb-surface: #FFFFFF;
    --cb-surface-2: #FBFCFF;
    --cb-text: #1F2937;
    --cb-heading: #1a2f60;
    --cb-muted: #7C8AA8;
    --cb-border: #E5EDFF;
    --cb-soft: #EEF3FF;
    --cb-live: #16A34A;
    --cb-spring: cubic-bezier(0.2, 1.3, 0.35, 1);
    transform-origin: bottom right;
    transform: translateY(18px) scale(0.9) translateZ(0);
    transition: opacity 0.22s ease, transform 0.42s var(--cb-spring),
        width 0.3s ease, height 0.3s ease;
}

#chatbot-panel.open {
    transform: translateY(0) scale(1) translateZ(0);
}

#chatbot-panel.is-expanded {
    width: 440px;
    height: calc(100vh - 120px);
    max-height: 900px;
}

#chatbot-toggle-btn::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 2px solid rgba(139, 92, 246, 0.55);
    opacity: 0;
    pointer-events: none;
}

#chatbot-toggle-btn:hover::after {
    animation: cbBreathe 1.6s ease-in-out infinite;
}

@keyframes cbBreathe {

    0%,
    100% {
        opacity: 0;
        transform: scale(0.94);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.06);
    }
}

.chatbot-header {
    position: relative;
    overflow: hidden;
}

.chatbot-header>* {
    position: relative;
    z-index: 1;
}

.chatbot-header::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: translateX(-120%);
    pointer-events: none;
}

#chatbot-panel.is-working .chatbot-header::after {
    animation: cbHeaderSweep 1.8s ease-in-out infinite;
}

@keyframes cbHeaderSweep {
    from {
        transform: translateX(-120%);
    }

    to {
        transform: translateX(260%);
    }
}

.chatbot-status-dot {
    animation: none;
}

#chatbot-panel.is-working .chatbot-status-dot {
    animation: pulse-dot 1.2s infinite;
}

.chatbot-header-btn {
    transition: background 0.15s ease, transform 0.2s var(--cb-spring);
}

.chatbot-header-btn:hover {
    transform: scale(1.08);
}

.chatbot-header-btn[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.34);
}

.chat-message {
    animation: cbMsgIn 0.42s var(--cb-spring) both;
}

.chat-message.user-msg {
    transform-origin: bottom right;
}

.chat-message.bot-msg {
    transform-origin: bottom left;
}

@keyframes cbMsgIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cb-stream-tail {
    min-height: 1em;
}

.cb-in {
    animation: cbRise 0.3s ease both;
}

.cb-fresh {
    animation: cbFade 0.28s ease both;
}

@keyframes cbRise {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cbFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.think-step-icon {
    flex: 0 0 auto;
    font-size: 12px;
    line-height: 1.5;
    width: 16px;
    text-align: center;
}

.think-step[data-stage="camera"] {
    --stage: #4F8CFF;
}

.think-step[data-stage="map"] {
    --stage: #10B981;
}

.think-step[data-stage="flood"] {
    --stage: #0EA5E9;
}

.think-step.is-active .think-step-icon {
    animation: cbIconPop 0.45s var(--cb-spring) both;
}

.think-step.is-done .think-step-icon {
    opacity: 0.75;
}

@keyframes cbIconPop {
    from {
        transform: scale(0.4);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.cb-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 4px 4px;
    animation: cbRise 0.4s ease both;
}

.cb-welcome.is-leaving {
    animation: cbLeave 0.22s ease both;
}

@keyframes cbLeave {
    to {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
}

.cb-welcome-orb {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(144deg, var(--cb-grad1), var(--cb-grad2));
    box-shadow: 0 8px 24px rgba(79, 140, 255, 0.35);
    animation: cbOrbIn 0.6s var(--cb-spring) both;
}

.cb-welcome-orb svg {
    width: 26px;
    height: 26px;
    fill: #fff;
}

@keyframes cbOrbIn {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-20deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.cb-welcome-title {
    margin-top: 10px;
    font: 600 16px/1.3 'Roboto', sans-serif;
    color: var(--cb-heading);
}

.cb-welcome-sub {
    margin: 4px 8px 12px;
    font: 400 12px/1.5 'Roboto', sans-serif;
    color: var(--cb-muted);
}

#chatbot-send-btn {
    transition: opacity 0.15s ease, transform 0.25s var(--cb-spring);
}

#chatbot-send-btn.stop-mode {
    background: linear-gradient(144deg, #F87171, #DC2626);
}

#chatbot-send-btn.cb-pop {
    animation: cbPop 0.4s var(--cb-spring);
}

#chatbot-send-btn:active:not(:disabled) {
    transform: scale(0.92);
}

@keyframes cbPop {
    0% {
        transform: scale(0.8);
    }

    100% {
        transform: scale(1);
    }
}

.cb-table tbody tr.cb-row-clickable {
    transition: background 0.15s ease, box-shadow 0.2s ease;
}

.cb-table tbody tr.cb-row-clickable:hover {
    box-shadow: inset 3px 0 0 var(--cb-grad1), 0 2px 8px rgba(54, 82, 150, 0.12);
}

.cb-map-btn:hover .cb-map-btn-icon {
    animation: cbPinBounce 0.6s var(--cb-spring);
    display: inline-block;
}

@keyframes cbPinBounce {
    0% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0);
    }
}

.msg-actions {
    display: flex;
    gap: 6px;
    padding: 2px 2px 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat-message.bot-msg:hover .msg-actions,
.msg-actions:focus-within {
    opacity: 1;
}

.cb-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid var(--cb-border);
    border-radius: 12px;
    background: var(--cb-surface);
    color: var(--cb-muted);
    font: 500 10.5px 'Roboto', sans-serif;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.cb-copy svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cb-copy:hover {
    color: var(--cb-grad2);
    border-color: var(--cb-grad1);
}

.cb-copy.is-done {
    color: var(--cb-live);
    border-color: var(--cb-live);
}

.cb-live,
.cb-nofeed {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 8px;
    border-radius: 10px;
    font: 700 10px/1.6 'Roboto', sans-serif;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.cb-live {
    background: rgba(22, 163, 74, 0.12);
    color: var(--cb-live);
}

.cb-live::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cb-live);
    animation: cbLivePulse 1.2s ease-in-out 3;
}

.cb-nofeed {
    background: rgba(124, 138, 168, 0.14);
    color: var(--cb-muted);
    letter-spacing: 0.02em;
    font-weight: 600;
}

@keyframes cbLivePulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.8);
        opacity: 0.35;
    }
}

.cb-card {
    margin: 0 0 8px;
    padding: 10px 12px;
    border: 1px solid var(--cb-border);
    border-radius: 12px;
    background: linear-gradient(160deg, var(--cb-surface-2), var(--cb-surface));
    animation: cbRise 0.4s ease both;
}

.cb-card-head {
    display: flex;
    align-items: center;
    gap: 9px;
}

.cb-card-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--cb-soft);
    font-size: 15px;
    flex: 0 0 auto;
}

.cb-card-titles {
    flex: 1 1 auto;
    min-width: 0;
}

.cb-card-title {
    font: 600 13px/1.3 'Roboto', sans-serif;
    color: var(--cb-heading);
}

.cb-card-sub {
    font: 400 11px/1.4 'Roboto', sans-serif;
    color: var(--cb-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-card-body {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.cb-card-body .cb-tiles {
    flex: 1 1 auto;
    margin-top: 0;
}

.cb-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.cb-tiles-3 {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
}

.cb-tile {
    padding: 8px 9px;
    border-radius: 10px;
    background: var(--cb-soft);
    animation: cbRise 0.4s ease both;
}

.cb-tile:nth-child(2) {
    animation-delay: 0.06s;
}

.cb-tile:nth-child(3) {
    animation-delay: 0.12s;
}

.cb-tile:nth-child(4) {
    animation-delay: 0.18s;
}

.cb-tile-value {
    font: 700 17px/1.2 'Roboto', sans-serif;
    color: var(--cb-heading);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cb-tile-unit {
    margin-left: 3px;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--cb-muted);
}

.cb-tile-label {
    margin-top: 2px;
    font: 500 10.5px/1.3 'Roboto', sans-serif;
    color: var(--cb-muted);
}

.cb-tile.is-live .cb-tile-value {
    color: var(--cb-live);
}

.cb-tile.is-covered .cb-tile-value {
    color: #059669;
}

.cb-tile.is-blind .cb-tile-value {
    color: #D97706;
}

.cb-bar {
    position: relative;
    display: block;
    height: 6px;
    margin-top: 10px;
    border-radius: 3px;
    background: var(--cb-soft);
    overflow: hidden;
}

.cb-bar>span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--cb-grad1), var(--cb-live));
    transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.cb-ring {
    position: relative;
    flex: 0 0 auto;
    width: 74px;
    height: 74px;
}

.cb-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.cb-ring-track {
    fill: none;
    stroke: var(--cb-soft);
    stroke-width: 7;
}

.cb-ring-fill {
    fill: none;
    stroke: var(--cb-grad1);
    stroke-width: 7;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.cb-ring.is-covered .cb-ring-fill {
    stroke: #10B981;
}

.cb-ring.is-score .cb-ring-fill {
    stroke: var(--cb-grad2);
}

.cb-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 15px 'Roboto', sans-serif;
    color: var(--cb-heading);
    font-variant-numeric: tabular-nums;
}

.cb-ring-text small {
    font-size: 10px;
    margin-left: 1px;
    color: var(--cb-muted);
}

.cb-params {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cb-param {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 1fr 26px;
    align-items: center;
    gap: 7px;
}

.cb-param-name {
    font: 500 11px 'Roboto', sans-serif;
    color: var(--cb-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-param .cb-bar {
    margin-top: 0;
}

.cb-param-score {
    font: 600 11px 'Roboto', sans-serif;
    color: var(--cb-muted);
    text-align: right;
}

.cb-details-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 0;
    border: 0;
    background: none;
    color: var(--cb-grad2);
    font: 600 11.5px 'Roboto', sans-serif;
    cursor: pointer;
}

.cb-details-toggle svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.25s ease;
}

.cb-details-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.cb-details {
    display: none;
}

.cb-details.is-open {
    display: block;
    animation: cbRise 0.3s ease both;
}

@media (prefers-reduced-motion: reduce) {

    #chatbot-panel,
    #chatbot-panel *,
    #chatbot-panel *::before,
    #chatbot-panel *::after,
    #chatbot-toggle-btn::after {
        animation: none !important;
        transition: none !important;
    }
}

html.cb-session-locked #chatbot-panel,
html.cb-session-locked #chatbot-toggle-btn,
html.cb-session-locked .chatbot-profile-picker {
    display: none !important;
}