:root {
    --auto-ink: #1d2a38;
    --auto-soft: #5c6b77;
    --auto-line: rgba(29, 42, 56, 0.12);
    --auto-surface: rgba(255, 255, 255, 0.94);
    --auto-bg-top: #eef2ff;
    --auto-bg-bottom: #e0f2f1;
    --auto-primary: #4f46e5;
    --auto-primary-dark: #3730a3;
    --auto-nav: #1e1b4b;
}

body {
    margin: 0;
    font-family: "Public Sans", system-ui, sans-serif;
    color: var(--auto-ink);
    background: linear-gradient(180deg, var(--auto-bg-top) 0%, var(--auto-bg-bottom) 100%);
    min-height: 100vh;
}

.autonome-nav {
    background: var(--auto-nav);
}

.autonome-card-header {
    background: var(--auto-nav);
    color: #fff;
}

.autonome-footer {
    padding: 1.5rem 0 2.5rem;
}

.hero-panel,
.surface-card,
.stat-card,
.mirror-card {
    border-radius: 20px;
    border: 1px solid var(--auto-line);
    background: var(--auto-surface);
    box-shadow: 0 20px 50px rgba(29, 42, 56, 0.08);
}

.hero-panel {
    padding: 2rem;
}

.eyebrow {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.12);
    color: var(--auto-primary-dark);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.stat-card {
    padding: 1.1rem 1.25rem;
    text-align: center;
}

.stat-num {
    font-size: 1.6rem;
    font-weight: 800;
}

.stat-label {
    color: var(--auto-soft);
    font-size: 0.85rem;
}

.stat-warn {
    border-color: rgba(220, 53, 69, 0.4);
}

.stat-ok {
    border-color: rgba(25, 135, 84, 0.4);
}

.mirror-card {
    overflow: hidden;
}

.mirror-file {
    padding: 1.5rem;
    text-align: center;
    background: rgba(79, 70, 229, 0.06);
    font-size: 1.5rem;
}

.dlg-msg {
    border: 1px solid var(--auto-line);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.7);
}

.code-block {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.85rem;
    white-space: pre-wrap;
}

.content-body {
    white-space: pre-wrap;
    line-height: 1.7;
}

.font-monospace {
    font-family: ui-monospace, monospace;
}

/* ---------- Portal ---------- */

.portal-hero {
    border-radius: 24px;
    padding: 3rem 2.5rem;
    color: #fff;
    background: linear-gradient(120deg, #1e1b4b 0%, #4f46e5 55%, #0d9488 100%);
    box-shadow: 0 24px 60px rgba(30, 27, 75, 0.35);
    position: relative;
    overflow: hidden;
}

.portal-hero .eyebrow {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.portal-hero .text-secondary {
    color: rgba(255, 255, 255, 0.82) !important;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.25rem;
}

.section-title i {
    color: var(--auto-primary);
}

.mirror-card {
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mirror-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 60px rgba(29, 42, 56, 0.16);
}

.mirror-img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
}

.mirror-img-featured {
    height: 320px;
}

.mirror-fallback {
    height: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, var(--auto-primary), var(--auto-nav));
}

.hero-img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(29, 42, 56, 0.18);
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.avatar-lg {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.2rem;
}

.chat-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.chat-bubble {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--auto-line);
    border-radius: 4px 16px 16px 16px;
    padding: 0.75rem 1rem;
    max-width: 100%;
}

.chat-bubble .who {
    font-weight: 700;
    font-size: 0.85rem;
}

.review-thread {
    border-left: 3px solid rgba(79, 70, 229, 0.25);
    padding-left: 0.9rem;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--auto-soft);
    background: rgba(29, 42, 56, 0.06);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
}

.stat-card .stat-ic {
    font-size: 1.5rem;
    color: var(--auto-primary);
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--auto-soft);
}

.empty-state i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    color: rgba(79, 70, 229, 0.5);
}

@media (max-width: 767px) {
    .hero-panel,
    .surface-card {
        border-radius: 16px;
    }

    .portal-hero {
        padding: 2rem 1.4rem;
        border-radius: 18px;
    }

    .mirror-img,
    .mirror-fallback {
        height: 170px;
    }
}
