/* Bandenplan – Web-Oberflaeche. Eigenes CSS, keine Fremdressourcen. */
:root {
  --bg: #f7f6fb;
  --surface: #ffffff;
  --surface-2: #efeef7;
  --text: #211f4c;
  --muted: #646387;
  --line: #e2e1ee;
  --accent: #4b47d6;
  --accent-text: #ffffff;
  --accent-soft: #e8e7fb;
  --danger: #b3261e;
  --warn: #9a5b00;
  --warn-soft: #fbefd9;
  --mine: #e5e4fa;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 2px 8px rgba(0, 0, 0, .04);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14132a;
    --surface: #1c1b37;
    --surface-2: #252445;
    --text: #ecebf7;
    --muted: #a3a2c0;
    --line: #33325a;
    --accent: #9e9bff;
    --accent-text: #14132a;
    --accent-soft: #2b2a55;
    --danger: #ff8a80;
    --warn: #f0b860;
    --warn-soft: #3a2e17;
    --mine: #2a2950;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.hidden { display: none !important; }

/* Layout */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 700; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: .45rem; }
.topbar .brand .logo { width: 22px; height: 30px; display: block; }
.topbar .spacer { flex: 1; }
.topbar .back { text-decoration: none; font-size: 1.4rem; line-height: 1; padding: 0 .25rem; color: var(--accent); }
main { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 5rem; }
footer.site { max-width: 760px; margin: 0 auto; padding: 2rem 1rem; color: var(--muted); font-size: .9rem; display: flex; gap: 1rem; flex-wrap: wrap; }
footer.site a { color: var(--muted); }

/* Bausteine */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); margin-bottom: .9rem; }
.card.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.row { display: flex; align-items: center; gap: .6rem; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: .6rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: .65rem 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.pill { display: inline-block; font-size: .78rem; padding: .1rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.badge { min-width: 1.4rem; height: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: .8rem; font-weight: 700; display: inline-grid; place-items: center; }
.emoji { font-size: 1.6rem; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); flex: none; }
.notice { padding: .7rem .9rem; border-radius: 10px; background: var(--accent-soft); color: var(--text); margin-bottom: .9rem; }
.notice.error { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* Formulare */
label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=number], textarea, select {
  width: 100%; font: inherit; color: inherit;
  padding: .65rem .75rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
}
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 1px; border-color: var(--accent); }
textarea { resize: vertical; min-height: 2.8rem; }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.field + .field { margin-top: .75rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

button, .button {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: 10px;
  padding: .6rem 1rem; background: var(--accent); color: var(--accent-text);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
}
button:disabled { opacity: .55; cursor: default; }
button.secondary, .button.secondary { background: var(--surface-2); color: var(--text); border-color: var(--line); }
button.ghost { background: transparent; color: var(--accent); padding: .4rem .6rem; }
button.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
button.small, .button.small { padding: .35rem .7rem; font-size: .88rem; }
button.block { width: 100%; }

/* Tabs */
.tabs { display: flex; gap: .3rem; overflow-x: auto; margin: 0 -1rem 1rem; padding: 0 1rem; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs a { padding: .6rem .8rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--accent); border-color: var(--accent); }

/* Gruppenliste */
.group-link { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: inherit; }
.group-link .info { flex: 1; min-width: 0; }
.group-link .last { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: .35rem; }
.msg { max-width: 82%; align-self: flex-start; background: var(--surface); border: 1px solid var(--line); padding: .45rem .7rem; border-radius: 14px 14px 14px 4px; }
.msg.mine { align-self: flex-end; background: var(--mine); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.msg .author { font-size: .78rem; font-weight: 700; color: var(--accent); }
.msg .time { font-size: .72rem; color: var(--muted); margin-left: .4rem; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.deleted .body { font-style: italic; color: var(--muted); }
.day-sep { align-self: center; font-size: .78rem; color: var(--muted); padding: .4rem 0; }
.composer { position: sticky; bottom: 0; display: flex; gap: .5rem; padding: .75rem 0; background: var(--bg); }
.composer textarea { min-height: 2.75rem; max-height: 9rem; }

/* Abstimmungen */
.option { position: relative; display: block; padding: .55rem .75rem; border-radius: 10px; border: 1px solid var(--line); margin-top: .45rem; overflow: hidden; }
.option .bar { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); z-index: 0; transition: width .25s; }
.option .content { position: relative; z-index: 1; display: flex; align-items: center; gap: .5rem; }
.option .content .title { flex: 1; }
.option .voters { position: relative; z-index: 1; font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.option.chosen { border-color: var(--accent); }

/* Fahrten */
.appt-head { display: flex; gap: .8rem; align-items: flex-start; }
.date-chip { flex: none; width: 3.3rem; text-align: center; border-radius: 10px; background: var(--surface-2); padding: .3rem 0; }
.date-chip .d { font-size: 1.3rem; font-weight: 700; line-height: 1.1; }
.date-chip .m { font-size: .75rem; color: var(--muted); text-transform: uppercase; }
.ride { border-top: 1px solid var(--line); margin-top: .7rem; padding-top: .7rem; }
.ride .who { font-weight: 600; }
.ride.open .who { color: var(--warn); }

/* Startseite: siehe home.css */
.prose h2 { margin-top: 1.5rem; }

@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
  h1 { font-size: 1.4rem; }
}
