/* Real-Time Error Checker - Mobile-first */

:root {
    --rec-accent: #2563eb;
    --rec-accent-hover: #1d4ed8;
    --rec-border: #e5e7eb;
    --rec-bg: #f8fafc;
    --rec-surface: #ffffff;
    --rec-text: #0f172a;
    --rec-muted: #64748b;
    --rec-critical: #dc2626;
    --rec-high: #ea580c;
    --rec-medium: #ca8a04;
    --rec-low: #059669;
    --rec-radius: 16px;
    --rec-radius-sm: 12px;
    --rec-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --rec-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Tool UI */
.rec-app {
    background: transparent;
}

.rec-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 2rem;
}

.rec-col {
    min-width: 0;
}

.rec-card {
    background: var(--rec-surface);
    border: 1px solid var(--rec-border);
    border-radius: var(--rec-radius);
    box-shadow: var(--rec-shadow-md);
    overflow: hidden;
}

.rec-card + .rec-card {
    margin-top: 16px;
}

.rec-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.rec-card__head--tight {
    padding: 14px;
}

.rec-headline {
    min-width: 0;
}

.rec-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--rec-text);
    line-height: 1.2;
}

.rec-subtitle {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--rec-muted);
    line-height: 1.35;
}

.rec-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.rec-pill {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #f1f5f9;
    color: var(--rec-text);
}

.rec-pill--idle {
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.22);
    background: rgba(37, 99, 235, 0.08);
}

.rec-pill--live {
    color: #047857;
    border-color: rgba(5, 150, 105, 0.22);
    background: rgba(5, 150, 105, 0.08);
}

.rec-pill--stopped {
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.22);
    background: rgba(220, 38, 38, 0.08);
}

.rec-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.25);
    box-shadow: 0 0 0 0 rgba(15, 23, 42, 0.0);
}

.rec-pulse.is-live {
    background: var(--rec-low);
    animation: recPulse 1.2s ease-in-out infinite;
}

@keyframes recPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.35);
    }
    100% {
        box-shadow: 0 0 0 12px rgba(5, 150, 105, 0.0);
    }
}

.rec-form {
    padding: 14px;
}

.rec-field + .rec-field {
    margin-top: 12px;
}

.rec-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--rec-text);
    margin-bottom: 6px;
}

.rec-help {
    margin-top: 6px;
    font-size: 12px;
    color: var(--rec-muted);
    line-height: 1.35;
}

.rec-input,
.rec-select,
.rec-textarea {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--rec-border);
    color: var(--rec-text);
    border-radius: var(--rec-radius-sm);
    padding: 10px 12px;
    outline: none;
}

.rec-input::placeholder {
    color: rgba(100, 116, 139, 0.85);
}

.rec-input:focus,
.rec-select:focus,
.rec-textarea:focus {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.rec-input--search {
    padding-left: 12px;
}

.rec-textarea {
    resize: vertical;
    min-height: 220px;
    font-size: 12px;
    line-height: 1.5;
}

.rec-card--snippet .rec-row--actions {
    grid-template-columns: 1fr 1fr;
}

.rec-card--snippet .rec-textarea {
    min-height: 280px;
}

.rec-range {
    width: 100%;
}

.rec-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
}

.rec-row--actions {
    grid-template-columns: 1fr 1fr 1fr;
}

.rec-inline {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
}

.rec-suffix {
    font-size: 12px;
    color: var(--rec-muted);
}

.rec-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rec-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    color: var(--rec-text);
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}

.rec-chip input {
    accent-color: #60a5fa;
}

.rec-btn {
    height: 40px;
    border-radius: var(--rec-radius-sm);
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    color: var(--rec-text);
    font-weight: 700;
    font-size: 13px;
    transition: transform 0.08s ease, background 0.2s ease, border-color 0.2s ease;
}

.rec-btn:hover {
    border-color: rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.05);
}

.rec-btn:active {
    transform: translateY(1px);
}

.rec-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.rec-btn--primary {
    background: rgba(37, 99, 235, 0.10);
    border-color: rgba(37, 99, 235, 0.30);
}

.rec-btn--primary:hover {
    background: rgba(37, 99, 235, 0.14);
    border-color: rgba(37, 99, 235, 0.40);
}

.rec-btn--danger {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.28);
}

.rec-btn--danger:hover {
    background: rgba(220, 38, 38, 0.10);
    border-color: rgba(220, 38, 38, 0.36);
}

.rec-toolbar {
    padding: 12px 14px 0;
}

.rec-toolbar__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.rec-toolbar__row--filters {
    grid-template-columns: 1fr 1fr;
    margin-top: 12px;
}

.rec-field--mini .rec-label {
    margin-bottom: 6px;
    font-size: 11.5px;
}

.rec-feedwrap {
    padding: 14px;
    min-height: 360px;
}

.rec-feed {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.rec-item {
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(248, 250, 252, 0.8);
    border-radius: var(--rec-radius-sm);
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.rec-item:hover {
    border-color: rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.04);
}

.rec-item.is-active {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.rec-item__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.rec-badges {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rec-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: #ffffff;
    color: var(--rec-text);
}

.rec-badge--critical {
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.25);
    background: rgba(220, 38, 38, 0.06);
}

.rec-badge--high {
    color: #c2410c;
    border-color: rgba(234, 88, 12, 0.25);
    background: rgba(234, 88, 12, 0.06);
}

.rec-badge--medium {
    color: #a16207;
    border-color: rgba(202, 138, 4, 0.25);
    background: rgba(202, 138, 4, 0.06);
}

.rec-badge--low {
    color: #047857;
    border-color: rgba(5, 150, 105, 0.25);
    background: rgba(5, 150, 105, 0.06);
}

.rec-item__time {
    font-size: 12px;
    color: var(--rec-muted);
    white-space: nowrap;
}

.rec-item__msg {
    margin-top: 10px;
    font-size: 13px;
    color: var(--rec-text);
    line-height: 1.4;
    word-break: break-word;
}

.rec-item__meta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--rec-muted);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.rec-empty {
    border: 1px dashed rgba(15, 23, 42, 0.18);
    background: rgba(248, 250, 252, 0.9);
    border-radius: var(--rec-radius);
    padding: 18px;
    text-align: center;
}

.rec-empty__title {
    font-weight: 800;
    color: var(--rec-text);
    font-size: 14px;
}

.rec-empty__text {
    margin-top: 6px;
    color: var(--rec-muted);
    font-size: 12.5px;
}

.rec-live {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.rec-live__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.25);
}

.rec-live__dot.is-live {
    background: var(--rec-low);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.10);
}

.rec-live__text {
    font-size: 12px;
    color: var(--rec-muted);
    font-weight: 700;
}

.rec-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px;
}

.rec-metric {
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(248, 250, 252, 0.9);
    border-radius: var(--rec-radius-sm);
    padding: 12px;
}

.rec-metric__label {
    font-size: 11.5px;
    color: var(--rec-muted);
    font-weight: 800;
}

.rec-metric__value {
    margin-top: 8px;
    font-size: 20px;
    font-weight: 900;
    color: var(--rec-text);
    letter-spacing: -0.02em;
}

.rec-metric__value--critical {
    color: #b91c1c;
}

.rec-card--details summary {
    list-style: none;
}

.rec-card--details summary::-webkit-details-marker {
    display: none;
}

.rec-details__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    cursor: pointer;
    color: var(--rec-text);
    font-weight: 800;
}

.rec-details__hint {
    color: var(--rec-muted);
    font-weight: 700;
    font-size: 12px;
}

.rec-details {
    padding: 14px;
}

.rec-details__title {
    font-size: 14px;
    font-weight: 900;
    color: var(--rec-text);
}

.rec-details__meta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--rec-muted);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.rec-details__message {
    margin-top: 10px;
    font-size: 13px;
    color: var(--rec-text);
    line-height: 1.5;
    word-break: break-word;
}

.rec-details__block {
    margin-top: 14px;
}

.rec-details__label {
    font-size: 12px;
    font-weight: 900;
    color: var(--rec-text);
    margin-bottom: 8px;
}

.rec-pre {
    border-radius: var(--rec-radius-sm);
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(248, 250, 252, 0.9);
    color: rgba(15, 23, 42, 0.92);
    padding: 12px;
    margin: 0;
    overflow: auto;
    font-size: 12px;
    line-height: 1.45;
}

.rec-toast {
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--rec-muted);
    min-height: 18px;
}

.rec-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (min-width: 992px) {
    .rec-layout {
        grid-template-columns: 380px 1fr 360px;
        align-items: start;
    }

    .rec-card + .rec-card {
        margin-top: 16px;
    }

    .rec-card--snippet .rec-textarea {
        min-height: 360px;
    }
}

@media (max-width: 420px) {
    .rec-row--actions {
        grid-template-columns: 1fr;
    }
    .rec-toolbar__row--filters {
        grid-template-columns: 1fr;
    }
    .rec-metrics {
        grid-template-columns: 1fr;
    }
}
