.gf-butler-chat-container {
    position: relative;
    height: 100%;
    background: var(--gf-color-surface, #ffffff);
    color: var(--gf-color-text, #1d2327);
}

.gf-butler-header,
.gf-butler-suggestions,
.gf-butler-input-area {
    background: var(--gf-color-surface, #ffffff);
    border-color: var(--gf-color-border-subtle, #dcdcde) !important;
}

.gf-butler-header {
    gap: 0.5rem;
}

.gf-butler-status-row {
    margin-top: 0.2rem;
}

.gf-butler-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gf-color-text, #1d2327);
}

.gf-butler-status,
.gf-butler-msg-system .gf-butler-msg-bubble {
    font-size: 0.75rem !important;
}

.gf-butler-disclosure {
    font-size: 0.72rem;
    line-height: 1.4;
}

.gf-butler-disclosure a {
    color: var(--gf-color-accent, var(--gf-color-primary, #2271b1));
    text-decoration-color: color-mix(in srgb, var(--gf-color-accent, var(--gf-color-primary, #2271b1)) 45%, transparent);
}

.gf-butler-disclosure a:hover,
.gf-butler-disclosure a:focus {
    color: var(--gf-color-accent-strong, var(--gf-color-primary-dark, #135e96));
    text-decoration-color: currentColor;
}

.gf-butler-setup-state__link {
    color: var(--gf-color-accent, var(--gf-color-primary, #2271b1));
}

.gf-butler-setup-state__link:hover,
.gf-butler-setup-state__link:focus {
    color: var(--gf-color-accent-strong, var(--gf-color-primary-dark, #135e96));
}

.gf-butler-provider-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.16rem 0.45rem;
    border: 1px solid var(--gf-color-border-subtle, #dcdcde);
    border-radius: 999px;
    font-size: 0.68rem;
    line-height: 1;
    color: var(--gf-color-text-muted, #646970);
    background: var(--gf-color-surface, #ffffff);
}

.gf-butler-provider-chip img {
    display: block;
    border-radius: 50%;
}

.gf-butler-chatmode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--gf-color-border-subtle, #dcdcde);
    background: var(--gf-color-surface, #ffffff);
    color: var(--gf-color-text-muted, #646970);
    box-shadow: none;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.gf-butler-chatmode-toggle__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gf-color-border, #bfc3c8);
    flex-shrink: 0;
    transition: background-color 0.14s ease;
}

.gf-butler-chatmode-toggle__label {
    font-weight: 600;
}

.gf-butler-chatmode-toggle.is-active {
    border-color: color-mix(in srgb, var(--gf-color-accent, var(--gf-color-primary, #2271b1)) 35%, #dcdcde);
    background: color-mix(in srgb, var(--gf-color-accent, var(--gf-color-primary, #2271b1)) 8%, #ffffff);
    color: var(--gf-color-accent-strong, var(--gf-color-primary-dark, #135e96));
}

.gf-butler-chatmode-toggle.is-active .gf-butler-chatmode-toggle__dot {
    background: var(--gf-color-accent, var(--gf-color-primary, #2271b1));
}

.gf-butler-surface-unavailable {
    background: var(--gf-color-surface, #ffffff);
    border: 1px solid var(--gf-color-border-subtle, #dcdcde);
    border-radius: 12px;
    margin: 0.75rem;
}

.gf-butler-mark {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gf-color-border, #bfc3c8);
    border-radius: 999px;
    background: var(--gf-color-surface-alt, #f6f7f7);
    color: var(--gf-color-text, #1d2327);
    font-weight: 700;
    letter-spacing: 0.01em;
    flex: 0 0 auto;
}

.gf-butler-mark--sm {
    width: 28px;
    height: 28px;
    font-size: 0.62rem;
}

.gf-butler-mark--xs {
    width: 24px;
    height: 24px;
    font-size: 0.56rem;
}

.gf-butler-mark__icon {
    width: 16px;
    height: 16px;
    display: block;
    opacity: 0.92;
}

.gf-butler-mark--xs .gf-butler-mark__icon {
    width: 14px;
    height: 14px;
}

.gf-butler-mark__provider-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 12px;
    height: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--gf-color-surface, #ffffff);
    border: 1px solid var(--gf-color-border-subtle, #dcdcde);
    overflow: hidden;
}

.gf-butler-mark__provider-badge img {
    width: 9px;
    height: 9px;
    display: block;
}

.gf-butler-chat-log {
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--gf-color-border-subtle, #dcdcde) var(--gf-color-surface-alt, #f6f7f7);
    background: var(--gf-color-surface-alt, #f6f7f7);
}

.gf-butler-chat-log::-webkit-scrollbar {
    width: 6px;
}

.gf-butler-chat-log::-webkit-scrollbar-track {
    background: var(--gf-color-surface-alt, #f6f7f7);
}

.gf-butler-chat-log::-webkit-scrollbar-thumb {
    background-color: var(--gf-color-border-subtle, #dcdcde);
    border-radius: 999px;
}

.gf-butler-msg {
    animation: butlerBubbleFadeIn 0.18s ease-out forwards;
}

.gf-butler-msg-user {
    justify-content: flex-start;
    align-self: auto !important;
}

.gf-butler-msg-bubble {
    max-width: 92%;
    font-size: 0.8rem;
    line-height: 1.45;
    border: 0;
    box-shadow: none !important;
}

.gf-butler-msg-advisory {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.65rem;
}

.gf-butler-advisory-group {
    display: grid;
    gap: 0.35rem;
}

.gf-butler-advisory-group--resolved {
    opacity: 0.74;
}

.gf-butler-advisory-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--gf-color-text-muted, #646970);
}

.gf-butler-advisory-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.gf-butler-advisory-action,
.gf-butler-advisory-choice,
.gf-butler-advisory-prompt {
    font-size: 0.72rem;
    line-height: 1.2;
    padding: 0.4rem 0.62rem;
    border-radius: 10px;
    border: 1px solid var(--gf-color-border-subtle, #dcdcde);
    background: var(--gf-color-surface-alt, #f6f7f7);
    color: var(--gf-color-text, #1d2327);
    box-shadow: none !important;
    text-align: left;
}

.gf-butler-advisory-choice {
    background: color-mix(in srgb, var(--gf-color-accent, var(--gf-color-primary, #2271b1)) 10%, #ffffff);
    border: 0;
    color: var(--gf-color-accent, var(--gf-color-primary, #2271b1));
}

.gf-butler-advisory-action:hover,
.gf-butler-advisory-action:focus,
.gf-butler-advisory-prompt:hover,
.gf-butler-advisory-prompt:focus {
    background: var(--gf-color-surface, #ffffff);
    border-color: var(--gf-color-border, #bfc3c8);
    color: var(--gf-color-text, #1d2327);
}

.gf-butler-advisory-choice:hover,
.gf-butler-advisory-choice:focus {
    background: color-mix(in srgb, var(--gf-color-accent, var(--gf-color-primary, #2271b1)) 18%, #ffffff);
    color: var(--gf-color-accent-strong, var(--gf-color-primary-dark, #135e96));
}

.gf-butler-advisory-choice:active {
    background: color-mix(in srgb, var(--gf-color-accent, var(--gf-color-primary, #2271b1)) 26%, #ffffff);
    color: var(--gf-color-accent-strong, var(--gf-color-primary-dark, #135e96));
}

.gf-butler-advisory-action[disabled],
.gf-butler-advisory-choice[disabled],
.gf-butler-advisory-prompt[disabled] {
    cursor: default;
    pointer-events: none;
    opacity: 0.68;
    background: var(--gf-color-surface-alt, #f6f7f7);
    border-color: var(--gf-color-border-subtle, #dcdcde);
    color: var(--gf-color-text-muted, #646970);
}

.gf-butler-msg-user .gf-butler-msg-bubble {
    background: color-mix(in srgb, var(--gf-color-surface-alt, #f6f7f7) 82%, var(--gf-color-accent, var(--gf-color-primary, #2271b1)) 18%);
    color: var(--gf-color-accent-strong, var(--gf-color-primary-dark, #0f4a78));
    border-bottom-right-radius: 6px !important;
}

.gf-butler-msg-assistant .gf-butler-msg-bubble {
    background: var(--gf-color-surface, #ffffff);
    color: var(--gf-color-text, #1d2327);
    border-bottom-left-radius: 6px !important;
}

.gf-butler-msg-system .gf-butler-msg-bubble {
    background: var(--gf-color-surface, #ffffff);
    color: var(--gf-color-text-muted, #646970);
    align-items: flex-start;
}

.gf-butler-loader {
    width: 12px;
    height: 12px;
    margin-top: 0.2rem;
    flex: 0 0 12px;
    border-radius: 999px;
    border: 2px solid var(--gf-color-border-subtle, #dcdcde);
    border-top-color: var(--gf-color-primary, #2271b1);
    animation: gf-butler-spin 0.7s linear infinite;
}

.gf-butler-msg-avatar {
    margin-top: 0.1rem;
    flex: 0 0 auto;
}

.gf-butler-msg-user .gf-butler-msg-avatar {
    margin-right: 0.5rem;
    margin-left: 0;
}

.gf-butler-msg-assistant .gf-butler-msg-avatar,
.gf-butler-msg-system .gf-butler-msg-avatar {
    margin-right: 0.5rem;
}

.gf-butler-user-avatar {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--gf-color-border-subtle, #dcdcde);
    background: var(--gf-color-surface, #ffffff);
    color: var(--gf-color-text-muted, #646970);
    font-size: 0.7rem;
    font-weight: 600;
}

.gf-butler-user-avatar--fallback {
    background: var(--gf-color-surface-alt, #f6f7f7);
}

.gf-butler-prompt-chip {
    font-size: 0.72rem;
    line-height: 1.2;
    padding: 0.36rem 0.65rem;
    border-radius: 999px;
    border: 0;
    color: var(--gf-color-text, #1d2327);
    background: var(--gf-color-surface-alt, #f6f7f7);
    transition: background-color 0.14s ease, color 0.14s ease;
}

.gf-butler-prompt-chip:hover {
    background: color-mix(in srgb, var(--gf-color-surface-alt, #f6f7f7) 72%, #ffffff);
    color: var(--gf-color-text, #1d2327);
}

.gf-butler-prompt-chip:disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: default;
}


.gf-butler-action-btn {
    width: auto;
    height: 22px;
    min-width: 52px;
    padding: 0 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px !important;
    border: 0 !important;
    background: color-mix(in srgb, var(--gf-color-accent, var(--gf-color-primary, #2271b1)) 12%, #ffffff) !important;
    color: var(--gf-color-accent, var(--gf-color-primary, #2271b1)) !important;
    box-shadow: none !important;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
}

.gf-butler-action-btn:hover,
.gf-butler-action-btn:focus {
    background: color-mix(in srgb, var(--gf-color-accent-strong, var(--gf-color-primary-dark, #135e96)) 16%, #ffffff) !important;
    color: var(--gf-color-accent-strong, var(--gf-color-primary-dark, #135e96)) !important;
}

.gf-butler-action-btn:disabled {
    opacity: 0.38;
    pointer-events: none;
    cursor: default;
}

.gf-butler-composer {
    border: 1px solid var(--gf-color-border-subtle, #dcdcde);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.gf-butler-composer:focus-within {
    border-color: var(--gf-color-primary, #2271b1);
    box-shadow: 0 0 0 1px var(--gf-color-primary, #2271b1);
}

.gf-butler-composer__textarea {
    display: block;
    width: 100%;
    resize: none;
    min-height: calc(1.45em * 2 + 1.1rem);
    max-height: calc(1.45em * 2 + 1.1rem);
    overflow-y: auto;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0.55rem 0.8rem !important;
    font-size: 0.82rem !important;
    line-height: 1.45 !important;
    box-shadow: none !important;
    background: transparent !important;
    outline: none !important;
}

.gf-butler-composer__divider {
    height: 1px;
    background: var(--gf-color-border-subtle, #dcdcde);
    margin: 0;
}

.gf-butler-composer__toolbar {
    padding: 0.35rem 0.5rem 0.35rem 0.5rem;
}

#griffinforms-app-rightsidebar .gf-butler-input-area textarea#gf-butler-chat-input {
    border: 0 !important;
    border-radius: 0 !important;
}

.gf-butler-send-btn {
    border-radius: 10px !important;
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    margin-left: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    border-color: var(--gf-color-accent, var(--gf-color-primary, #2271b1)) !important;
    background: var(--gf-color-accent, var(--gf-color-primary, #2271b1)) !important;
    color: #fff !important;
}

.gf-butler-send-btn__icon {
    display: block;
    width: 20px;
    height: 20px;
    margin: 0;
    flex: 0 0 20px;
    transform: translateX(1px);
    filter: brightness(0) invert(1);
}

.gf-butler-send-btn:hover,
.gf-butler-send-btn:focus {
    border-color: var(--gf-color-accent-strong, var(--gf-color-primary-dark, #135e96)) !important;
    background: var(--gf-color-accent-strong, var(--gf-color-primary-dark, #135e96)) !important;
    color: #fff !important;
}

.gf-butler-new-message-pill {
    position: absolute;
    left: 50%;
    bottom: 94px;
    transform: translateX(-50%);
    z-index: 12;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.32rem 0.72rem;
    border: 1px solid var(--gf-color-border-subtle, #dcdcde) !important;
    border-radius: 999px !important;
    background: var(--gf-color-surface, #ffffff) !important;
    color: var(--gf-color-text, #1d2327) !important;
    box-shadow: none !important;
    width: auto;
    max-width: calc(100% - 24px);
}

.gf-butler-typed-cursor {
    display: inline-block;
    width: 0.45ch;
    animation: gf-butler-caret 0.9s steps(1) infinite;
}

@keyframes butlerBubbleFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes gf-butler-spin {
    to { transform: rotate(360deg); }
}

@keyframes gf-butler-caret {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}
