.queryAI-root {
    padding: 16px;
    background: #f7f8fb;
    color: #1f2937;
    font-family: Arial, sans-serif;
}

.queryAI-header h1 {
    margin: 0 0 6px;
    font-size: 22px;
}

.queryAI-header p {
    margin: 0 0 16px;
    color: #4b5563;
}

.queryAI-controls {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
}

.queryAI-question {
    width: 100%;
    min-height: 90px;
    resize: vertical;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    box-sizing: border-box;
}

.queryAI-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.queryAI-btn {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #1f2937;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.queryAI-btn.primary {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #fff;
}

.queryAI-statusRow {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.queryAI-status {
    background: #e5e7eb;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
}

.queryAI-status[data-kind="success"] { background: #dcfce7; color: #166534; }
.queryAI-status[data-kind="error"] { background: #fee2e2; color: #991b1b; }
.queryAI-status[data-kind="loading"] { background: #dbeafe; color: #1e40af; }

.queryAI-metrics {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.queryAI-metrics span {
    font-size: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 5px 8px;
}

.queryAI-panels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.queryAI-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
}

.queryAI-panel h3 {
    margin-top: 0;
}

.queryAI-sql {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    overflow-x: auto;
    min-height: 52px;
}

.queryAI-output {
    min-height: 120px;
}

.queryAI-empty,
.queryAI-error,
.queryAI-text,
.queryAI-webreport {
    padding: 10px;
    border-radius: 8px;
    background: #f3f4f6;
}

.queryAI-error {
    background: #fef2f2;
    color: #991b1b;
}

.queryAI-tableWrap {
    overflow: auto;
    max-height: 420px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.queryAI-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.queryAI-table th,
.queryAI-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 7px 8px;
    text-align: left;
    white-space: nowrap;
}

.queryAI-table thead th {
    background: #f8fafc;
    position: sticky;
    top: 0;
}

.queryAI-widget {
    display: inline-block;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    border-radius: 10px;
    padding: 12px;
    min-width: 160px;
}

.queryAI-widgetTitle {
    font-size: 12px;
    color: #1e3a8a;
}

.queryAI-widgetValue {
    font-size: 28px;
    font-weight: 700;
    color: #1d4ed8;
}

.queryAI-subtle {
    font-size: 12px;
    color: #6b7280;
}

.queryAI-testsSummary {
    margin-bottom: 8px;
    font-weight: 700;
}

.queryAI-tests ul {
    margin: 0;
    padding-left: 18px;
}

.queryAI-tests li.passed { color: #166534; }
.queryAI-tests li.failed { color: #991b1b; }
