.chatbot-panel.active {
    overflow: hidden;
    padding: 0;
}

.chatbot-shell {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #d8e2ef;
    border-radius: 10px;
    background: #ffffff;
}

.chatbot-history-panel {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    padding: 16px 12px 12px;
    border-right: 1px solid #dce4ed;
    background: #f7f9fc;
}

.chatbot-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 4px 12px;
}

.chatbot-eyebrow {
    display: block;
    color: #55738f;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}

.chatbot-history-header h3 {
    margin-top: 2px;
    color: #172b3d;
    font-size: 17px;
}

.chatbot-new-button {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 34px;
    padding: 5px 9px;
    border: 1px solid #9ebbd5;
    border-radius: 6px;
    background: #ffffff;
    color: #0c4f88;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.chatbot-new-button:hover {
    border-color: #477fae;
    background: #edf5fc;
}

.chatbot-history-scope {
    margin: 0 4px 9px;
    color: #718094;
    font-size: 12px;
    line-height: 1.4;
}

.chatbot-conversation-list {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
    padding: 1px 2px 8px;
}

.chatbot-conversation-empty {
    padding: 18px 10px;
    color: #78889a;
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

.chatbot-conversation-item {
    width: 100%;
    padding: 10px 10px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #33495f;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.chatbot-conversation-item:hover {
    border-color: #d6e1ec;
    background: #ffffff;
}

.chatbot-conversation-item.active {
    border-color: #a7c4df;
    background: #eaf3fb;
    color: #123f67;
}

.chatbot-conversation-item-title {
    display: block;
    overflow: hidden;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatbot-conversation-item-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    color: #7b8997;
    font-size: 11px;
}

.chatbot-conversation-owner {
    max-width: 92px;
    overflow: hidden;
    padding: 1px 5px;
    border-radius: 999px;
    background: #e3e8ee;
    color: #516273;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatbot-workspace {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    background: #ffffff;
}

.chatbot-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 74px;
    padding: 12px 18px;
    border-bottom: 1px solid #e2e8ef;
}

.chatbot-title-area {
    min-width: 0;
}

.chatbot-title-area h3 {
    overflow: hidden;
    color: #172b3d;
    font-size: 17px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatbot-title-area p {
    margin-top: 3px;
    color: #6f7f90;
    font-size: 12px;
}

.chatbot-owner-badge {
    display: inline-flex;
    margin-bottom: 3px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #eef1f5;
    color: #526579;
    font-size: 11px;
    font-weight: 750;
}

.chatbot-messages {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    padding: 28px clamp(22px, 5vw, 72px) 24px;
    background: #ffffff;
}

.chatbot-empty-state {
    display: flex;
    width: min(660px, 100%);
    margin: auto;
    flex-direction: column;
    align-items: center;
    color: #586b7d;
    text-align: center;
}

.chatbot-empty-mark {
    display: grid;
    width: 46px;
    height: 46px;
    margin-bottom: 13px;
    place-items: center;
    border-radius: 13px;
    background: #124f82;
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
}

.chatbot-empty-state h3 {
    color: #1b3348;
    font-size: 19px;
    letter-spacing: -0.35px;
}

.chatbot-empty-state > p {
    max-width: 520px;
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.6;
}

.chatbot-suggestion-grid {
    display: grid;
    width: 100%;
    margin-top: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.chatbot-suggestion-grid button {
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #dbe4ed;
    border-radius: 8px;
    background: #ffffff;
    color: #425b71;
    font-family: inherit;
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
}

.chatbot-suggestion-grid button:hover {
    border-color: #94b6d2;
    background: #f7fbff;
    color: #184f7c;
}

.chatbot-message {
    display: flex;
    width: min(820px, 100%);
    gap: 10px;
    align-self: center;
}

.chatbot-message-avatar {
    display: grid;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    place-items: center;
    border-radius: 7px;
    background: #164f80;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.chatbot-message.user .chatbot-message-avatar {
    background: #e5ebf1;
    color: #45596d;
}

.chatbot-message-body {
    min-width: 0;
    flex: 1 1 auto;
}

.chatbot-message-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 20px;
    color: #788695;
    font-size: 11.5px;
}

.chatbot-message-meta strong {
    color: #304a61;
    font-size: 12.5px;
}

.chatbot-message-model {
    padding: 1px 5px;
    border-radius: 999px;
    background: #edf2f7;
    color: #5b6e80;
}

.chatbot-message-clarification-badge {
    padding: 1px 6px;
    border: 1px solid #e1bd70;
    border-radius: 999px;
    background: #fff8e8;
    color: #856019;
    font-weight: 750;
}

.chatbot-message-content {
    margin-top: 4px;
    color: #253b4e;
    font-size: 14px;
    line-height: 1.75;
    overflow-wrap: anywhere;
    white-space: normal;
}

.chatbot-message.user .chatbot-message-content {
    display: inline-block;
    padding: 9px 12px;
    border-radius: 3px 10px 10px 10px;
    background: #f0f4f8;
    white-space: pre-wrap;
}

.chatbot-message.error .chatbot-message-content {
    color: #a1232c;
}

.chatbot-message.clarification .chatbot-message-content {
    padding: 11px 13px;
    border: 1px solid #e4c77f;
    border-left: 4px solid #d29b2d;
    border-radius: 4px 9px 9px 4px;
    background: #fffaf0;
    color: #493d27;
}

.chatbot-message-content > :first-child {
    margin-top: 0;
}

.chatbot-message-content > :last-child {
    margin-bottom: 0;
}

.chatbot-message-content p {
    margin: 0 0 9px;
}

.chatbot-message-content h1,
.chatbot-message-content h2,
.chatbot-message-content h3,
.chatbot-message-content h4,
.chatbot-message-content h5,
.chatbot-message-content h6 {
    margin: 18px 0 7px;
    color: #173b59;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: -0.2px;
}

.chatbot-message-content h1 { font-size: 21px; }
.chatbot-message-content h2 { font-size: 19px; }
.chatbot-message-content h3 { font-size: 17px; }
.chatbot-message-content h4 { font-size: 15.5px; }
.chatbot-message-content h5 { font-size: 14.5px; }
.chatbot-message-content h6 { font-size: 13.5px; }

.chatbot-message-content ul,
.chatbot-message-content ol {
    margin: 7px 0 11px;
    padding-left: 24px;
}

.chatbot-message-content li + li {
    margin-top: 3px;
}

.chatbot-message-content blockquote {
    margin: 11px 0;
    padding: 7px 12px;
    border-left: 3px solid #8eb2d0;
    background: #f4f8fb;
    color: #4d6478;
}

.chatbot-message-content blockquote > :last-child {
    margin-bottom: 0;
}

.chatbot-message-content hr {
    height: 1px;
    margin: 17px 0;
    border: 0;
    background: #dce5ed;
}

.chatbot-message-content a {
    color: #17649d;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.chatbot-message-content a:hover {
    color: #0d4772;
}

.chatbot-message-content :not(pre) > code {
    padding: 2px 5px;
    border: 1px solid #dce4eb;
    border-radius: 4px;
    background: #f3f6f8;
    color: #9a2f49;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.9em;
    white-space: break-spaces;
}

.chatbot-message-content pre {
    overflow-x: auto;
    margin: 9px 0;
    padding: 10px 12px;
    border: 1px solid #d9e1e9;
    border-radius: 6px;
    background: #f6f8fa;
    color: #24384b;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12.5px;
    line-height: 1.55;
    white-space: pre;
}

.chatbot-message-content pre code {
    font: inherit;
}

.chatbot-table-wrapper {
    position: relative;
    width: 100%;
    margin: 12px 0;
    overflow: hidden;
    border: 1px solid #d4dee8;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(31, 56, 80, 0.05);
    white-space: normal;
}

.chatbot-table-actions {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: flex-end;
    padding: 4px 7px;
    border-bottom: 1px solid #dde5ed;
    background: #f7f9fb;
}

.chatbot-table-copy-button {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    gap: 6px;
    padding: 3px 7px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: #496176;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 750;
    opacity: 0;
    pointer-events: none;
    transform: translateY(2px);
    transition: opacity 120ms ease, transform 120ms ease, background-color 120ms ease;
    cursor: pointer;
}

.chatbot-table-wrapper:hover .chatbot-table-copy-button,
.chatbot-table-wrapper:focus-within .chatbot-table-copy-button {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.chatbot-table-copy-button:hover {
    border-color: #bdcddd;
    background: #ffffff;
    color: #174f7d;
}

.chatbot-table-copy-button:focus-visible {
    outline: 2px solid #377daf;
    outline-offset: 1px;
}

.chatbot-table-copy-button[data-state="success"] {
    color: #267044;
}

.chatbot-table-copy-button[data-state="error"] {
    color: #a1232c;
}

.chatbot-table-copy-icon {
    position: relative;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

.chatbot-table-copy-icon::before,
.chatbot-table-copy-icon::after {
    position: absolute;
    width: 8px;
    height: 9px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    content: "";
}

.chatbot-table-copy-icon::before {
    top: 1px;
    left: 4px;
    background: #f7f9fb;
}

.chatbot-table-copy-icon::after {
    top: 4px;
    left: 1px;
    background: inherit;
}

.chatbot-table-copy-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.chatbot-table-scroller {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.chatbot-table-scroller table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: #2b4154;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
}

.chatbot-table-scroller th,
.chatbot-table-scroller td {
    min-width: 110px;
    max-width: 400px;
    padding: 9px 11px;
    border-right: 1px solid #dfe6ed;
    border-bottom: 1px solid #e4eaf0;
    overflow-wrap: anywhere;
    text-align: left;
    vertical-align: top;
    white-space: normal;
}

.chatbot-table-scroller th {
    background: #edf4fa;
    color: #243f56;
    font-weight: 800;
}

.chatbot-table-scroller tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.chatbot-table-scroller tbody tr:hover td {
    background: #eef6fc;
}

.chatbot-table-scroller tr > :last-child {
    border-right: 0;
}

.chatbot-table-scroller tbody tr:last-child td {
    border-bottom: 0;
}

.chatbot-table-scroller [data-align="center"] {
    text-align: center;
}

.chatbot-table-scroller [data-align="right"] {
    text-align: right;
}

.chatbot-progress {
    display: flex;
    min-height: 48px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    padding: 9px 10px 8px;
    border: 1px solid #d9e5ef;
    border-radius: 8px;
    background: #f8fbfe;
}

.chatbot-progress-main {
    display: flex;
    max-width: 100%;
    align-items: center;
    gap: 8px;
    color: #365b79;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.5;
}

.chatbot-progress-indicator {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 3px;
}

.chatbot-progress-indicator i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #477ca8;
    animation: chatbotPulse 1.1s infinite ease-in-out;
}

.chatbot-progress-indicator i:nth-child(2) { animation-delay: 0.15s; }
.chatbot-progress-indicator i:nth-child(3) { animation-delay: 0.3s; }

.chatbot-progress-stage {
    min-width: 0;
    overflow-wrap: anywhere;
}

.chatbot-progress-steps {
    display: grid;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 1px;
    list-style: none;
}

.chatbot-progress-step {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 6px;
    color: #8795a4;
    font-size: 12px;
    line-height: 1.45;
}

.chatbot-progress-step:not(:last-child)::after {
    position: absolute;
    z-index: 0;
    top: 15px;
    bottom: -4px;
    left: 10px;
    width: 1px;
    background: #d8e1e9;
    content: "";
}

.chatbot-progress-step-marker {
    position: relative;
    z-index: 1;
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    margin-top: 4px;
    border: 2px solid #c5d0da;
    border-radius: 50%;
    background: #f8fbfe;
}

.chatbot-progress-step.is-complete {
    color: #5f7487;
}

.chatbot-progress-step.is-complete .chatbot-progress-step-marker {
    border-color: #86a9c5;
    background: #86a9c5;
}

.chatbot-progress-step.is-complete:not(:last-child)::after {
    background: #a9c2d6;
}

.chatbot-progress-step.is-current {
    background: #eaf3fb;
    color: #245678;
    font-weight: 750;
}

.chatbot-progress-step.is-current .chatbot-progress-step-marker {
    border-color: #2f709e;
    background: #ffffff;
    box-shadow: inset 0 0 0 2px #eaf3fb, 0 0 0 2px rgb(47 112 158 / 14%);
}

.chatbot-progress-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding-left: 6px;
    color: #75879a;
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    line-height: 1.45;
}

.chatbot-progress-separator {
    color: #a0adba;
}

@keyframes chatbotPulse {
    0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
    35% { opacity: 1; transform: translateY(-2px); }
}

.chatbot-compose-form {
    padding: 10px clamp(22px, 5vw, 72px) 14px;
    border-top: 1px solid #e2e8ef;
    background: #ffffff;
}

.chatbot-attachment-preview {
    display: flex;
    width: min(820px, 100%);
    margin: 0 auto 7px;
    flex-wrap: wrap;
    gap: 7px;
}

.chatbot-attachment-preview[hidden] {
    display: none;
}

.chatbot-pending-attachment {
    display: flex;
    min-width: 0;
    max-width: min(260px, 100%);
    align-items: center;
    gap: 8px;
    padding: 5px 7px;
    border: 1px solid #cfdae5;
    border-radius: 9px;
    background: #f7fafc;
    color: #34516a;
}

.chatbot-pending-attachment img {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 6px;
    object-fit: cover;
    background: #e8eef4;
}

.chatbot-pending-attachment-icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border-radius: 6px;
    background: #e7f0f7;
    color: #326487;
    font-size: 10px;
    font-weight: 800;
}

.chatbot-pending-attachment-copy {
    min-width: 0;
    line-height: 1.25;
}

.chatbot-pending-attachment-copy strong,
.chatbot-pending-attachment-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatbot-pending-attachment-copy strong {
    font-size: 12px;
}

.chatbot-pending-attachment-copy small {
    margin-top: 2px;
    color: #7e8e9d;
    font-size: 10px;
}

.chatbot-pending-attachment button {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #708293;
    cursor: pointer;
}

.chatbot-pending-attachment button:hover {
    background: #e5ebf1;
    color: #9a2d36;
}

.chatbot-compose-box {
    display: flex;
    width: min(820px, 100%);
    margin: 0 auto;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 9px 8px 13px;
    border: 1px solid #b9c9d8;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 7px rgba(33, 62, 89, 0.07);
}

.chatbot-compose-box:focus-within {
    border-color: #4e83ae;
    box-shadow: 0 0 0 2px rgba(64, 127, 177, 0.1);
}

.chatbot-compose-box.is-dragover {
    border-color: #2f709e;
    background: #f3f8fc;
    box-shadow: 0 0 0 3px rgba(47, 112, 158, 0.13);
}

.chatbot-compose-box textarea {
    width: 100%;
    min-height: 31px;
    max-height: 150px;
    padding: 4px 0;
    resize: none;
    overflow-y: auto;
    border: 0;
    outline: 0;
    background: transparent;
    color: #233b50;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.55;
}

.chatbot-compose-box textarea::placeholder {
    color: #91a0ae;
}

.chatbot-compose-box textarea:disabled {
    cursor: not-allowed;
}

.chatbot-compose-box button {
    display: grid;
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: #12558d;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.chatbot-compose-box button:disabled {
    background: #b9c5d0;
    cursor: not-allowed;
}

.chatbot-compose-box .chatbot-attachment-button {
    background: transparent;
    color: #547087;
    font-size: 21px;
    font-weight: 400;
}

.chatbot-compose-box .chatbot-attachment-button:hover:not(:disabled) {
    background: #edf3f8;
    color: #12558d;
}

.chatbot-compose-box .chatbot-attachment-button:disabled {
    background: transparent;
    color: #b9c5d0;
}

.chatbot-message-attachments {
    display: flex;
    margin: 0 0 8px;
    flex-wrap: wrap;
    gap: 7px;
}

.chatbot-message-attachment {
    display: flex;
    max-width: min(320px, 100%);
    align-items: center;
    gap: 8px;
    padding: 6px 9px;
    border: 1px solid #d1dce6;
    border-radius: 9px;
    background: #f8fafc;
    color: #31536d;
    text-decoration: none;
}

.chatbot-message-attachment:hover {
    border-color: #9db5c9;
    background: #f2f7fa;
}

.chatbot-message-attachment img {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 7px;
    object-fit: cover;
    background: #e8eef4;
}

.chatbot-message-attachment-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 7px;
    background: #e7f0f7;
    font-size: 10px;
    font-weight: 800;
}

.chatbot-message-attachment-copy {
    min-width: 0;
}

.chatbot-message-attachment-copy strong,
.chatbot-message-attachment-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatbot-message-attachment-copy strong {
    font-size: 12px;
}

.chatbot-message-attachment-copy small {
    margin-top: 3px;
    color: #7d8c9a;
    font-size: 10px;
}

.chatbot-compose-form > p {
    width: min(820px, 100%);
    margin: 5px auto 0;
    color: #8995a2;
    font-size: 11px;
    text-align: center;
}

@media (min-width: 901px) {
    #tab1.chatbot-active .chatbot-panel.active {
        margin-bottom: 0;
    }
}

@media (max-width: 900px) {
    .chatbot-shell {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .chatbot-history-panel {
        max-height: 230px;
        border-right: 0;
        border-bottom: 1px solid #dce4ed;
    }

    .chatbot-workspace {
        min-height: 650px;
    }

    .chatbot-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .chatbot-messages,
    .chatbot-compose-form {
        padding-inline: 14px;
    }

    .chatbot-suggestion-grid {
        grid-template-columns: 1fr;
    }

    .chatbot-progress-meta {
        column-gap: 10px;
    }

    .chatbot-progress-separator {
        display: none;
    }
}

@media (hover: none) {
    .chatbot-table-copy-button {
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chatbot-progress-indicator i {
        animation: none;
        opacity: 0.7;
    }
}
