/* ===== Cohesive style with main site ===== */
:root {
    --bg: #0b0c10;
    --bg-grad-1: #090a0e;
    --bg-grad-2: #0b0c10;
    --bg-grad-3: #08090c;

    --panel: #121418;
    --text: #e7e9ee;
    --muted: #8b8f98;
    --link: #9be7ff;

    --border: #242834;
    --shadow: 0 10px 25px rgba(0, 0, 0, .45);

    --accent: #ffffff;
    --accent-2: #8b8f98;

    --danger: #ff6b6b;
    --warn: #f6c177;
    --ok: #72ffa8;

    --container: 1100px;
    --radius: 14px;
    --radius-lg: 20px;

    /* default heights; overridden in .compact on body */
    --h-top: 220px;
    --h-card: 360px;

    /* default paddings; overridden in .compact */
    --pad-card: 12px;
    --pad-container-x: 24px;
    --pad-container-y: 18px;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    background: linear-gradient(180deg, var(--bg-grad-1) 0%, var(--bg-grad-2) 60%, var(--bg-grad-3) 100%);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--link);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

.unstyled-link {
    color: inherit;
    text-decoration: none
}

/* ===== Scrollbars (global + panels) ===== */
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #2a2e3a #0f1116;
}

/* WebKit (Chrome/Edge/Safari) */
body::-webkit-scrollbar,
.panel::-webkit-scrollbar {
    width: 10px;
    height: 10px
}

body::-webkit-scrollbar-track,
.panel::-webkit-scrollbar-track {
    background: #0f1116;
    border-radius: 8px
}

body::-webkit-scrollbar-thumb,
.panel::-webkit-scrollbar-thumb {
    background: #2a2e3a;
    border-radius: 8px;
    border: 2px solid #0f1116
}

body:hover::-webkit-scrollbar-thumb,
.panel:hover::-webkit-scrollbar-thumb {
    background: #3a3f4f
}

/* ===== Header / Nav (matches main site) ===== */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 12, 16, .85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--pad-container-y) var(--pad-container-x);
}

.nav {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center
}

.brand {
    font-weight: 800;
    letter-spacing: .08em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand .wordmark {
    font-weight: 800
}

.brand .wordmark span {
    color: var(--accent-2)
}

.brand .slash {
    opacity: .6
}

.brand img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
    opacity: .9
}

/* Header controls styled like pills */
.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #10141b;
    color: var(--muted);
    font-size: 14px;
}

.pill strong {
    color: #fff;
    font-weight: 700
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: #0f1217;
    color: var(--text);
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.btn:hover {
    filter: brightness(1.08)
}

/* top loader bar (kept) */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
    width: 0;
    transition: width .3s ease;
    z-index: 60
}

/* ===== Page Title row ===== */
.hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 18px 0
}

.hero h1 {
    margin: 0;
    font-size: clamp(22px, 3.2vw, 32px);
    line-height: 1.2
}

.subtle {
    color: var(--muted)
}

/* ===== Cards & grid (styled like main tiles) ===== */
.grid {
    display: grid;
    gap: 16px
}

@media(min-width:1100px) {
    .grid {
        grid-template-columns: repeat(12, 1fr)
    }
}

.card {
    grid-column: span 12;
    background: radial-gradient(100% 100% at 100% 0%, #171a20 0%, #0f1116 50%, #0c0e12 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--pad-card);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.panel {
    overflow: auto;
    border-radius: 12px;
    min-height: 0;
    background: linear-gradient(180deg, #0f1217 0%, #0b0d12 100%)
}

.sameh-top {
    max-height: var(--h-top)
}

.sameh {
    max-height: var(--h-card)
}

@media(min-width:880px) {
    .span-4 {
        grid-column: span 4
    }

    .span-6 {
        grid-column: span 6
    }

    .span-8 {
        grid-column: span 8
    }

    .span-12 {
        grid-column: span 12
    }
}

h2 {
    margin: 2px 0 8px;
    font-size: 16px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap
}

.badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #0f1217;
    color: var(--muted);
    border: 1px solid var(--border);
    text-decoration: none;
    white-space: nowrap;
    /* keep badges tidy */
}

.badge:hover {
    color: #fff;
    text-decoration: underline
}

ul.clean {
    list-style: none;
    margin: 0;
    padding: 0
}

li.item {
    padding: 10px 8px;
    border-top: 1px dashed #2a2e3a;
    display: grid;
    gap: 4px;
    word-break: break-word;
    /* keep long titles/descs inside the card */
}

li.item:first-child {
    border-top: 0
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap
}

.title {
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%
}

.mono,
.k {
    font-size: 12px;
    color: var(--muted)
}

.score {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #10141b;
}

/* severity chips */
.chip {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid var(--border)
}

.crit {
    background: #3b0000;
    color: var(--danger)
}

.high {
    background: #3b1a00;
    color: var(--danger)
}

.med {
    background: #3b2f00;
    color: var(--warn)
}

.low {
    background: #003b11;
    color: var(--ok)
}

.item.new {
    animation: fadeIn 1.5s;
    border-left: 3px solid var(--accent)
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

/* keyword highlight harmonized */
mark {
    background: var(--accent);
    color: #0b0c10;
    padding: 0 2px;
    border-radius: 3px
}

/* Footer matches main site */
footer {
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding: 18px;
    color: var(--muted);
    font-size: 14px;
    text-align: center
}

/* ===== Compact mode ===== */
body.compact {
    --h-top: 180px;
    --h-card: 280px;
    --pad-card: 10px;
    --pad-container-y: 12px;
}

body.compact .pill {
    display: none
}

body.compact .hero {
    margin: 10px 0
}

body.compact .brand img {
    display: none
}

body.compact .title {
    white-space: normal
}

/* Mobile polish */
@media (max-width: 880px) {
    :root {
        --h-top: 28vh;
        --h-card: 36vh;
    }

    .nav {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center
    }

    .controls {
        justify-content: center
    }

    .brand {
        justify-content: center
    }

    .title {
        white-space: normal
    }

    .panel {
        -webkit-overflow-scrolling: touch
    }
}