/* Colours as light-dark(light, dark): the system setting decides, unless the visitor picked a mode (data-theme). */
:root {
    color-scheme: light dark;
    --bg: light-dark(#e9e9e4, #161614);
    --surface: light-dark(#ffffff, #1f1f1c);
    --text: light-dark(#1c1c1a, #e6e6e1);
    --muted: light-dark(#63635e, #9a9a93);
    --line: light-dark(#d6d6d0, #33332f);
    --accent: light-dark(#427a1c, #65b32e);
    --on-accent: light-dark(#ffffff, #0b1a04);
    --bar-accent: #65b32e;
    --accent-text: light-dark(#3f7a1a, #8fd25a);
    --accent-dark: light-dark(#33611a, #76bf3d);
    --processed: light-dark(#1f5fa8, #6aa6e0);
    --warning: light-dark(#c58f00, #d9a520);
    --nodata: light-dark(#d6d6d0, #3a3a35);
    --bar: light-dark(#34342f, #0a0a0a);
    --bar-text: #e8e8e4;
    --texture: light-dark(rgba(0, 0, 0, .03), rgba(255, 255, 255, .025));
    --danger: light-dark(#b3261e, #f28b82);
    --on-danger: light-dark(#ffffff, #1f1f1c);
    --ok-bg: light-dark(#e6f3da, #243a16);
    --error-bg: light-dark(#f9e3e1, #4a1f1c);
    --radius: 6px;
    --shadow: 0 1px 2px light-dark(rgba(0, 0, 0, .06), rgba(0, 0, 0, .4)), 0 4px 16px light-dark(rgba(0, 0, 0, .05), rgba(0, 0, 0, .3));
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    position: relative;
}
/* The command-word texture of the previous site, tinted by --texture. */
body::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--texture);
    mask: url("../img/commands.webp") repeat left top;
}

a { color: var(--accent-text); }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
.muted { color: var(--muted); }
img { max-width: 100%; height: auto; display: block; }

/* Top bar */
.topbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.25rem;
    min-height: 60px;
    background: var(--bar);
    color: var(--bar-text);
    border-bottom: 3px solid var(--bar-accent);
}
.topbar .logo { display: flex; align-items: center; color: #fff; padding: .4rem 0; }
.topbar .logo svg { height: 30px; width: auto; fill: currentColor; }
.topbar .logo:hover { color: var(--bar-accent); }
.topnav, .account { display: flex; flex-wrap: wrap; gap: .25rem; }
.topnav { flex: 1; }
.account { margin-left: auto; align-items: center; }
.topbar a, .topbar button.link {
    color: var(--bar-text);
    text-decoration: none;
    padding: .45rem .7rem;
    border-radius: var(--radius);
    font-size: .95rem;
}
.topbar a:hover, .topbar button.link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.topbar a.active { color: var(--bar-accent); }
button.link { background: none; border: 0; font: inherit; cursor: pointer; }

/* Notifications: the bell in the top bar with their number opens the list; it shows only when there is something. */
.notifications { position: relative; }
.notifications > summary { display: inline-flex; align-items: center; gap: .25rem; padding: .45rem .55rem; border-radius: var(--radius); color: var(--bar-text); }
.notifications > summary:hover, .notifications[open] > summary { background: rgba(255, 255, 255, .1); color: #fff; }
.notifications .badge { min-width: 1.2rem; padding: 0 .3rem; border-radius: 999px; background: var(--bar-accent); color: #111; font-size: .75rem; font-weight: 700; line-height: 1.2rem; text-align: center; }
.notification-list { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20; width: min(24rem, calc(100vw - 2rem)); max-height: 70vh; overflow-y: auto; background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow); }
.notification { display: grid; grid-template-columns: 1fr auto; gap: .15rem .5rem; align-items: center; padding: .6rem .5rem .6rem .85rem; border-bottom: 1px solid var(--line); }
.notification:last-child { border-bottom: 0; }
.topbar .notification a { padding: 0; color: var(--text); font-weight: 600; }
.topbar .notification a:hover { background: none; color: var(--accent-text); }
.notification small { color: var(--muted); }
.notification > span { font-weight: 600; overflow-wrap: anywhere; }
.notification-list > p { margin: 0; padding: .75rem .85rem; }
.notification form { grid-column: 2; grid-row: 1 / span 2; }

/* Shell: sidebar + main */
.shell {
    flex: 1;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem;
}
.sidebar section { margin-bottom: 1.5rem; }
.sidebar h2 {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin: 0 0 .35rem;
}
.sidebar a {
    display: block;
    padding: .3rem .5rem;
    margin-left: -.5rem;
    color: var(--text);
    text-decoration: none;
    border-left: 3px solid transparent;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.sidebar a:hover { background: var(--surface); }
.sidebar a.active { border-left-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.sidebar .view-toggle button { display: block; width: 100%; padding: .3rem .5rem; margin-left: -.5rem; border-left: 3px solid transparent; color: var(--text); text-align: left; border-radius: 0 var(--radius) var(--radius) 0; }
.sidebar .view-toggle button:hover { background: var(--surface); }
.sidebar .user-view button { border-left-color: var(--warning); font-weight: 600; }
.topbar .tag { color: var(--bar-text); }

/* Home */
.hero {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem 2.25rem;
    margin-bottom: 2rem;
    border-top: 4px solid var(--accent);
    position: relative;
}
.hero > p:first-of-type:has(+ h1) {
    margin: 0 0 .5rem;
    font-size: .8rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent-text);
    font-weight: 600;
}
.hero h1 { font-size: 2.2rem; }
.hero h1 + p { font-size: 1.1rem; max-width: 60ch; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.25rem 0 0; }
.actions .button.danger { margin-left: auto; }

.events { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.card img { width: 100%; background: #000; }
.card-body { position: relative; padding: 1.25rem 1.5rem 1.5rem; }
.card h2 a { text-decoration: none; color: var(--text); }
.card h2 a:hover { color: var(--accent-text); }
.card-body h2 + p > strong:only-child { color: var(--accent-text); font-size: .9rem; }

/* Buttons and forms */
.button, button.small, input[type=file]::file-selector-button {
    display: inline-block;
    padding: .55rem 1.1rem;
    background: var(--accent);
    color: var(--on-accent);
    border: 0;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.button:hover { background: var(--accent-dark); color: var(--on-accent); }
.button.secondary { background: transparent; color: var(--accent-text); box-shadow: inset 0 0 0 2px var(--accent); }
.button.secondary:hover { background: var(--accent); color: var(--on-accent); }

.form { max-width: 28rem; display: grid; gap: .9rem; }
/* A label holds its text, a hint beside it (small) and below them its field. */
.form label { display: grid; gap: .3rem .5rem; font-weight: 600; font-size: .95rem; }
.form label:not(.check) { grid-template-columns: auto minmax(0, 1fr); align-items: baseline; }
.form label:not(.check) > :not(small) { grid-column: 1 / -1; }
.form label small { font-weight: 400; color: var(--muted); }
.form label.check { grid-template-columns: auto 1fr; align-items: center; font-weight: 400; }
.form label.check small { grid-column: 2; }
.form input:not([type=checkbox]), .form select {
    font: inherit;
    padding: .5rem .65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}
.form input:focus, .form select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
/* The browser's button inside a file input is a small button (rules of button.small below) */
.form input[type=file] { padding: .3rem .4rem; }
input[type=file]::file-selector-button { margin-right: .75rem; }
.form .button { justify-self: start; }
/* The field of a form that stays empty (Guard): out of sight, still in the page for programs. */
.trap { position: absolute; left: -200vw; }

.flash { padding: .7rem 1rem; border-radius: var(--radius); margin: 0 0 1rem; overflow-wrap: anywhere; }
.flash.ok { background: var(--ok-bg); }
.flash.error { background: var(--error-bg); }
ul.flash { padding-left: 2rem; }

hr { border: 0; border-top: 1px solid var(--line); margin: 1.75rem 0 1.25rem; max-width: 28rem; }

/* Components used across pages */
.icon { width: 1.15rem; height: 1.15rem; flex: none; }
.icon-button {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--line);
}
.icon-button:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.icon-button.danger:hover { color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.icon-button.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.icon-button.processed { background: var(--processed); color: var(--on-accent); box-shadow: none; }
span.icon-button { cursor: default; }
.icon-button.bare, .inline-field > .inline-edit > summary { width: 1.6rem; height: 1.6rem; box-shadow: none; }
.icon-button.bare .icon, .inline-field > .inline-edit > summary .icon { width: .95rem; height: .95rem; }
.button .icon { margin: -.15rem .3rem -.15rem -.2rem; vertical-align: middle; }
.small-link { font-size: .85rem; padding: .3rem .4rem; }
.tag { display: inline-block; padding: 0 .4rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: .75rem; white-space: nowrap; }
.small-text { font-size: .85rem; font-weight: 400; }
/* dl.facts: a thing's data as label and value side by side */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts .note { white-space: pre-line; }
/* .filter-bar: the fields of a filter, or of a one-line form, side by side */
/* .list-tools above a list: its search field and, at the right, its actions. */
.filter-bar, .list-tools { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: end; margin-bottom: 1rem; }
.filter-bar label { display: grid; gap: .2rem; font-size: .85rem; color: var(--muted); }
.filter-bar label.check { display: flex; align-items: center; gap: .4rem; padding-bottom: .4rem; color: var(--text); font-size: .95rem; }
.filter-bar select, .filter-bar input[type=date], .list-tools input[type=search] { font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.form.inline { grid-template-columns: minmax(0, 1fr) auto; align-items: end; max-width: 24rem; }
.form.inline input { min-width: 0; }
/* Lists of one line per entry: earlier orders, maintenance windows */
.pizza-history, .maintenance-list { list-style: none; padding: 0; margin: 0; }
.pizza-history li, .maintenance-list li { display: flex; gap: .75rem; align-items: center; padding: .35rem 0; border-bottom: 1px solid var(--line); }
/* Without JavaScript (site.js puts .js on <html>) .js-only elements are hidden; otherwise they keep their own display. */
:root:not(.js) .js-only, .js .no-js-only { display: none; }

/* Profile */
.profile { display: grid; grid-template-columns: 160px 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.avatar img, .avatar .placeholder {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
}
.avatar .placeholder {
    display: grid;
    place-items: center;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 4rem;
    font-weight: 700;
}
.avatar { display: grid; justify-items: center; align-content: start; gap: .25rem; }
.avatar p { margin: .25rem 0 .5rem; }
.avatar-photo { position: relative; }
.avatar-edit { position: absolute; right: .35rem; bottom: .35rem; border-radius: 50%; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.profile-fields { margin: 0 0 1.25rem; }
.profile-fields dt { font-weight: 600; font-size: .95rem; }
.profile-fields dd { margin: .2rem 0 1rem; min-height: 1.6rem; }

/* Admin table */
.data-table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); font-size: .95rem; }
.data-table th, .data-table td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.data-table tr.status-pending td { background: var(--ok-bg); }
.data-table tr.status-disabled td { color: var(--muted); }
.data-table .row-actions form { display: inline-block; margin: 0 .3rem .3rem 0; }
.data-table .number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table .tag { margin-left: .25rem; }
.closing { margin: 1.25rem 0; }
.report th[scope=row] { font-size: inherit; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 400; }
.report .section th { padding-top: 1.1rem; color: var(--muted); }
.report .sum > * { font-weight: 600; }
.report thead small { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; }
.club-log { list-style: none; padding: 0; font-size: .9rem; }
.club-log li { padding: .2rem 0; }
.add-form + form { margin-top: .75rem; }
/* In-place editing: the .read-view gives way to the form of the details.inline-edit right after it while that is
   open; the summary is the pencil, and the cross to cancel. An .inline-field is a value within a line of text, an
   .edit-block a block with the pencil (an .icon-button) at its top right. */
.read-view:has(+ .inline-edit[open]) { display: none; }
.add-form > summary, .inline-edit > summary, .notifications > summary, .paste-edit > summary { list-style: none; cursor: pointer; }
.add-form > summary::-webkit-details-marker, .inline-edit > summary::-webkit-details-marker, .notifications > summary::-webkit-details-marker, .paste-edit > summary::-webkit-details-marker { display: none; }
/* .add-form: a button (the summary) that opens the form for adding something */
.add-form[open] > summary { margin-bottom: .9rem; }
.inline-edit > summary .icon + .icon, .inline-edit[open] > summary .icon:first-child { display: none; }
.inline-edit[open] > summary .icon + .icon { display: block; }
.inline-field { white-space: nowrap; }
.inline-field > .inline-edit { display: inline-block; vertical-align: middle; }
.inline-field > .inline-edit[open] { position: relative; padding-right: 1.6rem; }
.inline-field > .inline-edit[open] > summary { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.inline-field > .inline-edit > form { display: inline-flex; gap: .4rem; align-items: center; }
.edit-block { position: relative; display: flow-root; --pencil-space: 2.75rem; }
.edit-block:has(> .inline-edit) { padding-right: var(--pencil-space); min-height: 2.25rem; }
.edit-block > .inline-edit > summary { position: absolute; top: 0; right: 0; }

/* Drag sorting (sort.js): the handle, or without JavaScript the arrow buttons of sortControls(); the dragged row
   stays as a faded ghost while its copy follows the pointer. */
.sort-controls form { display: inline; }
.drag-handle { cursor: grab; touch-action: none; }
.sort-ghost, .media-card.dragged { opacity: .35; }
/* The copy that follows the pointer, for sorting and for the cards of the Medien tab */
[data-sortable] > .sort-copy, .media-copy { position: fixed; z-index: 20; box-sizing: border-box; margin: 0; pointer-events: none; user-select: none; }
[data-sortable] > .sort-copy { border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 0 .6rem var(--surface), var(--shadow); }

/* Overlays are <dialog>s, opened by buttons with command and commandfor (site.js covers older browsers) and closed by a <form method="dialog">. */
dialog { width: min(28rem, calc(100vw - 2rem)); padding: 1.25rem 1.5rem 1.5rem; border: 0; border-radius: var(--radius); background: var(--bg); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(0 0 0 / .55); }
dialog > form + form { margin-top: 1rem; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.dialog-head h2 { margin: 0; }
.confirm-dialog p { margin: 0; overflow-wrap: anywhere; }
.confirm-dialog .button.danger { background: var(--danger); color: var(--on-danger); box-shadow: none; }
.form.wide { max-width: 46rem; }
button.small, input[type=file]::file-selector-button { padding: .3rem .6rem; font-size: .85rem; background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; }
button.small:hover, input[type=file]::file-selector-button:hover { box-shadow: inset 0 0 0 1px var(--accent); }
button.small.primary { background: var(--accent); color: var(--on-accent); box-shadow: none; }
button.small.danger { color: var(--danger); }

footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.25rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .9rem;
}
footer a { color: var(--muted); }

@media (max-width: 800px) {
    .shell { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
    .sidebar { order: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
    .topbar { flex-wrap: wrap; padding: .5rem .75rem 0; gap: 0; position: relative; }
    .notifications { position: static; }
    .notification-list { left: .75rem; right: .75rem; width: auto; top: 3.1rem; }
    .topbar .logo svg { height: 26px; }
    .topnav {
        order: 3;
        flex: 1 0 100%;
        justify-content: space-between;
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: .35rem -.25rem 0;
        padding-bottom: .25rem;
        border-top: 1px solid rgba(255, 255, 255, .08);
        scrollbar-width: none;
    }
    .topbar .topnav a { padding: .55rem .5rem; font-size: .92rem; white-space: nowrap; }
    .topbar .topnav a.active { box-shadow: inset 0 -2px 0 var(--bar-accent); border-radius: 0; }
    .account { gap: 0; }
    .topbar .account a, .topbar .account button.link { padding: .45rem .5rem; font-size: .92rem; }
    .hero { padding: 1.5rem; }
    .hero h1 { font-size: 1.7rem; }
    .profile { grid-template-columns: 1fr; }
    .data-table { display: block; overflow-x: auto; }
    .finance-inputs { display: block; overflow-x: auto; }
    .finance-inputs td { min-width: 6rem; }
    .finance-inputs td:nth-child(2) { min-width: 9rem; }
}

/* Calendar */
.month { margin-top: 1.5rem; font-size: 1.1rem; color: var(--muted); }
.events-list { list-style: none; margin: 0; padding: 0; }
.event {
    display: grid;
    grid-template-columns: 9rem 7rem 1fr;
    gap: .25rem 1rem;
    padding: .6rem .9rem;
    margin-bottom: .4rem;
    background: var(--surface);
    border-radius: var(--radius);
    border-left: 4px solid var(--line);
    box-shadow: var(--shadow);
}
.event.stammtisch { border-left-color: #65b32e; }
.event.fixme { border-left-color: #94c11f; }
.event .location { grid-column: 3; color: var(--muted); font-size: .9rem; }
.event .summary { font-weight: 600; }
.event .time { color: var(--muted); }
.event.no-location { opacity: .55; box-shadow: none; background: transparent; border-left-style: dashed; }
.more { margin-top: 1.25rem; }
#weitere { scroll-margin-top: 1rem; }
.subscribe { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
@media (max-width: 800px) {
    .event { grid-template-columns: 1fr 1fr; }
    .event .summary, .event .location { grid-column: 1 / -1; }
}

/* Pizza */
.pizza-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1rem; }
.pizza-head h1 { margin: 0; }
.pizza-status { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.pizza-status.locked { color: var(--warning); }
.pizza-status .icon { width: 1.1em; height: 1.1em; }
.pizza-admin { display: inline-flex; gap: .3rem; margin-left: auto; }
.pizza-admin form, .pizza-list .row-actions form { display: contents; }
.pizza-list { width: 100%; border-collapse: collapse; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); margin-bottom: 1.25rem; }
.pizza-list td { padding: .45rem .5rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.pizza-list tr.person td { border-top: 1px solid var(--line); border-bottom: 0; }
.pizza-list tr.person:first-child td { border-top: 0; }
.pizza-list tr.line td { border: 0; padding-top: 0; }
.pizza-list .paid-toggle { width: 1%; padding-right: 0; }
.pizza-list .name { font-weight: 700; white-space: nowrap; }
.pizza-list .item .muted { font-size: .9rem; }
.pizza-list .note { font-style: italic; font-size: .9rem; }
.pizza-list .price { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.pizza-list .owed { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); }
.pizza-list .row-actions { white-space: nowrap; text-align: right; width: 1%; }
.pizza-list .row-actions .icon-button { margin-left: .15rem; vertical-align: middle; }
.pizza-list .icon-button { width: 2rem; height: 2rem; }
.pizza-list tr.line .paid-toggle .icon-button { width: 1.4rem; height: 1.4rem; margin-left: .3rem; }
.pizza-list tr.line .paid-toggle .icon { width: .9rem; height: .9rem; }
.pizza-list tr.paid td:not(.paid-toggle):not(.row-actions) { color: var(--muted); }
.pizza-list tfoot td { border-top: 2px solid var(--line); border-bottom: 0; font-weight: 700; }
@media (max-width: 600px) {
    .pizza-list, .pizza-list tbody, .pizza-list tfoot { display: block; }
    .pizza-list tr { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; align-items: center; column-gap: .4rem; padding: .35rem .6rem; }
    .pizza-list tr.person { grid-template-areas: "paid name price" "paid item actions"; border-top: 1px solid var(--line); }
    .pizza-list tr.person:first-child { border-top: 0; }
    .pizza-list tr.line { grid-template-areas: "paid item actions"; padding-top: 0; }
    .pizza-list td, .pizza-list tr.person td { padding: 0; border: 0; }
    .pizza-list td:empty { display: none; }
    .pizza-list .paid-toggle { grid-area: paid; }
    .pizza-list .name { grid-area: name; overflow: hidden; text-overflow: ellipsis; }
    .pizza-list .item { grid-area: item; }
    .pizza-list .price { grid-area: price; }
    .pizza-list .row-actions { grid-area: actions; width: auto; }
    .pizza-list td[colspan="5"] { grid-column: 1 / -1; }
    .pizza-list tfoot tr { grid-template-areas: ". total price"; border-top: 2px solid var(--line); padding-top: .6rem; padding-bottom: .6rem; }
    .pizza-list tfoot td { border: 0; padding: 0; }
    .pizza-list tfoot td[colspan] { grid-area: total; }
    .pizza-list tfoot .price { grid-area: price; }
}
.pizza-add .form.inline { max-width: 22rem; }
.pizza-history .order-line { flex: 1; min-width: 0; }
.pizza-history .price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pizza-categories { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: 1rem; }
.pizza-categories a { font-size: .85rem; padding: .25rem .6rem; background: var(--surface); border-radius: 999px; text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); }
.pizza-items { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .4rem; }
.item-link { display: grid; grid-template-columns: 1fr auto; gap: .1rem .75rem; padding: .6rem .9rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.item-link:hover { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); color: var(--text); }
.item-title { font-weight: 600; }
.item-price { white-space: nowrap; color: var(--accent-text); font-weight: 600; }
.item-desc { grid-column: 1 / -1; font-size: .9rem; color: var(--muted); }
.pizza-item { max-width: 40rem; }
.pizza-item fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem 1rem .75rem; display: grid; gap: .2rem; }
.pizza-item legend { font-weight: 600; padding: 0 .3rem; }
.pizza-item label.check { display: flex; gap: .45rem; align-items: baseline; font-weight: 400; }
.pizza-item label.check input { margin: 0; align-self: center; }
.pizza-total {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: .5rem;
    padding: .75rem 1rem;
    background: var(--surface);
    border-top: 2px solid var(--accent);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
}
.pizza-total .amount { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.pizza-item .check.disabled { opacity: .45; }
.pizza-item .counter { font-variant-numeric: tabular-nums; }
.pizza-item fieldset.flash-prices .choice-price { color: var(--accent-text); transition: color .4s; }
.menu-filter input {
    width: 100%;
    max-width: 28rem;
    font: inherit;
    font-size: 1.05rem;
    padding: .6rem .8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}
.menu-filter input:focus, .list-tools input[type=search]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* Pizza: the note above the list */
.pizza-note > :first-child { margin-top: 0; }
.pizza-note > :last-child { margin-bottom: 0; }
.pizza-note-block { margin: -.25rem 0 1rem; }
.pizza-note-block:has(> .pizza-note:empty:last-child) { display: none; }
.pizza-note-edit .form { max-width: 40rem; }

/* OAuth consent and connected apps */
.consent { max-width: 36rem; padding: 1.5rem 1.75rem; }
.consent ul { margin: 0 0 1rem; }
.mcp-url { display: inline-block; padding: .4rem .7rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); word-break: break-all; user-select: all; }
.form + h2, .add-form + h2, .edit-block + h2, .filter-bar + h2, .actions + h2 { margin-top: 2.5rem; }
.data-table label.check { display: inline-flex; align-items: center; gap: .3rem; margin-right: .75rem; }
.form + h3 { margin-top: 1.75rem; }
@media (max-width: 360px) {
    .topbar .topnav a { padding: .55rem .22rem; font-size: .84rem; }
}

/* Admin */
/* Tabs (admin, profile): the section named in the URL fragment is shown, the first one when there is none.
   The large scroll margin keeps the page at the top, with flash messages and tabs in view. */
/* The tabs stay on one line; where they do not fit, the bar scrolls sideways. */
.tab-bar { display: flex; gap: 0 .25rem; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
/* A tab of several short parts, such as Einstellungen */
.settings > h2:not(:first-of-type) { margin-top: 2.5rem; }
.tab-bar a { padding: .5rem .8rem; white-space: nowrap; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-bar a:hover { color: var(--text); }
.tab-bar a[aria-current] { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .tab-panel { display: none; }
.tabs .tab-panel:target,
.tabs:not(:has(.tab-panel:target)) .tab-panel:first-of-type { display: block; }
.tab-panel { margin-bottom: 2.5rem; scroll-margin-top: 100vh; }
.tab-panel h2 { display: flex; align-items: baseline; gap: .75rem; }
.tab-panel .form + .form { margin-top: .75rem; }
.guest-name { margin-bottom: 1.25rem; }
.pizza-history { margin-bottom: 1.5rem; }
.pizza-list tr { scroll-margin-top: 1rem; }

/* Pages */
.page-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.edit-corner { position: absolute; top: .75rem; right: .75rem; background: var(--surface); }
.topbar .topnav a.nav-add { display: inline-flex; align-items: center; padding: .45rem .55rem; }
.page-body { max-width: 46rem; }
.content h2 { margin-top: 1.75rem; }
.content h3, .content h4 { margin-top: 1.25rem; }
.content ul, .content ol { padding-left: 1.3rem; }
.content li + li { margin-top: .25rem; }
.content blockquote { margin: 1rem 0; padding: .25rem 1rem; border-left: 3px solid var(--accent); color: var(--muted); }
.content pre, pre.paste-text { overflow-x: auto; padding: .75rem 1rem; background: var(--surface); border-radius: var(--radius); font-size: .9rem; }
.content code { font-size: .92em; }
.content img { border-radius: var(--radius); border: 1px solid var(--line); }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.termin a { font-weight: 600; }
.termin .muted, .termine .muted { display: block; font-size: .9rem; }
.termine, .content .termine { list-style: none; padding-left: 0; }
.termine li + li { margin-top: .5rem; }
.form.editor { max-width: 46rem; }
.form textarea {
    font: .92rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
    padding: .6rem .7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    resize: vertical;
    width: 100%;
}
.form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.editor-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; align-items: end; }
.slug-field { display: flex; align-items: center; gap: .2rem; font-weight: 400; }
.slug-field input { flex: 1; min-width: 0; }
.editor legend { font-weight: 600; padding: 0 .3rem; }
.syntax summary, .insert-files summary, .role-link summary, .fold > summary { cursor: pointer; color: var(--accent-text); font-size: .9rem; }
/* details.fold folds text away behind a link-like summary. .api is the line a page shows for scripts (apiToken()):
   the token, a button to copy it, the button for a new one and the link to the help */
.fold { margin-bottom: 1rem; }
.api { margin-top: 1.5rem; max-width: 46rem; }
.copy-line { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.syntax table { margin-top: .5rem; border-collapse: collapse; font-size: .9rem; }
.syntax td { padding: .25rem .75rem .25rem 0; vertical-align: top; }
.preview { border: 2px dashed var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.type-choice { display: flex; gap: 1.5rem; }
.preview-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .75rem; }
.delete-page { margin-top: 2rem; }
.button.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 2px var(--danger); }
.button.danger:hover { background: var(--danger); color: var(--on-danger); }
@media (max-width: 600px) {
    .editor-row { grid-template-columns: 1fr; }
}

/* Files on the Medien tab: folders and files as cards of handle, thumbnail, text and buttons. media.js drags them
   onto folder cards; a selected card is outlined, the folder under the pointer lights up, the dragged cards fade while
   a copy follows the pointer. */
.folder-path { display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
.form.upload-panel { max-width: none; padding: 1rem 1.25rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.upload-panel input[type=file] { background: var(--bg); }
.upload-panel p { grid-column: 1 / -1; margin: 0; }
.upload-panel + .add-form { margin-top: 2.25rem; }
.file-list { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .5rem; }
.file-list + p { margin-top: .75rem; }
.media-card { display: grid; grid-template-columns: 1.6rem 4.5rem minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .5rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-grip { grid-column: 1; }
.media-card > .file-thumb { grid-column: 2; }
.media-card > .file-info { grid-column: 3; }
.card-actions { grid-column: 4; display: flex; gap: .4rem; align-items: center; }
.media-card.selected { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.media-card.selected .drag-handle { color: var(--accent); }
.media-card.drop-over { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.media-copy { width: min(20rem, 80vw); opacity: .95; box-shadow: 0 .5rem 1.5rem rgb(0 0 0 / .25); }
.media-copy :is(.card-actions, .snippet, .muted, .inline-edit) { display: none; }
.media-copy[data-count]::after { content: attr(data-count); position: absolute; top: -.5rem; right: -.5rem; min-width: 1.5rem; padding: .1rem .35rem; border-radius: 1rem; background: var(--accent); color: var(--on-accent); font-weight: 700; text-align: center; box-sizing: border-box; }
.media-empty { padding: .5rem 0; }
.file-thumb { display: grid; place-items: center; width: 4.5rem; height: 3rem; border-radius: calc(var(--radius) - 2px); background: var(--bg); overflow: hidden; text-decoration: none; font-size: .75rem; font-weight: 700; color: var(--muted); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.folder-card .file-thumb { color: var(--accent); }
.folder-card .file-thumb .icon { width: 1.6rem; height: 1.6rem; }
.file-info { display: grid; gap: .1rem; min-width: 0; }
.file-info > a, .file-info .read-view { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info .muted { font-size: .85rem; }
.snippet { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.move-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }
.move-form select { max-width: 100%; }
.insert-files ul { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .35rem; }
.insert-files li { display: flex; gap: .5rem; align-items: center; min-width: 0; }
.insert-files code { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-picker { display: flex; flex-wrap: wrap; gap: .5rem; }
.image-picker label { position: relative; cursor: pointer; }
.image-picker input { position: absolute; opacity: 0; }
.image-picker img, .image-picker .none { display: grid; place-items: center; width: 7.5rem; height: 3.1rem; object-fit: cover; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); background: var(--bg); font-size: .8rem; font-weight: 400; color: var(--muted); }
.image-picker input:checked + img, .image-picker input:checked + .none { outline: 3px solid var(--accent); outline-offset: 2px; }
.image-picker input:focus-visible + img, .image-picker input:focus-visible + .none { outline: 3px solid var(--accent-dark); outline-offset: 2px; }

/* Mailing list */
.mail-threads, .content .mail-threads { list-style: none; padding-left: 0; }
.mail-threads li + li { margin-top: .6rem; }
.mail-threads a { font-weight: 600; }
.mail-threads .muted { display: block; font-size: .85rem; }
.events .card:not(:has(> a > img)) { grid-column: 1 / -1; }

/* Light/dark switch: the icon shows the mode a click switches to */
.theme-toggle { display: flex; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.topbar .theme-toggle button { display: inline-grid; place-items: center; padding: .45rem .5rem; }

/* Status page */
.status-summary { font-weight: 600; }
.status-group { margin-top: 2rem; }
.status-group h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.status-service { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.status-service header { display: flex; align-items: center; gap: .6rem; }
.status-service h3 { margin: 0; font-size: 1.1rem; min-width: 0; overflow-wrap: anywhere; }
.status-service p { margin: .4rem 0 0; }
.state-dot { width: .7rem; height: .7rem; border-radius: 50%; flex: none; background: var(--nodata); }
.state-dot.up { background: var(--accent); }
.state-dot.down { background: var(--danger); }
.state-dot.maintenance { background: var(--processed); }
.state-label { margin-left: auto; font-size: .9rem; font-weight: 600; white-space: nowrap; color: var(--muted); }
.state-label.up { color: var(--accent-text); }
.state-label.down { color: var(--danger); }
.state-label.maintenance { color: var(--processed); }
.status-error { color: var(--danger); font-size: .9rem; }
.status-maintenance { display: flex; gap: .4rem; align-items: center; color: var(--processed); font-size: .9rem; }
.uptime-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; margin-top: .9rem; }
.uptime-strip.slots { gap: 1px; height: 1rem; }
.uptime-strip.days { height: 2rem; }
.uptime-strip span { border-radius: 1px; background: var(--nodata); }
.uptime-strip .up { background: var(--accent); }
.uptime-strip .degraded { background: var(--warning); }
.uptime-strip .down { background: var(--danger); }
.uptime-strip .maintenance { background: var(--processed); }
.strip-scale { display: flex; justify-content: space-between; gap: .5rem; margin-top: .25rem; font-size: .8rem; color: var(--muted); }
.status-service .cert { font-size: .85rem; color: var(--muted); }
.status-service .cert.warn { color: var(--warning); font-weight: 600; }
.service-form:not(:has(input[name="probe"][value="http"]:checked)) .probe-http,
.service-form:not(:has(input[name="probe"][value="tcp"]:checked)) .probe-tcp,
.service-form:not(:has(input[name="probe"][value="ping"]:checked)) .probe-ping,
.service-form:not(:has(input[name="probe"][value="dns"]:checked)) .probe-dns { display: none; }
.maintenance-list { max-width: 28rem; }
.maintenance-list li { justify-content: space-between; }

/* Pastebin */
.pastes { margin-bottom: 2.5rem; }
.paste-facts { max-width: 28rem; padding: .75rem 1rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
/* Editing a text on its page: the button Bearbeiten opens the editor in place of the text, in the row of buttons */
.paste-text:has(~ .actions > .paste-edit[open]) { display: none; }
/* Open, the editor takes the whole row and its own buttons replace Bearbeiten; Abbrechen reloads the page. */
.paste-edit[open] { flex-basis: 100%; }
.paste-edit[open] > summary { display: none; }
.actions:has(> .paste-edit[open]) > a { display: none; }
.paste-edit .form { max-width: none; }
.paste-edit .actions { margin-top: 0; }
.paste-image { display: block; max-width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.pastes td:nth-child(2) { white-space: nowrap; }

/* Mitgliederversammlung */
.meeting h1 { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.meeting h1 .tag { font-size: .8rem; font-weight: 400; }
.meeting-deadlines { font-size: .9rem; }
.meeting-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: start; margin: 1rem 0; }
.meeting-agenda, .meeting-item { margin: 2rem 0; scroll-margin-top: 1rem; }
.agenda { padding-left: 0; list-style: none; }
.agenda li { padding: .15rem 0; }
.agenda a { color: var(--text); text-decoration: none; }
.agenda a:hover { color: var(--accent-text); }
.item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .75rem; border-bottom: 1px solid var(--line); margin-bottom: .6rem; }
.item-head h2 { margin: 0 0 .3rem; }
.item-head > :not(h2) { margin-left: auto; }
.item-head .row-actions { display: flex; gap: .2rem; }
.item-head .row-actions form { display: contents; }
.item-body > :first-child { margin-top: 0; }
.vote-fields { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.vote-fields input, .vote-fields select, .finance-inputs select {
    font: inherit;
    padding: .35rem .5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}
.vote-fields input { flex: 1 1 12rem; min-width: 0; }
.meeting-add { margin-top: 2rem; }
.meeting-control { margin: 1.5rem 0; padding: 1rem 1.25rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.meeting-control h2 { margin-bottom: .5rem; }
.control-actions, .current-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: start; }
.control-actions { margin: .75rem 0 1rem; }
.current-actions { margin: 1rem 0 0; padding-top: .75rem; border-top: 1px dashed var(--line); }
.current-actions details[open] { flex-basis: 100%; order: 1; }
.meeting-add summary .icon, .current-actions .icon { width: 1rem; height: 1rem; }
.add-dialog h3 { margin: 1.25rem 0 .5rem; font-size: 1rem; }
.add-dialog .dialog-head + h3 { margin-top: 0; }
.add-dialog .vote-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.add-dialog .vote-fields :is(input, p) { grid-column: 1 / -1; margin: 0; }
.add-dialog .vote-fields button { justify-self: start; }
.meeting-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem 1.5rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.meeting-role h3 { font-size: 1rem; margin: 0 0 .3rem; }
.meeting-role p { margin: 0 0 .4rem; }
.role-link { margin-bottom: .6rem; }
.copy-field { display: flex; gap: .4rem; margin: .5rem 0 .3rem; }
.copy-field input { flex: 1; min-width: 0; font: .85rem ui-monospace, SFMono-Regular, Menlo, monospace; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--text); }
.inline-form { display: inline-block; margin: 0 .3rem .3rem 0; }
.attendance-form { margin-bottom: .75rem; }
.meeting-attendance p { margin: .3rem 0; }
.protocol-text textarea, .attendance-form textarea { font: inherit; line-height: 1.5; }
.protocol-text textarea { field-sizing: content; min-height: 6rem; max-height: 70vh; }
.save-line { display: flex; align-items: center; gap: .6rem; }
.save-state { font-size: .85rem; color: var(--muted); }
.conflict { margin-bottom: .6rem; padding: .6rem .8rem; border-left: 3px solid var(--warning); background: var(--surface); }
.conflict pre { white-space: pre-wrap; font-size: .85rem; max-height: 12rem; overflow: auto; }
.meeting-item.current .item-head { border-bottom-color: var(--accent); border-bottom-width: 2px; }
.current-tag, .meeting h1 .status-running { color: var(--on-accent); background: var(--accent); box-shadow: none; }
.current-tag { vertical-align: middle; }
.meeting-item.not-called { opacity: .55; }
.agenda li.current a { color: var(--accent-text); font-weight: 600; }
.votes { display: grid; gap: .6rem; margin: .75rem 0; }
.vote-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.vote-controls { margin-left: auto; display: flex; gap: .3rem; }
.vote-controls form { display: contents; }
.vote:not(.vote-planned) { padding: .75rem 1rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.vote-open { box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
.vote-requirement { font-size: .85rem; color: var(--muted); margin: .4rem 0; }
.vote-conduct { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin: .5rem 0; font-size: .9rem; }
.vote-conduct label { display: flex; align-items: center; gap: .4rem; }
.vote-conduct input[type=number], .vote-table input { width: 4.5rem; font: inherit; padding: .25rem .4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--text); }
.vote-table { border-collapse: collapse; width: 100%; max-width: 40rem; font-size: .95rem; }
.vote-table th, .vote-table td { padding: .35rem .5rem; border-bottom: 1px solid var(--line); text-align: right; }
.vote-table th:first-child, .vote-table td:first-child { text-align: left; }
.vote-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.vote-table td form { display: inline-flex; gap: .4rem; align-items: center; margin-left: .5rem; }
.vote-table td .save-state { font-size: .75rem; }
.vote-table tr.winner td { font-weight: 700; }
.vote-table .row-actions form { display: inline-block; }
.vote-result { margin: .5rem 0 0; }
.vote-warning { color: var(--warning); font-size: .9rem; margin: .3rem 0; }
.vote-answer { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .5rem; }
.vote-answer form { display: contents; }
.vote-finish { margin-top: .75rem; }
.vote .vote-fields { margin-top: .5rem; }
.js .vote-table form[data-autosave] button, .js .vote-conduct button { display: none; }
.protocol-final { margin: .5rem 0 1rem; }
.protocol-final .button .icon { width: 1.1rem; height: 1.1rem; }
.protocol-final code { word-break: break-all; }
.change { margin: 1.5rem 0; }
.change h2 { font-size: 1.05rem; margin-bottom: .2rem; }
.diff { white-space: pre-wrap; padding: .75rem 1rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); line-height: 1.5; }
.diff del { color: var(--danger); background: var(--error-bg); }
.diff ins { text-decoration: none; background: var(--ok-bg); }
.meeting-delete summary { cursor: pointer; color: var(--danger); font-size: .9rem; }
.meeting-delete[open] form { margin-top: .4rem; }
.name-picker { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.name-picker button[disabled] { opacity: .45; cursor: default; }
.presentation-toggle { float: right; margin-left: 1rem; }
.presentation .topbar, .presentation .sidebar, .presentation > footer { display: none; }
.presentation .shell { grid-template-columns: minmax(0, 1fr); max-width: none; padding: 1rem 2.5rem; }
.presentation main { font-size: 1.15rem; }
.finance { margin: .75rem 0; --table-width: 40rem; max-width: calc(var(--table-width) + var(--pencil-space)); }
.finance:has(> .inline-edit[open]) { max-width: none; }
.finance-table { border-collapse: collapse; width: 100%; max-width: var(--table-width, 40rem); font-size: .95rem; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); }
.finance-table th, .finance-table td { padding: .3rem .6rem; text-align: right; border-bottom: 1px solid var(--line); }
.finance-table .label { text-align: left; }
.finance-table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.finance-table .finance-flow th { padding-top: .6rem; font-weight: 600; }
.finance-table .finance-sum td { color: var(--muted); font-style: italic; }
.finance-table .finance-result td, .finance-table .finance-balance td { font-weight: 700; }
.finance-note { margin-top: .5rem; }
.finance-inputs { border-collapse: collapse; width: 100%; }
.finance-inputs th { font-size: .75rem; color: var(--muted); text-align: left; font-weight: 600; padding: 0 .3rem .2rem 0; }
.finance-inputs td { padding: .15rem .3rem .15rem 0; }
.finance-inputs input, .finance-inputs select { width: 100%; }
.finance-inputs select { min-width: 7.5rem; }

/* Admin lists: rows on a card, one line each, edited in place (menu entries, announcements) */
.entry-list { list-style: none; padding: .15rem 1rem; margin: 0 0 1rem; max-width: 46rem; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); }
.entry-list > li { padding: .45rem 0; }
.entry-list > li + li { border-top: 1px solid var(--line); }
#menue h3, #adressen h3 { margin-top: 2.25rem; }
.addresses { max-width: 46rem; }
.addresses td { vertical-align: middle; overflow-wrap: anywhere; }
.entry-list .read-view { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; }
.entry-list .read-view .target { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.entry-list .read-view img { width: 5rem; height: 2.1rem; object-fit: cover; border-radius: var(--radius); }
.entry-list .read-view > form { margin-left: auto; }
.entry-list > .edit-block > .inline-edit > summary { top: .45rem; }
.menu-section-head { display: flex; align-items: center; gap: .25rem; margin: 1.25rem 0 .5rem; }
.menu-section-head h4 { display: inline; margin: 0; }
.entry-list .inline-edit[open] { padding: .5rem 0; }

/* Chip field (chips.js): the chosen options of a [data-chips] group or select as chips around a search field. The
   options themselves show only without it. A select that takes one value is one line with at most one chip. */
.chip-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .25rem 1rem; max-height: 16rem; overflow-y: auto; }
.chip-options[hidden] { display: none; }
.chip-field { position: relative; color: var(--text); font-size: 1rem; font-weight: 400; }
.chip-box { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; max-height: 12rem; overflow-y: auto; padding: .4rem .4rem 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: text; }
.chip-box:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
/* The search field is the last line and stays in view when the chips above it scroll. */
.chip-box input, .form .chip-box input { flex: 1 0 100%; position: sticky; bottom: 0; min-width: 0; padding: .25rem .25rem .55rem; border: 0; border-radius: 0; outline: 0; background: var(--surface); color: var(--text); font: inherit; box-shadow: 0 -.45rem .4rem -.1rem var(--surface); }
.chip-field.single { min-width: 11rem; }
.chip-field.single .chip-box { flex-wrap: nowrap; padding: .28rem .4rem; }
.chip-field.single .chip-box input { flex: 1 1 4rem; position: static; width: 4rem; padding: .2rem .25rem; box-shadow: none; }
.filter-bar .chip-field { max-width: 17rem; }
.chip-field.single .chip { flex: 0 1 auto; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: .1rem; max-width: 100%; padding: .1rem .15rem .1rem .65rem; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font-size: .9rem; cursor: pointer; }
.chip:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.flagged { box-shadow: inset 0 0 0 1px var(--warning); }
.chip.flagged::before { content: "!"; margin-right: .3rem; color: var(--warning); font-weight: 700; }
.chip button { display: grid; place-items: center; flex: none; width: 1.3rem; height: 1.3rem; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); font: inherit; line-height: 1; cursor: pointer; }
.chip button:hover { background: var(--line); color: var(--text); }
.suggestions { position: absolute; z-index: 15; inset: calc(100% + .3rem) 0 auto; max-height: 17rem; overflow-y: auto; margin: 0; padding: .3rem; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.suggestions li { position: relative; display: flex; justify-content: space-between; gap: 1rem; padding: .35rem .6rem .35rem 1.7rem; border-radius: 4px; cursor: pointer; }
.suggestions li.active { background: var(--ok-bg); }
.suggestions li[aria-selected=true]::before { content: "✓"; position: absolute; left: .55rem; color: var(--accent-text); }
.suggestions small { color: var(--muted); white-space: nowrap; }
.suggestions .none { color: var(--muted); cursor: default; }
.chip-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.chip-actions .icon { width: .9rem; height: .9rem; margin: -.15rem .2rem -.15rem -.1rem; vertical-align: middle; }
.chip-actions .count { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Palette: buttons that put a placeholder into a text (data-insert). A group that cannot be used is disabled and says
   why. */
.palette { display: grid; gap: .3rem; }
.palette fieldset { display: grid; grid-template-columns: 5rem minmax(0, 1fr); align-items: baseline; min-width: 0; margin: 0; padding: 0; border: 0; }
.palette fieldset > div { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.palette-group { color: var(--muted); font-size: .8rem; }
.token { padding: .1rem .45rem; border: 0; border-radius: 4px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font: .8rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; }
.token:hover:enabled { box-shadow: inset 0 0 0 1px var(--accent); }
.token:disabled { opacity: .5; cursor: default; }
.palette .reason { color: var(--muted); font-size: .8rem; }
.palette fieldset:not(:disabled) .reason { display: none; }

/* Pager (site.js): one [data-page] at a time, with buttons to move on; one page alone needs none. */
.pager-bar { display: flex; align-items: center; gap: .25rem; margin-bottom: .5rem; }
.pager-bar [data-pager-status] { min-width: 4.5rem; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; text-align: center; }
.pager-bar button:disabled { opacity: .35; cursor: default; box-shadow: none; }
.pager:not(:has([data-page] ~ [data-page])) .pager-bar { display: none; }

/* A mail as plain text under its header lines: the Probelauf of a Rundmail and the Versandprotokoll. */
.mail { margin-bottom: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.mail-head { gap: .1rem .9rem; margin: 0; padding: .7rem 1rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.mail pre { margin: 0; padding: .9rem 1rem; white-space: pre-wrap; overflow-wrap: anywhere; font: .88rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.mail > summary { padding: .6rem 1rem; cursor: pointer; overflow-wrap: anywhere; }
.mail[open] > summary { border-bottom: 1px solid var(--line); }
.error-text { color: var(--danger); }

/* Rundmail: the form beside its Probelauf on a wide screen, where the Probelauf stays in view and its button to send
   at its lower edge. */
.shell:has(.composer) { max-width: 1480px; }
.composer { display: grid; gap: 2rem; align-items: start; }
.recipients, .form .field { display: grid; gap: .4rem; }
.field-head { display: flex; align-items: center; gap: .5rem; font-size: .95rem; }
.field-head .link { margin-left: auto; padding: 0; color: var(--accent-text); font-size: .85rem; }
.probe-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.probe-head h2 { margin: 0; }
.probe[aria-busy=true] { opacity: .55; transition: opacity .15s .25s; }
.probe .problems { padding-left: 2.2rem; }
@media (min-width: 1250px) {
    .composer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .composer .form.editor { max-width: none; }
    .probe { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
    .probe .actions { position: sticky; bottom: 0; margin: 0; padding: .75rem 0 .25rem; background: var(--bg); }
}

/* Stat tiles: the key figures of a page, each a label over its value; a small adds a remark. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .75rem; margin: 0 0 1.25rem; }
.stats > div { padding: .7rem 1rem .8rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.stats dt { color: var(--muted); font-size: .8rem; }
.stats dd { margin: 0; font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stats small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }

/* A tag that says how something stands: settled, waiting for something, or more than asked. */
.tag.ok { background: var(--ok-bg); box-shadow: none; color: var(--text); }
.tag.warn { box-shadow: inset 0 0 0 1px var(--warning); color: var(--text); }
.tag.info { box-shadow: inset 0 0 0 1px var(--processed); color: var(--text); }

.list-tools .actions { margin: 0 0 0 auto; }
.list-tools input[type=search] { width: 14rem; max-width: 100%; }
dialog.wide { width: min(46rem, calc(100vw - 2rem)); }
.amount-out { color: var(--danger); }

/* A panel holds one part of a page that is about one thing; .detail puts a narrow column of them beside a wide one. */
.panel { position: relative; margin-bottom: 1.25rem; padding: 1rem 1.25rem 1.1rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel > h2 { font-size: 1.05rem; }
.panel > :last-child { margin-bottom: 0; }
.panel-tools { position: absolute; top: .6rem; right: .6rem; }
.detail { display: grid; gap: 0 1.5rem; align-items: start; }
.detail h2 { margin-top: 0; }
.detail .data-table { margin-bottom: 1.5rem; }
.detail .row-actions { white-space: nowrap; text-align: right; }
.shell:has(.detail) { max-width: 1480px; }
@media (min-width: 1250px) {
    .detail { grid-template-columns: minmax(0, 21rem) minmax(0, 1fr); }
}
.page-head .tag { font-size: .8rem; }
.data-table .inline-field input { width: 5.5rem; padding: .25rem .4rem; text-align: right; }
