@import url("https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,400;0,600;0,700;1,400&display=swap");

:root {
    color-scheme: light dark;
    --bg: #f5f1e8;
    --panel: #fffdf8;
    --ink: #20211f;
    --muted: #65665f;
    --line: #d8d2c5;
    --accent: #476126;
    --danger: #9e2f27;
    --edit: #856b13;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font:
        16px/1.55 "Source Sans Pro",
        ui-sans-serif,
        system-ui,
        sans-serif;
}
header {
    background: #263416;
    color: white;
    gap: 0.5rem;
}
header a {
    color: white;
}
header > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    max-width: 70rem;
    margin: 0 auto;
    padding: 1rem;
}
.brand {
    font:
        700 1.35rem "Source Sans Pro",
        ui-sans-serif,
        system-ui,
        sans-serif;
    text-decoration: none;
}
main {
    max-width: 70rem;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}
h1,
h2,
h3 {
    font-family: "Source Sans Pro", ui-sans-serif, system-ui, sans-serif;
    line-height: 1.15;
}
a {
    color: var(--accent);
}
.standing {
    font-size: 0.65em;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}
.original-link {
    font-size: 0.55em;
    font-weight: 600;
    white-space: nowrap;
}
.activity,
.entries,
.versions {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1rem;
}
.activity li,
.entries li,
.versions li,
.filters,
.table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 0.55rem;
    padding: 1rem;
}
.entry-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}
.entry-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.85rem;
}
p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    color: white;
    background: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}
.entry_deleted {
    background: var(--danger);
}
.entry_edited {
    background: var(--edit);
}
.entry_restored {
    background: var(--accent);
}
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 0.75rem;
}
.stats div {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    padding: 0.75rem;
}
.stats dt {
    color: var(--muted);
}
.stats dd {
    margin: 0;
    font:
        700 1.6rem "Source Sans Pro",
        ui-sans-serif,
        system-ui,
        sans-serif;
}
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}
.filters label {
    display: grid;
    gap: 0.25rem;
}
.filters input,
.filters select,
.filters button {
    height: 2.75rem;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 0.35rem;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    line-height: 1.25;
    padding: 0.5rem 0.65rem;
}
.filters button {
    cursor: pointer;
}
.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th,
td {
    padding: 0.65rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
}
.text-center {
    text-align: center;
}
.pager {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}
.note,
.empty,
time {
    white-space: nowrap;
    color: var(--muted);
}
.identity {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.identity img {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    object-fit: cover;
}
.content {
    margin: 1rem 0;
    white-space: pre-wrap;
}
.diff {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.diff del,
.diff ins {
    padding: 0.75rem;
    white-space: pre-wrap;
    text-decoration: none;
}
.diff del {
    background: #f9dddd;
}
.diff ins {
    background: #dff1dc;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #171914;
        --panel: #22251e;
        --ink: #f2efe8;
        --muted: #b7b6ae;
        --line: #41453a;
        --accent: #b5d47c;
    }
    .diff del {
        background: #572824;
    }
    .diff ins {
        background: #294a28;
    }
}
@media (max-width: 38rem) {
    .diff {
        grid-template-columns: 1fr;
    }
}

.author-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

/* First column: fixed minimal width */
.author-table th.col-rank,
.author-table td.col-rank {
    width: 1rem;
    min-width: 1rem;
    text-align: right;
    white-space: nowrap;
}

/* Nick column: takes up all remaining available space */
.author-table th.col-nick,
.author-table td.col-nick {
    width: 100%;
}

/* Metric columns: auto-sized to content without wrapping */
.author-table th.col-stat,
.author-table td.col-stat {
    white-space: nowrap;
    text-align: right; /* Standard for numeric columns */
    min-width: 4rem;
    width: 4rem;
}

.fill-space {
    flex-grow: 1;
}

.logo {
    height: 2.5rem;
    width: auto;
    flex-shrink: 0;
}
