:root
{
    --bg: #f6f5f2;
    --card: #ffffff;
    --ink: #1d1c1a;
    --muted: #6d6a63;
    --line: #e3e0d8;
    --accent: #2f5bd3;
    --accent-ink: #ffffff;
    --ok: #2f8f4e;
    --bad: #c2412d;
    --flash-ok: #e7f4ea;
    --flash-bad: #fbe9e5;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark)
{
    :root
    {
        --bg: #161615;
        --card: #1f1f1d;
        --ink: #ecebe6;
        --muted: #9d9a92;
        --line: #33322f;
        --accent: #7d9cf2;
        --accent-ink: #10131d;
        --ok: #6cc489;
        --bad: #f08a76;
        --flash-ok: #1d3023;
        --flash-bad: #3a211c;
    }
}

*
{
    box-sizing: border-box;
}

body
{
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a
{
    color: var(--accent);
}

main
{
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

h1
{
    font-size: 24px;
    margin: 0 0 12px;
}

h2
{
    font-size: 18px;
    margin: 0;
}

.top
{
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    align-items: center;
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}

.top .brand
{
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
}

.top nav
{
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.top nav a
{
    text-decoration: none;
}

.head
{
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card
{
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}

.narrow
{
    max-width: 560px;
}

.muted
{
    color: var(--muted);
}

.small
{
    font-size: 13px;
}

.ok
{
    color: var(--ok);
}

.bad
{
    color: var(--bad);
}

.right
{
    text-align: right;
}

.stats
{
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.stats a
{
    color: var(--ink);
    text-decoration: none;
}

.stats a.bad
{
    color: var(--bad);
}

table
{
    width: 100%;
    border-collapse: collapse;
}

th, td
{
    padding: 8px 4px;
    border-top: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th
{
    width: 150px;
    font-weight: 600;
}

label
{
    display: block;
    margin-bottom: 14px;
    font-weight: 600;
}

label.check
{
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: 400;
    margin-bottom: 8px;
}

fieldset
{
    border: 0;
    padding: 0;
    margin: 0 0 14px;
}

legend
{
    font-weight: 600;
    margin-bottom: 6px;
}

input[type=text], input[type=password], input[type=url], input[type=number], input[type=date], input[type=time], input[type=datetime-local], textarea
{
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    font-weight: 400;
}

button, .button
{
    display: inline-block;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

button.primary, .button.primary
{
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

button.small, .button.small
{
    padding: 3px 10px;
    font-size: 13px;
}

button.link
{
    border: 0;
    background: none;
    color: var(--muted);
    text-decoration: underline;
}

form.inline
{
    display: inline;
}

.actions
{
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.flash
{
    padding: 10px 14px;
    border-radius: 6px;
    background: var(--flash-ok);
}

.flash-error
{
    background: var(--flash-bad);
}

.tabs
{
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.tabs a
{
    text-decoration: none;
    color: var(--muted);
}

.tabs a.active
{
    color: var(--ink);
    font-weight: 600;
}

.bulk
{
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    padding: 10px 0;
    background: var(--bg);
}

.bulk label.check
{
    margin: 0 8px 0 0;
}

.posts
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.post
{
    display: flex;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    min-width: 0;
}

.post .media
{
    position: relative;
    flex: 0 0 96px;
    align-self: flex-start;
}

.post .media img
{
    width: 96px;
    border-radius: 6px;
    display: block;
}

.post .badge
{
    position: absolute;
    left: 4px;
    bottom: 4px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
}

.post .body
{
    min-width: 0;
    flex: 1;
}

.post p
{
    margin: 0 0 4px;
}

.post .when
{
    font-weight: 600;
}

.post pre
{
    white-space: pre-wrap;
    font: inherit;
    font-size: 13px;
    margin: 6px 0;
}

.strip
{
    display: flex;
    gap: 4px;
    overflow-x: auto;
}

.strip img
{
    height: 90px;
    border-radius: 4px;
}

@media (max-width: 600px)
{
    th
    {
        width: auto;
    }

    .post .media
    {
        flex-basis: 72px;
    }

    .post .media img
    {
        width: 72px;
    }
}
