.isa-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    display: none;
    background: rgba(15, 23, 42, 0.28);
}

.isa-drawer-backdrop.is-open {
    display: block;
}

.isa-global-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    width: min(460px, 100vw);
    height: 100vh;
    background: #ffffff;
    border-left: 1px solid #dbe3ef;
    box-shadow: -12px 0 30px rgba(15, 23, 42, 0.18);
    transform: translateX(100%);
    transition: transform 0.22s ease-in-out;
}

.isa-global-drawer.is-open {
    transform: translateX(0);
}

.isa-drawer-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 14px;
    color: #ffffff;
    background: linear-gradient(135deg, #0f766e, #0ea5e9);
}

.isa-drawer-eyebrow {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.92;
}

.isa-drawer-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.isa-drawer-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.35;
    opacity: 0.92;
}

.isa-drawer-close {
    width: 34px;
    height: 34px;
    padding: 0;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border: 0;
    border-radius: 999px;
    font-size: 28px;
    line-height: 30px;
    cursor: pointer;
}

.isa-drawer-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.isa-drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
}

.isa-drawer-intro,
.isa-drawer-context-box,
.isa-drawer-message {
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #ffffff;
}

.isa-drawer-intro,
.isa-drawer-context-box {
    padding: 12px;
    color: #334155;
    font-size: 13px;
    line-height: 1.45;
}

.isa-drawer-context-box {
    margin-top: 12px;
    background: #ecfeff;
    border-color: #bae6fd;
}

.isa-drawer-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.isa-drawer-message {
    padding: 10px 12px;
    color: #111827;
    font-size: 14px;
    line-height: 1.45;
}

.isa-drawer-message-user {
    align-self: flex-end;
    max-width: 88%;
    background: #eef4ff;
    border-color: #c9dcff;
}

.isa-drawer-message-assistant,
.isa-drawer-message-system {
    align-self: flex-start;
    max-width: 94%;
}

.isa-drawer-message-system {
    color: #475569;
    background: #f1f5f9;
}

.isa-drawer-message-meta {
    margin-top: 6px;
    color: #64748b;
    font-size: 11px;
}

.isa-action-card {
    align-self: flex-start;
    width: 100%;
    padding: 12px;
    border: 1px solid #bae6fd;
    border-radius: 14px;
    background: linear-gradient(180deg, #f0fdfa, #f8fafc);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.isa-action-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
}

.isa-action-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    color: #075985;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    font-size: 11px;
    font-weight: 700;
}

.isa-action-card-summary {
    margin-bottom: 10px;
    color: #334155;
    font-size: 13px;
    line-height: 1.45;
}

.isa-action-card-fields {
    display: grid;
    gap: 6px;
    margin: 0 0 12px;
}

.isa-action-card-field {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid #e2e8f0;
    font-size: 12px;
}

.isa-action-card-field-label {
    color: #64748b;
    font-weight: 700;
}

.isa-action-card-field-value {
    color: #0f172a;
    word-break: break-word;
}

.isa-action-card-representation {
    margin: 10px 0 12px;
    padding: 10px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
}

.isa-action-card-representation-title {
    margin-bottom: 8px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
}

.isa-action-card-option {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 7px 0;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
}

.isa-action-card-option:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.isa-action-card-option input {
    margin-top: 3px;
}

.isa-action-card-option-label {
    display: block;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
}

.isa-action-card-option-help {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
}

.isa-action-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.isa-action-card-actions .btn {
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
}

.isa-action-card-confirm {
    color: #ffffff;
    border-color: #0f766e;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.isa-action-card-confirm:hover {
    color: #ffffff;
    border-color: #0f766e;
    background: linear-gradient(135deg, #0d6b62, #0ea5a3);
}

.isa-action-card-confirm:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

.isa-action-card-edit {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #ffffff;
}

.isa-action-card-cancel {
    color: #475569;
    border-color: #cbd5e1;
    background: #ffffff;
}

.isa-board-attention-list {
    display: grid;
    gap: 10px;
}

.isa-board-attention-item {
    padding: 10px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
}

.isa-board-attention-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.35;
}

.isa-board-attention-score {
    flex: 0 0 auto;
    padding: 2px 7px;
    color: #7c2d12;
    background: #ffedd5;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.isa-board-attention-meta {
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
}

.isa-board-attention-signals {
    margin: 8px 0;
    padding-left: 18px;
    color: #334155;
    font-size: 12px;
}

.isa-board-attention-action {
    color: #0f172a;
    font-size: 12px;
    line-height: 1.4;
}

.isa-drawer-footer {
    flex: 0 0 auto;
    padding: 14px;
    background: #ffffff;
    border-top: 1px solid #dbe3ef;
}

.isa-drawer-field-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff, #eef7ff);
}

.isa-drawer-field-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.isa-drawer-field-actions .btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.12);
}

.isa-drawer-field-actions .btn:disabled {
    cursor: not-allowed;
    opacity: 0.52;
    box-shadow: none;
}

#isa-drawer-send-context {
    color: #075985;
    border-color: #bae6fd;
    background: #ffffff;
}

#isa-drawer-send-context:hover:not(:disabled) {
    color: #075985;
    border-color: #7dd3fc;
    background: #e0f2fe;
}

#isa-drawer-replace-field {
    color: #ffffff;
    border-color: #0f766e;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
}

#isa-drawer-replace-field:hover:not(:disabled) {
    color: #ffffff;
    border-color: #0f766e;
    background: linear-gradient(135deg, #0d6b62, #0ea5a3);
}

#isa-drawer-append-field {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #ffffff;
}

#isa-drawer-append-field:hover:not(:disabled) {
    color: #1e40af;
    border-color: #93c5fd;
    background: #eff6ff;
}

.isa-drawer-input,
.isa-drawer-footer textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 72px;
    max-height: 160px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #0f172a;
    background: #ffffff;
}

.isa-drawer-input:focus,
.isa-drawer-footer textarea:focus {
    outline: 0;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

.isa-drawer-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.isa-drawer-mode-hint {
    flex: 1 1 100%;
    min-width: 0;
    color: #475569;
    font-size: 13px;
}

.isa-drawer-audio-status {
    flex: 1 1 auto;
    min-width: 120px;
}

.isa-navbar-trigger {
    font-size: 18px;
    line-height: 1;
}

body.isa-drawer-open {
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .isa-global-drawer {
        width: 100vw;
        border-left: 0;
    }

    .isa-drawer-header {
        padding-top: calc(16px + env(safe-area-inset-top));
    }

    .isa-drawer-footer {
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }

    .isa-drawer-field-actions {
        gap: 6px;
        padding: 8px;
    }

    .isa-drawer-field-actions .btn,
    .isa-action-card-actions .btn {
        flex: 1 1 100%;
        white-space: normal;
    }

    .isa-action-card-field {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .isa-board-attention-item-head {
        flex-direction: column;
    }
}
