/* ─── Modern Typography: Outfit (Headings) + Inter (Body) ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ─── Premium CSS Variables ─── */
:root {
    --bg-deep: #020408;
    --bg-surface: #0a0c12;
    --bg-card: rgba(17, 19, 24, 0.7);
    --bg-card-hover: rgba(25, 27, 35, 0.8);
    --bg-elevated: #1a1c24;

    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-default: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-blue: #3b82f6;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-cyan: #06b6d4;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --glass-bg: rgba(10, 12, 18, 0.85);
    --glass-blur: blur(16px) saturate(140%);
}

/* ─── Global Reset & Base ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.5;
}

body {
    margin: 0;
    min-height: 100vh;
    position: relative;
}

/* Background Decoration */
body::after {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3,
h4,
.page-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

/* ─── Layout Structure ─── */
.main-content {
    margin-left: 260px;
    padding: 32px;
    max-width: 1400px;
    min-height: 100vh;
}

.mobile-header {
    display: none;
}

.sidebar-overlay {
    display: none;
}

/* ─── Sidebar (Fixed Glass) ─── */
.sidebar {
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    padding: 32px 24px 24px;
}

.sidebar-brand h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.brand-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-blue);
}

.nav-item {
    margin: 4px 16px;
    padding: 10px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.6;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

/* Tab Specific Colors (Active) */
.nav-item[data-page="overview"].active {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.nav-item[data-page="overview"].active svg {
    color: var(--accent-blue);
    opacity: 1;
}

.nav-item[data-page="campaigns"].active {
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.1);
}

.nav-item[data-page="campaigns"].active svg {
    color: var(--accent-emerald);
    opacity: 1;
}

.nav-item[data-page="videos"].active {
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1);
}

.nav-item[data-page="videos"].active svg {
    color: var(--accent-cyan);
    opacity: 1;
}

.nav-item[data-page="comments"].active {
    color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.1);
}

.nav-item[data-page="comments"].active svg {
    color: var(--accent-amber);
    opacity: 1;
}

.nav-item[data-page="buff"].active {
    color: #fb7185;
    background: rgba(251, 113, 133, 0.1);
}

.nav-item[data-page="buff"].active svg {
    color: #fb7185;
    opacity: 1;
}

.nav-item[data-page="config"].active {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.1);
}

.nav-item[data-page="config"].active svg {
    color: #a78bfa;
    opacity: 1;
}

.nav-item[data-page="logs"].active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.nav-item[data-page="logs"].active svg {
    color: var(--text-primary);
    opacity: 1;
}

.nav-item.active {
    font-weight: 600;
}

/* Page Specific Accents */
#page-overview .page-title {
    color: var(--accent-blue);
}

#page-campaigns .page-title {
    color: var(--accent-emerald);
}

#page-videos .page-title {
    color: var(--accent-cyan);
}

#page-comments .page-title {
    color: var(--accent-amber);
}

#page-buff .page-title {
    color: #fb7185;
}

#page-config .page-title {
    color: #a78bfa;
}

/* Section Header Icons Color Sync */
#page-campaigns .card h3 svg {
    color: var(--accent-emerald);
}

#page-videos .card h3 svg {
    color: var(--accent-cyan);
}

#page-comments .card h3 svg {
    color: var(--accent-amber);
}

#page-buff .card h3 svg {
    color: #fb7185;
}

#page-config .card h3 svg {
    color: #a78bfa;
}

/* Section Specific Buttons */
#page-campaigns .btn-primary {
    background: var(--accent-emerald);
}

#page-campaigns .btn-primary:hover {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

#page-videos .btn-primary {
    background: var(--accent-cyan);
}

#page-videos .btn-primary:hover {
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

#page-comments .btn-primary {
    background: var(--accent-amber);
}

#page-comments .btn-primary:hover {
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

#page-buff .btn-primary {
    background: #fb7185;
}

#page-buff .btn-primary:hover {
    box-shadow: 0 4px 15px rgba(251, 113, 133, 0.3);
}

#page-config .btn-primary {
    background: #a78bfa;
}

#page-config .btn-primary:hover {
    box-shadow: 0 4px 15px rgba(167, 139, 250, 0.3);
}

/* ─── Components ─── */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.stat-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.4));
    padding: 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.1);
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.6));
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--glow-color, transparent) 0%, transparent 70%);
    opacity: 0.1;
    pointer-events: none;
}

.stat-card.blue {
    --glow-color: var(--accent-blue);
}

.stat-card.emerald {
    --glow-color: var(--accent-emerald);
}

.stat-card.red {
    --glow-color: var(--accent-red);
}

.stat-card.amber {
    --glow-color: var(--accent-amber);
}

.stat-card.cyan {
    --glow-color: var(--accent-cyan);
}

.stat-card.pink {
    --glow-color: #fb7185;
}

.stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    line-height: 1;
    letter-spacing: -0.05em;
    z-index: 1;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    z-index: 1;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-default);
    color: var(--text-secondary);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.btn-icon {
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
    padding: 12px 16px;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border-subtle);
}

/* Badges */
.badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-posted {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
}

.badge-ready {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-cyan);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-amber);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}

.badge-posting {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 9999;
    padding: 12px 24px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    justify-content: center;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    border-left: 4px solid var(--accent-emerald);
}

.toast-error {
    border-left: 4px solid var(--accent-red);
}

.toast-info {
    border-left: 4px solid var(--accent-blue);
}

/* Inputs */
.input,
.textarea,
.select {
    width: 100%;
    padding: 10px 14px;
    background: #0f172a;
    /* Solid dark background for better contrast */
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: #ffffff;
    /* Pure white text */
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: all var(--transition-fast);
}

.select option {
    background: #1e293b;
    color: #ffffff;
}

.input:focus,
.textarea:focus,
.select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 10px;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 20px;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-subtle);
        position: sticky;
        top: 0;
        z-index: 90;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 95;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 640px) {
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
}

/* ─── Login Screen (Premium) ─── */
.login-container {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, #0f172a 0%, #020408 100%);
    z-index: 1000;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--accent-blue), transparent 25%, transparent);
    animation: rotate 10s linear infinite;
    opacity: 0.03;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 48px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    z-index: 1;
}

.login-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 32px;
    padding: 1px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent, rgba(59, 130, 246, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-align: left;
}

/* Custom Input for Login */
.login-card .input {
    background: rgba(2, 4, 8, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 52px;
    border-radius: 14px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-card .input:focus {
    background: rgba(2, 4, 8, 0.8);
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.login-card .btn-primary {
    height: 52px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4);
}

.login-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(59, 130, 246, 0.6);
}

/* Utility */
.hidden {
    display: none !important;
}

.rotate-180 {
    transform: rotate(180deg);
}

.section-chevron {
    transition: transform 0.3s;
}

@keyframes pulse-soft {

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

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

.animate-pulse-soft {
    animation: pulse-soft 2s ease-in-out infinite;
}


/* ─── Premium Caption Modal ───────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(20, 184, 166, 0.16), transparent 34%),
        radial-gradient(circle at 82% 10%, rgba(245, 158, 11, 0.12), transparent 30%),
        rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(18px) saturate(145%);
}

.modal-panel {
    position: relative;
    width: min(720px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(8, 13, 18, 0.96), rgba(2, 6, 12, 0.98)),
        radial-gradient(circle at top left, rgba(20, 184, 166, 0.18), transparent 42%);
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.72),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: 28px;
    overflow: hidden;
    animation: modalRise 180ms ease-out;
}

.caption-modal-panel::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 27px;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 28%, rgba(20, 184, 166, 0.08));
}

.modal-orb {
    position: absolute;
    right: -70px;
    top: -70px;
    width: 190px;
    height: 190px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.34), transparent 65%);
    filter: blur(4px);
    pointer-events: none;
}

.modal-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.modal-kicker {
    margin: 0 0 8px;
    color: #14b8a6;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.modal-title {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 900;
    letter-spacing: -0.04em;
}

.caption-editor {
    position: relative;
    min-height: 230px;
    resize: vertical;
    font-size: 15px;
    line-height: 1.7;
    background: rgba(2, 6, 12, 0.72) !important;
    border-color: rgba(20, 184, 166, 0.22) !important;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        0 16px 38px rgba(0, 0, 0, 0.28);
}

.caption-editor:focus {
    border-color: rgba(20, 184, 166, 0.58) !important;
    box-shadow:
        0 0 0 4px rgba(20, 184, 166, 0.11),
        0 18px 44px rgba(0, 0, 0, 0.36);
}

.caption-modal-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
    color: #94a3b8;
    font-size: 12px;
}

.modal-actions {
    position: relative;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 26px;
}

body.modal-open {
    overflow: hidden;
}

@keyframes modalRise {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

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

.video-library-shell {
    display: grid;
    gap: 18px;
}

.video-library-summary,
.video-campaign-header,
.video-item-card,
.video-count-pills,
.video-item-actions {
    display: flex;
    align-items: center;
}

.video-library-summary {
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 12px;
}

.video-campaign-groups {
    display: grid;
    gap: 18px;
}

.video-campaign-card {
    border: 1px solid rgba(20, 184, 166, 0.18);
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.72), rgba(2, 6, 12, 0.84)),
        radial-gradient(circle at 8% 0%, rgba(20, 184, 166, 0.12), transparent 36%);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.video-campaign-header {
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.video-campaign-header h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.video-count-pills,
.video-item-actions {
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(148, 163, 184, 0.10);
    color: #cbd5e1;
}

.pill-posted { color: #34d399; background: rgba(52, 211, 153, 0.10); }
.pill-error { color: #fb7185; background: rgba(251, 113, 133, 0.10); }
.pill-pending { color: #fbbf24; background: rgba(251, 191, 36, 0.10); }
.pill-total { color: #38bdf8; background: rgba(56, 189, 248, 0.10); }

.video-card-list {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.video-item-card {
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    background: rgba(2, 6, 12, 0.54);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.video-item-card:hover {
    transform: translateY(-2px);
    border-color: rgba(20, 184, 166, 0.28);
    background: rgba(15, 23, 42, 0.76);
}

.video-item-main {
    min-width: 0;
    flex: 1;
}

.video-source,
.video-caption-preview,
.video-error-line {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-source {
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 700;
}

.video-caption-preview {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
}

.video-error-line {
    margin-top: 7px;
    color: #fb7185;
    font-size: 12px;
    font-weight: 700;
}

.video-item-status {
    white-space: nowrap;
}

.video-detail-panel {
    width: min(920px, 100%);
    max-height: min(86vh, 860px);
    overflow-y: auto;
}

.video-detail-body {
    position: relative;
    display: grid;
    gap: 16px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-grid div,
.detail-section {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(2, 6, 12, 0.56);
}

.detail-grid div {
    padding: 12px;
}

.detail-grid span,
.detail-section h4 {
    display: block;
    margin: 0 0 7px;
    color: #14b8a6;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.detail-grid strong {
    color: #f8fafc;
    font-size: 13px;
    word-break: break-word;
}

.detail-section {
    padding: 14px;
}

.detail-section pre {
    max-height: 220px;
    overflow: auto;
    margin: 0;
    color: #cbd5e1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.detail-error { border-color: rgba(251, 113, 133, 0.22); }
.detail-api { border-color: rgba(56, 189, 248, 0.18); }

@media (max-width: 640px) {
    .modal {
        padding: 14px;
    }

    .modal-panel {
        padding: 22px;
        border-radius: 22px;
    }

    .caption-modal-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .btn {
        width: 100%;
    }
}