/* =========================
   Table Styling
   ========================= */
.spike-chat-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    margin-top: 16px;
    font-size: 12px;
    color: #e5e7eb;
    transition: box-shadow .2s;
}

.spike-chat-table th {
    /* background: linear-gradient(135deg, #334155, #020617); */
    color: #e5e7eb;
    font-weight: 600;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 2;
}

.spike-chat-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: #1e293b;
    transition: background .2s;
}

.spike-chat-table tr:nth-child(even) td {
    background: #0f172a;
}

.spike-chat-table tr:hover td {
    background: #2563eb;
    color: #fff;
}

/* .spike-chat-table th:first-child,
.spike-chat-table td:first-child {
    border-top-left-radius: 12px;
} */

/* .spike-chat-table th:last-child,
.spike-chat-table td:last-child {
    border-top-right-radius: 12px;
} */

.spike-chat-table td {
    word-break: break-word;
}

.spike-chat-table-responsive {
    width: 100%;
    overflow-x: auto;
}

/* =========================
   Chat Window
   ========================= */
.spike-chat-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(20px);
    width: min(800px, 95vw);
    height: min(calc(100vh * 0.7), 640px);
    background: #0f172a;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transition: all .35s ease;
    font-family: system-ui, -apple-system, BlinkMacSystemFont;
    z-index: 1100;
}

.spike-chat-window.visible {
    transform: translate(-50%, -50%) translateY(0);
    opacity: 1;
}

.spike-chat-window.hidden {
    pointer-events: none;
}

/* =========================
   Header
   ========================= */
.spike-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1e293b, #020617);
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.spike-chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spike-chat-avatar {
    font-size: 22px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: .9;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: .9;
    }
}

.spike-chat-title-main {
    font-weight: 600;
    color: #e5e7eb;
}

.spike-chat-title-sub {
    font-size: 12px;
    color: #9ca3af;
}

/* Pill "In ascolto" — visibile in modalità hands-free */
.spike-listening-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    margin-left: 8px;
    white-space: nowrap;
}

.spike-listening-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    animation: spike-listening-pulse 1.2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes spike-listening-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .4;
        transform: scale(0.7);
    }
}

.spike-chat-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.spike-chat-config {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.spike-chat-config:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

.spike-chat-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
}

.spike-chat-close:hover {
    color: #f87171;
}

/* =========================
   Body
   ========================= */
.spike-chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #020617;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE e Edge */
}

.spike-chat-body::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* =========================
   Messages
   ========================= */
.spike-chat-message-wrapper {
    display: flex;
    margin-bottom: 12px;
    animation: fadeInUp .25s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spike-chat-message-wrapper.user {
    justify-content: flex-end;
}

.spike-chat-message-wrapper.bot {
    justify-content: flex-start;
}

.spike-chat-message-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
}

.spike-chat-message-wrapper.user .spike-chat-message-bubble {
    background: #2563eb;
    color: white;
    border-bottom-right-radius: 4px;
}

.spike-chat-message-wrapper.bot .spike-chat-message-bubble {
    background: #1e293b;
    color: #e5e7eb;
    border-bottom-left-radius: 4px;
}

/* =========================
   Markdown Styling
   ========================= */
.spike-chat-message-text strong {
    font-weight: 600;
}

.spike-chat-message-text em {
    font-style: italic;
}

.spike-chat-message-text code {
    background: rgba(255, 255, 255, .08);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
}

/* =========================
   Actions
   ========================= */
.spike-chat-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.spike-chat-action-button {
    background: #020617;
    border: 1px solid #334155;
    color: #e5e7eb;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all .2s ease;
}

.spike-chat-action-button {
    animation: popIn .25s ease;
}

@keyframes popIn {
    from {
        transform: scale(.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}


.spike-chat-action-button:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* =========================
   F9: Feedback 👍👎
   ========================= */
.spike-chat-feedback {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.spike-feedback-btn {
    background: transparent;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 14px;
    cursor: pointer;
    opacity: .5;
    transition: all .2s ease;
    line-height: 1.2;
}

.spike-feedback-btn:hover {
    opacity: 1;
    border-color: #60a5fa;
    background: rgba(96, 165, 250, .1);
}

.spike-feedback-done {
    font-size: 12px;
    color: #9ca3af;
    opacity: .7;
}

/* =========================
   F5: Badge Notifica Reminder
   ========================= */
.spike-button-wrapper {
    position: relative;
    display: inline-block;
}

.spike-button {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #334155;
    background: transparent;
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s ease;
}


.spike-button:hover {
    background: #334155;
    border-color: #60a5fa;
    color: #fff;
}

.spike-button:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.spike-button:active {
    transform: scale(.98);
}

.spike-button-icon {
    font-size: 18px;
    line-height: 1;
}

.spike-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
    pointer-events: none;
    animation: spike-badge-pulse .6s ease-out;
}

@keyframes spike-badge-pulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* =========================
   Typing Indicator
   ========================= */
.spike-chat-typing {
    display: flex;
    gap: 4px;
    margin: 8px 0;
}

.spike-chat-typing span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.spike-chat-typing span:nth-child(2) {
    animation-delay: .2s;
}

.spike-chat-typing span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes typing {
    0% {
        opacity: .3;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: .3;
    }
}

/* Variante con testo di progresso (streaming B) */
.spike-chat-typing.has-step {
    align-items: center;
    gap: 8px;
}

.spike-typing-step {
    font-size: 12px;
    color: #6366f1;
    font-style: italic;
    animation: typing-fade 1.6s infinite ease-in-out;
}

@keyframes typing-fade {
    0% {
        opacity: .5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: .5;
    }
}

/* =========================
   Footer
   ========================= */
.spike-chat-footer {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #020617;
    border-top: 1px solid rgba(255, 255, 255, .05);
}

.spike-chat-input {
    flex: 1;
    background: #020617;
    border: 1px solid #334155;
    color: #e5e7eb;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
}

.spike-chat-input:focus {
    outline: none;
    border-color: #2563eb;
}

.spike-chat-send {
    background: #2563eb;
    border: none;
    color: white;
    padding: 0 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s ease;
}

.spike-chat-send:hover {
    background: #1d4ed8;
}

.spike-chat-send:disabled {
    background: #334155;
    cursor: not-allowed;
}

.spike-chat-avatar {
    font-size: 22px;
}

.spike-chat-window.processing .spike-chat-avatar {
    animation: pulse 1.6s infinite;
}

.spike-chat-window.error .spike-chat-message-bubble {
    border-left: 3px solid #f87171;
}

/* =========================
   Rich value links (email, tel, CF)
   ========================= */
.spike-link {
    color: #60a5fa;
    text-decoration: none;
}

.spike-link:hover {
    text-decoration: underline;
    color: #93c5fd;
}

.spike-cf-hint {
    font-size: 11px;
    color: #9ca3af;
    margin-left: 6px;
}

/* =========================
   SpikeCard — risultato singolo
   ========================= */
.spike-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0;
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    margin-top: 16px;
    font-size: 13px;
    color: #e5e7eb;
}

.spike-card-row {
    display: contents;
}

.spike-card-row:nth-child(even) .spike-card-label,
.spike-card-row:nth-child(even) .spike-card-value {
    background: #0f172a;
}

.spike-card-label {
    padding: 9px 14px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.spike-card-value {
    padding: 9px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    word-break: break-word;
}

.spike-card-row:last-child .spike-card-label,
.spike-card-row:last-child .spike-card-value {
    border-bottom: none;
}

/* =========================
   SpikeChart — SVG Chart
   ========================= */
.spike-chart-wrap {
    margin-top: 10px;
    background: #1e293b;
    border-radius: 12px;
    padding: 12px 10px 8px;
    overflow: hidden;
}

.spike-chart-title {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-align: center;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spike-chart-svg {
    width: 100%;
    height: auto;
    display: block;
}

.spike-chart-label {
    font-size: 10px;
    color: #64748b;
    text-align: center;
    margin-top: 4px;
}

/* =========================
   SpikeVoice — Mic button
   ========================= */
.spike-voice-btn {
    position: relative;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, border-color .2s;
    flex-shrink: 0;
}

.spike-voice-btn:hover:not(:disabled) {
    background: rgba(96, 165, 250, 0.15);
    border-color: #60a5fa;
}

.spike-voice-btn.listening {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.12);
}

.spike-voice-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Animazione pulse quando sta ascoltando */
.spike-voice-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #f87171;
    animation: spike-voice-ring 1.2s ease-out infinite;
    pointer-events: none;
}

@keyframes spike-voice-ring {
    0% {
        transform: scale(1);
        opacity: .8;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 9.3 — Wrapper e testo interim during voice recognition */
.spike-voice-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.spike-voice-interim {
    font-size: 12px;
    color: rgba(148, 163, 184, 0.75);
    /* grigio chiaro provvisorio */
    font-style: italic;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    animation: spike-interim-fade 0.3s ease-in;
}

@keyframes spike-interim-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* VOICE-4: Barra volume in tempo reale ──────────────────────────────── */
.spike-voice-volume-bar {
    display: inline-block;
    width: 40px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.spike-voice-volume-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, #f472b6);
    border-radius: 3px;
    min-width: 4px;
    transition: width 0.08s linear;
}

/* VOICE-4: Toast errore parlante ────────────────────────────────────── */
.spike-voice-toast {
    display: inline-block;
    font-size: 11px;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.30);
    border-radius: 6px;
    padding: 2px 8px;
    white-space: nowrap;
    pointer-events: none;
    animation: spike-toast-in 0.2s ease-out;
}

@keyframes spike-toast-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Export toolbar ──────────────────────────────────────────────────────── */
.spike-export-toolbar {
    display: flex;
    gap: .35rem;
    margin-top: .45rem;
    justify-content: flex-end;
}

.spike-export-btn {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .55rem;
    font-size: .72rem;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: 1px solid #334155;
    border-radius: 5px;
    cursor: pointer;
    line-height: 1.4;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
}

.spike-export-btn:hover {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #6366f1;
}

/* ── F4: Typeahead auto-suggestions ──────────────────────────────────── */

.spike-chat-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
}

.spike-chat-input-wrap .spike-chat-input {
    width: 100%;
}

.spike-typeahead-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    margin-bottom: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, .4);
}

.spike-typeahead-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background .15s;
}

.spike-typeahead-item:hover,
.spike-typeahead-item:focus {
    background: #1e293b;
    outline: none;
}

/* ── Cronologia conversazioni ──────────────────────────────────── */

.spike-history-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background: #0f172a;
}

.spike-history-header {
    padding: 14px 16px;
    font-weight: 600;
    color: #e2e8f0;
    border-bottom: 1px solid #1e293b;
    font-size: .95rem;
}

.spike-history-empty {
    padding: 32px 16px;
    text-align: center;
    color: #64748b;
    font-size: .9rem;
}

.spike-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.spike-history-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    border-bottom: 1px solid #1e293b;
}

.spike-history-item-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 8px;
    text-align: left;
    cursor: pointer;
    color: #e2e8f0;
    transition: background .15s;
    border-radius: 6px;
}

.spike-history-item-btn:hover {
    background: #1e293b;
}

.spike-history-item-title {
    font-size: .9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.spike-history-item-meta {
    font-size: .75rem;
    color: #64748b;
    margin-top: 2px;
}

.spike-history-delete-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    font-size: .85rem;
    opacity: .5;
    transition: opacity .15s;
    border-radius: 4px;
}

.spike-history-delete-btn:hover {
    opacity: 1;
    background: #7f1d1d33;
}

.spike-history-footer {
    padding: 10px 16px;
    border-top: 1px solid #1e293b;
    display: flex;
    justify-content: center;
}

/* ── NLU Correction Form ──────────────────────────────────────── */

.spike-chat-feedback:has(.spike-nlu-correction-form) {
    display: block;
    width: 100%;
}

.spike-nlu-correction-form {
    width: 100%;
    margin-top: 8px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px;
    font-size: 13px;
    color: #e2e8f0;
    box-sizing: border-box;
}

.spike-correction-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1e293b;
}

.spike-correction-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

.spike-correction-header strong {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
}

.spike-correction-subtitle {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
}

/* ── Row: domain + intent ── */
.spike-correction-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.spike-correction-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 120px;
}

.spike-correction-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.spike-correction-select {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 12.5px;
    padding: 5px 8px;
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}

.spike-correction-select:focus {
    border-color: #3b82f6;
}

.spike-correction-select option {
    background: #1e293b;
    color: #e2e8f0;
}

/* ── Sections (JOIN, attrs, entities) ── */
.spike-correction-section {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 8px;
}

.spike-correction-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.spike-correction-hint {
    font-size: 10.5px;
    font-weight: 400;
    color: #475569;
    text-transform: none;
    letter-spacing: 0;
}

/* ── Checkboxes ── */
.spike-correction-attrs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.spike-correction-checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: #cbd5e1;
    cursor: pointer;
    user-select: none;
    padding: 3px 0;
}

.spike-correction-checkbox-label input[type="checkbox"] {
    width: 13px;
    height: 13px;
    accent-color: #3b82f6;
    cursor: pointer;
    flex-shrink: 0;
}

.spike-correction-checkbox-label:hover {
    color: #e2e8f0;
}

/* ── Entities (campo = valore) ── */
.spike-correction-empty-hint {
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
    padding: 4px 0;
}

.spike-correction-entity-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.spike-correction-entity-col,
.spike-correction-entity-val {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 12.5px;
    padding: 4px 8px;
    outline: none;
    transition: border-color .15s;
    min-width: 0;
}

.spike-correction-entity-col {
    flex: 1;
}

.spike-correction-entity-val {
    flex: 2;
}

.spike-correction-entity-col::placeholder,
.spike-correction-entity-val::placeholder {
    color: #475569;
}

.spike-correction-entity-col:focus,
.spike-correction-entity-val:focus {
    border-color: #3b82f6;
}

.spike-correction-entity-eq {
    color: #64748b;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.spike-correction-entity-del {
    background: transparent;
    border: 1px solid #334155;
    border-radius: 5px;
    color: #64748b;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 6px;
    line-height: 1;
    transition: all .15s;
    flex-shrink: 0;
}

.spike-correction-entity-del:hover {
    color: #f87171;
    border-color: #f87171;
    background: rgba(248, 113, 113, .08);
}

.spike-correction-add-btn {
    background: transparent;
    border: 1px solid #334155;
    border-radius: 5px;
    color: #94a3b8;
    font-size: 11.5px;
    cursor: pointer;
    padding: 2px 8px;
    line-height: 1.5;
    transition: all .15s;
    margin-left: auto;
}

.spike-correction-add-btn:hover {
    color: #60a5fa;
    border-color: #3b82f6;
    background: rgba(59, 130, 246, .08);
}

/* ── Actions bar ── */
.spike-correction-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #1e293b;
}

.spike-correction-confirm {
    background: #2563eb;
    border: none;
    border-radius: 7px;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 16px;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    line-height: 1.4;
}

.spike-correction-confirm:hover:not(:disabled) {
    background: #1d4ed8;
}

.spike-correction-confirm:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.spike-correction-skip {
    background: transparent;
    border: 1px solid #334155;
    border-radius: 7px;
    color: #9ca3af;
    font-size: 12.5px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all .15s;
    line-height: 1.4;
}

.spike-correction-skip:hover {
    color: #e2e8f0;
    border-color: #475569;
    background: rgba(255, 255, 255, .04);
}