:root {
    --bg: #282a36;
    --panel: #44475a;
    --fg: #f8f8f2;
    --accent: #8be9fd;
    --muted: rgba(248, 248, 242, 0.03);
}
html,
body {
    background: var(--bg);
    color: var(--fg);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial;
    padding: 1rem;
    margin: 0;
}

/* header */
.ai-brand {
    color: #bd93f9;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.ai-brand a {
    color: var(--accent);
}

/* make the autoindex <pre> more readable */
pre {
    background: transparent;
    color: var(--fg);
    font-family: monospace;
    white-space: pre;
    margin: 0;
    padding: 0.25rem 0;
}

/* make each link in the pre look like an item (note: autoindex prints date/size as plain text) */
pre a {
    color: var(--accent);
    display: inline-block;
    min-width: 46%;
    text-decoration: none;
    padding: 0.15rem 0.25rem;
    border-radius: 4px;
}
pre a:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* subtle panel behind the listing to separate from page */
pre {
    padding: 0.4rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* if autoindex emits a table (some templates / modules do), style tables too */
table,
th,
td {
    background: transparent;
    color: var(--fg);
    border-collapse: collapse;
}
table {
    width: 100%;
    border: 1px solid var(--panel);
    border-radius: 6px;
    overflow: hidden;
}
th,
td {
    padding: 0.45rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}
thead th {
    background: var(--panel);
    color: var(--fg);
}
tbody tr:nth-child(even) td {
    background: var(--muted);
}

/* footer */
.ai-footer {
    color: #9aa0b4;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

/* helper to hide duplicate H1 if you can't remove it server-side */
.ai-header + h1 {
    display: none;
}

/* images */
img {
    max-width: 100%;
    height: auto;
    filter: none;
}
.ai-autoindex-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
.ai-autoindex-table th,
.ai-autoindex-table td {
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--fg);
}
.ai-autoindex-table thead th {
    background: #44475a;
    color: var(--fg);
}
.ai-autoindex-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}
.ai-autoindex-table td a {
    color: var(--accent);
    text-decoration: none;
    display: inline-block;
}
