/* Copied from verso-serve repository */
/* See `src/verso-serve/VersoServe/listing.css` */
:root {
    color-scheme: light dark;
    --bg: #fcfcfd;
    --panel: #ffffff;
    --fg: #1c1e21;
    --muted: #6b7280;
    --accent: #3b5bdb;
    --border: #e6e8eb;
    --hover: #f4f5f7;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #15171c;
        --panel: #1b1e25;
        --fg: #e9eaec;
        --muted: #9aa0aa;
        --accent: #92a8ff;
        --border: #2a2e37;
        --hover: #222631;
    }
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family:
        ui-sans-serif,
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    line-height: 1.5;
}

main {
    max-width: 48rem;
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3rem) 1.25rem 4rem;
}

h1 {
    margin: 0 0 1.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    word-break: break-all;
}

h1 .label {
    color: var(--muted);
    font-weight: 500;
    margin-right: 0.4rem;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    overflow: hidden;
}

li + li {
    border-top: 1px solid var(--border);
}

li a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    color: var(--fg);
    text-decoration: none;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9rem;
}

li a:hover,
li a:focus-visible {
    background: var(--hover);
    color: var(--accent);
    outline: none;
}

li a::before {
    content: "";
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    background-color: var(--muted);
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

li a:hover::before,
li a:focus-visible::before {
    background-color: var(--accent);
}

li.dir a::before {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z'/%3E%3C/svg%3E");
}

li.file a::before {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z'/%3E%3C/svg%3E");
}

li.up a {
    color: var(--muted);
}

li.up a::before {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M14 15v2.59L6.71 10.3a.996.996 0 1 0-1.41 1.41l7.29 7.29H10c-.55 0-1 .45-1 1s.45 1 1 1h6c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1s-1 .45-1 1z'/%3E%3C/svg%3E");
}
