:root {
    --fg: #1a1a1a; --muted: #777; --line: #e5e5e5; --bg: #fff; --accent: #b3261e; --soft: #f6f6f6;
    --ok: #1e6b34; --ok-bg: #eef7f0;
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root { --fg: #e8e8e8; --muted: #999; --line: #333; --bg: #161616; --accent: #ff8a80; --soft: #222; --ok: #8fd19e; --ok-bg: #1c2b20; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 system-ui, -apple-system, sans-serif; }
main { max-width: 42rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
a { color: inherit; }
h1 { font-size: 1.5rem; margin: .5rem 0 1rem; display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.pre { white-space: pre-line; }
.action { font-size: 1rem; font-weight: normal; }


.flash { padding: .5rem .75rem; background: var(--soft); border-radius: 4px; }
.errors { color: var(--accent); padding-left: 1.2rem; }

form.inline, .inline { display: inline; }
form.narrow { max-width: 22rem; }
label { display: block; margin: 0 0 .9rem; }
label.check { display: flex; gap: .5rem; align-items: center; }
input:where(:not([type=checkbox]):not([type=file])), textarea {
    display: block; width: 100%; margin-top: .2rem; padding: .45rem .55rem; font: inherit;
    color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 4px;
}
.row input { display: inline-block; width: 8rem; margin: 0; }
textarea { resize: vertical; }
button { font: inherit; padding: .4rem .9rem; border: 1px solid var(--fg); background: var(--fg); color: var(--bg); border-radius: 4px; cursor: pointer; }
button.link { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; cursor: pointer; }
.danger { color: var(--accent) !important; }
.like { text-decoration: none !important; font-size: 1.1rem; }
.like.on { color: var(--accent); }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

ul.list, ul.plain { list-style: none; padding: 0; margin: 0; }
ul.list li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
ul.list li a { text-decoration: none; }
ul.list li a:hover { text-decoration: underline; }
li.gift { display: flex; gap: .75rem; align-items: center; }
.thumb { flex: 0 0 3rem; height: 3rem; background: var(--soft); border-radius: 4px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
img.hero { max-width: 100%; max-height: 20rem; display: block; margin: 0 0 1rem; border-radius: 4px; }
#image-preview img { max-height: 8rem; display: block; margin-bottom: .5rem; border-radius: 4px; }
.comment { margin-bottom: 1rem; }
.comment p { margin: .2rem 0 0; }
#kommentare textarea { margin-bottom: .5rem; }

/* Navigation: alles links, auf schmalen Screens horizontal scrollbar statt Umbruch */
nav { display: flex; gap: .25rem 1rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line);
      font-size: .9rem; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav a, nav button.link { text-decoration: none; color: var(--muted); padding: .25rem 0; }
nav a.on, nav a:hover, nav button.link:hover { color: var(--fg); }
nav a.on { box-shadow: inset 0 -2px 0 var(--fg); }
nav .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 .25rem; flex: none; }

/* Übersicht */
.event-select { margin-bottom: 1.5rem; }
.event-select .spacer { flex: 1; }
select { font: inherit; padding: .35rem .5rem; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; }
details.person { border-top: 2px solid var(--fg); padding: .5rem 0 .25rem; margin-bottom: 1rem; }
details.person > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }
details.person > summary::-webkit-details-marker { display: none; }
details.person > summary .name { font-weight: 600; font-size: 1.1rem; }
details.person:not([open]) { opacity: .7; }
.badge { font-size: .8rem; padding: .05rem .45rem; border-radius: 999px; background: var(--soft); }
.badge.done { background: var(--ok-bg); color: var(--ok); }
.over { color: var(--accent); }
li.gift.bought { background: var(--ok-bg); padding-left: .5rem; padding-right: .5rem; border-radius: 4px; border-bottom-color: transparent; margin-bottom: 2px; }
.grow { flex: 1; min-width: 0; }

/* Detail */
table.shares { border-collapse: collapse; margin: .5rem 0; font-size: .9rem; }
table.shares td { padding: .15rem 1.25rem .15rem 0; }
table.shares .num { text-align: right; }
table.shares tr.sum td { border-top: 1px solid var(--line); color: var(--muted); }
.actions { display: grid; gap: .6rem; margin: 1rem 0; }
.row input.wide { width: 16rem; }
button.secondary { background: none; color: var(--fg); }
details > summary { cursor: pointer; }
fieldset { border: 1px solid var(--line); border-radius: 4px; margin: 0 0 1rem; }
label.inline-field { display: flex; align-items: center; gap: .5rem; }
label.inline-field input { width: 7rem !important; margin-left: auto !important; display: inline-block !important; }
input[type=range] { width: 100%; display: block; }
