/* Adler Fanclubs Aktiv – Basis-Styles. Vereinsfarben kommen aus /theme.css (COLOR_PRIMARY / COLOR_ACCENT). */
:root {
  --primary: #004f9e;
  --accent: #e30613;
  --ice: #f4f7fb;
  --bg: #eef2f7;
  --surface: #ffffff;
  --text: #14213d;
  --muted: #5b6b82;
  --line: #d9e1ec;
  --ok: #1d7a46;
  --ok-bg: #e3f4ea;
  --warn: #8a5a00;
  --warn-bg: #fff2d6;
  --err: #a4161a;
  --err-bg: #fde4e4;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 4px 16px rgba(20, 33, 61, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1524;
    --surface: #152036;
    --ice: #1a2741;
    --text: #e8eef8;
    --muted: #9fb0c8;
    --line: #2a3a58;
    --ok-bg: #12351f; --ok: #7fd6a2;
    --warn-bg: #3a2c0a; --warn: #f3c66b;
    --err-bg: #3d1214; --err: #ff9a9d;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--primary); }
@media (prefers-color-scheme: dark) { a { color: #8db4ff; } }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.3rem; margin-top: 1.2em; }
.card > h2:first-child, .section-head h2, .section-head h1 { margin-top: 0; }
h3 { font-size: 1.08rem; }
h3 a, h2 a { text-decoration: none; }
p { margin: 0 0 .8em; }
img { max-width: 100%; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.skip { position: absolute; left: -999px; }
.abnahme-band { background: repeating-linear-gradient(135deg, #ffd400 0 18px, #ffe866 18px 36px); color: #1a1a1a; text-align: center; font-size: .9rem; padding: 6px 12px; border-bottom: 2px solid #1a1a1a; }
.abnahme-band strong { letter-spacing: .08em; margin-right: 4px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px; z-index: 10; }

/* Header */
.site-header { background: var(--primary); color: #fff; border-bottom: 4px solid var(--accent); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; margin-right: auto; }
.brand img { width: 52px; height: 52px; object-fit: contain; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 1.2rem; letter-spacing: .02em; }
.brand small { opacity: .8; font-size: .8rem; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav .linklike { color: #fff; text-decoration: none; padding: 8px 9px; border-radius: 8px; font-weight: 500; font-size: .97rem; }
.nav a:hover, .nav a.active, .nav .linklike:hover { background: rgba(255, 255, 255, .14); }
.nav .btn { background: var(--accent); color: #fff; margin-left: 6px; }
.nav-toggle { display: none; background: transparent; border: 1px solid rgba(255, 255, 255, .5); color: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; }
.badge { display: inline-block; background: var(--accent); color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 7px; margin-left: 2px; }
@media (max-width: 1360px) { .brand small { display: none; } }
@media (max-width: 1240px) {
  .nav-toggle { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .nav.open { display: flex; }
  .nav .btn { margin: 6px 0 0; text-align: center; }
  .nav form { display: block; }
  .nav .linklike { width: 100%; text-align: left; }
}

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.footer-inner a { color: var(--muted); }

/* Layout-Bausteine */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.narrow-wide { max-width: 720px; margin-left: auto; margin-right: auto; }
.center { text-align: center; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid > .card { margin-bottom: 0; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 16px; }
.stack > .card { margin-bottom: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.muted, .meta { color: var(--muted); }
.meta { font-size: .88rem; margin-bottom: .4em; }
.small { font-size: .85rem; }
.lead { font-size: 1.1rem; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: .3em; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.list li:last-child { border-bottom: 0; }
.list .meta { margin: 0; width: 100%; }
.prose { max-width: 70ch; }
.prose p { margin-bottom: 1em; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.pager { display: flex; justify-content: space-between; }
.inline { display: inline; margin: 0; }

/* Hero */
.hero { display: grid; grid-template-columns: auto 1.6fr 1fr; gap: 24px; align-items: center; padding: 28px; margin-bottom: 24px;
  background: linear-gradient(135deg, #0a0a0a 0%, #111 45%, var(--primary) 100%); color: #fff; border-radius: var(--radius); }
.hero .lead { color: rgba(255, 255, 255, .85); }
.hero .eyebrow { color: #fff; opacity: .8; }
.hero .btn:not(.btn-ghost) { background: var(--accent); border-color: var(--accent); }
.hero .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .6); }
.next-event { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); border-radius: var(--radius); padding: 18px; }
.next-event a { color: #fff; font-weight: 600; }
.next-title { font-size: 1.25rem; font-weight: 700; margin-bottom: .2em; }
.hero-logo { width: 180px; height: 180px; filter: drop-shadow(0 4px 14px rgba(0,0,0,.5)); }
@media (max-width: 900px) { .hero { grid-template-columns: auto 1fr; } .next-event { grid-column: 1 / -1; } .hero-logo { width: 120px; height: 120px; } }
@media (max-width: 600px) { .hero { grid-template-columns: 1fr; padding: 20px; text-align: center; } .hero .actions { justify-content: center; } .hero-logo { margin: 0 auto; width: 140px; height: 140px; } }

/* Buttons */
.btn { display: inline-block; background: var(--primary); color: #fff; border: 2px solid var(--primary); border-radius: 10px;
  padding: 10px 18px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover { filter: brightness(1.1); }
.btn-small { padding: 6px 12px; font-size: .9rem; border-radius: 8px; }
.btn-ghost { background: transparent; color: var(--primary); }
@media (prefers-color-scheme: dark) { .btn-ghost { color: #c9dbff; border-color: #4b6aa3; } }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Formulare */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.form label small { font-weight: 400; color: var(--muted); }
.form input, .form textarea, .form select, fieldset input {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--ice); color: var(--text); width: 100%; }
.form input:disabled { opacity: .7; }
.form textarea { resize: vertical; }
.form > .btn { align-self: flex-start; }
.form .check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
.form .check input { width: auto; }
.form-inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.form-inline label { flex: 1 1 220px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
legend { font-weight: 600; padding: 0 4px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

/* Hinweise & Tags */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid transparent; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--err-bg); color: var(--err); }
.alert-info { background: var(--ice); border-color: var(--line); }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--ice); color: var(--muted); border: 1px solid var(--line); }
.tag-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.tag-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }

/* Kalender */
.calendar table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.calendar th { font-size: .8rem; color: var(--muted); padding: 6px 0; }
.calendar td { border: 1px solid var(--line); vertical-align: top; height: 92px; padding: 4px; overflow: hidden; }
.calendar td.empty { background: var(--ice); }
.calendar td.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.calendar .day { font-size: .8rem; font-weight: 700; color: var(--muted); }
.cal-event { display: block; font-size: .75rem; background: var(--primary); color: #fff !important; border-radius: 4px; padding: 1px 4px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cal-head h2 { margin: 0; }
.cal-head a { font-size: 1.4rem; text-decoration: none; padding: 0 12px; }
@media (max-width: 640px) {
  .calendar td { height: 52px; }
  .cal-event { font-size: 0; height: 8px; padding: 0; border-radius: 4px; }
  .calendar td.has-events .day { color: var(--primary); }
}
.event-row { display: flex; gap: 16px; align-items: flex-start; }
.date-badge { flex: 0 0 58px; text-align: center; background: var(--primary); color: #fff; border-radius: 10px; padding: 6px 0; line-height: 1.1; }
.date-badge .d { display: block; font-size: 1.4rem; font-weight: 800; }
.date-badge .m { display: block; font-size: .78rem; text-transform: uppercase; }
.rsvp { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.rsvp-lists h3 { font-size: .95rem; }

/* Umfragen */
.vote .option { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--ice); cursor: pointer; }
.results { list-style: none; padding: 0; margin: 0 0 12px; }
.results li { margin-bottom: 14px; }
.result-head { display: flex; justify-content: space-between; gap: 12px; font-weight: 500; }
.results .winner .result-head { font-weight: 800; }
.bar { height: 12px; background: var(--ice); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 4px 0; }
.bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.results .winner .bar span { background: var(--accent); }
.names { font-size: .85rem; color: var(--muted); margin: 0; }
.muted-card { opacity: .85; }
.w0{width:0}.w5{width:5%}.w10{width:10%}.w15{width:15%}.w20{width:20%}.w25{width:25%}.w30{width:30%}.w35{width:35%}.w40{width:40%}.w45{width:45%}.w50{width:50%}
.w55{width:55%}.w60{width:60%}.w65{width:65%}.w70{width:70%}.w75{width:75%}.w80{width:80%}.w85{width:85%}.w90{width:90%}.w95{width:95%}.w100{width:100%}

/* Admin */
.stat { text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 2px; }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--primary); }
@media (prefers-color-scheme: dark) { .stat .num { color: #8db4ff; } }
.stat-alert { border-color: var(--accent); }
.stat-alert .num { color: var(--accent); }
.tile { text-decoration: none; color: var(--text); }
.tile:hover { border-color: var(--primary); }
.tile h2 { margin-top: 0; color: var(--primary); }
@media (prefers-color-scheme: dark) { .tile h2 { color: #8db4ff; } }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: .82rem; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.danger-zone { border-color: var(--err); }
@media (max-width: 520px) {
  .brand small { display: none; }
  .brand img { width: 44px; height: 44px; }
  .brand strong { font-size: 1.05rem; }
}

/* ---------- Durchsagen & Schnellzugriff ---------- */
.announcement { background: var(--warn-bg); color: var(--text); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; }
.announcement .meta { display: block; margin: 2px 0 0; }
.actions.quick { margin: 4px 0 18px; }
.wrap-wide { max-width: 1280px; }
body.wide main { padding-bottom: 16px; }

/* ---------- Admin: Kanäle ---------- */
.channel-edit { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.channel-edit-grid { display: grid; grid-template-columns: 1fr 2fr 110px; gap: 10px; }
@media (max-width: 700px) { .channel-edit-grid { grid-template-columns: 1fr; } }

/* ---------- Chat ---------- */
.chat { display: grid; grid-template-columns: 240px 1fr; gap: 16px; height: calc(100vh - 150px); min-height: 480px; }
.chat-sidebar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow-y: auto; }
.chat-sidebar-head { display: flex; justify-content: space-between; align-items: baseline; }
.chat-sidebar h2 { font-size: 1rem; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.channel-list { display: flex; flex-direction: column; gap: 2px; }
.channel { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.channel:hover { background: var(--ice); }
.channel.active { background: var(--primary); color: #fff; }
.channel.unread .channel-name { font-weight: 800; }
.channel .badge { margin-left: auto; }
.channel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); position: relative; }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head h1 { font-size: 1.25rem; margin: 0; }
.chat-head .meta { margin: 2px 0 0; }
.bell { background: var(--ice); border: 1px solid var(--line); border-radius: 999px; font-size: 1.15rem; width: 40px; height: 40px; cursor: pointer; flex: none; }
.bell[aria-pressed="true"] { border-color: var(--primary); }

.messages { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; overscroll-behavior: contain; }
.load-older { align-self: center; margin: 4px 0 10px; }
.empty { text-align: center; margin: auto; }
.day-sep { align-self: center; font-size: .78rem; font-weight: 700; color: var(--muted); background: var(--ice); border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; margin: 14px 0 6px; }

.msg { position: relative; padding: 6px 10px; margin-top: 8px; border-radius: 10px; max-width: 760px; }
.msg.grouped { margin-top: 0; padding-top: 2px; }
.msg.grouped .msg-head { display: none; }
.msg:hover { background: var(--ice); }
.msg.mentioned { background: var(--warn-bg); }
.msg.highlight { outline: 2px solid var(--accent); }
.msg-head { display: flex; gap: 8px; align-items: baseline; }
.msg-head strong { color: var(--primary); }
@media (prefers-color-scheme: dark) { .msg-head strong { color: #8db4ff; } }
.msg.mine .msg-head strong { color: var(--accent); }
.msg-head time, .msg-head .edited { font-size: .75rem; color: var(--muted); }
.msg-body { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.deleted .msg-body { font-style: italic; }
.msg-img img { display: block; max-width: min(360px, 100%); max-height: 360px; border-radius: 10px; margin-top: 6px; border: 1px solid var(--line); }
.mention { background: rgba(0, 79, 158, .12); color: var(--primary); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mention-me { background: var(--accent); color: #fff; }
.msg-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.msg-reactions:empty { display: none; }
.react { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 1px 8px; font: inherit; font-size: .85rem; cursor: pointer; color: var(--text); }
.react.active { border-color: var(--primary); background: rgba(0, 79, 158, .1); }
.msg-actions { position: absolute; top: -14px; right: 8px; display: none; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; box-shadow: var(--shadow); font-size: .85rem; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions, .msg.show-actions .msg-actions { display: flex; }
.emoji-pick { display: flex; gap: 2px; }
.emoji-pick button { background: none; border: 0; cursor: pointer; font-size: 1rem; padding: 2px; border-radius: 6px; }
.emoji-pick button:hover { background: var(--ice); }
.linklike.danger { color: var(--err); }
.edit-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.edit-box { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--ice); color: var(--text); }
@media (hover: none) {
  /* Touch: Aktionen erscheinen nach Antippen der Nachricht */
  .msg:hover .msg-actions { display: none; }
  .msg.show-actions .msg-actions { display: flex; position: static; box-shadow: none; margin-top: 6px; width: max-content; max-width: 100%; flex-wrap: wrap; border-radius: 12px; }
  .emoji-pick button { font-size: 1.25rem; padding: 4px; }
}

.new-below { position: absolute; bottom: 86px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }

.composer { border-top: 1px solid var(--line); padding: 10px 12px; position: relative; }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; font: inherit; resize: none; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--ice); color: var(--text); max-height: 160px; }
.attach-btn { cursor: pointer; font-size: 1.4rem; padding: 6px; border-radius: 8px; line-height: 1; }
.attach-btn:hover { background: var(--ice); }
.attach-preview { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.attach-preview img { height: 56px; border-radius: 8px; border: 1px solid var(--line); }
.composer-error { color: var(--err); margin: 6px 0 0; font-size: .9rem; }
.mention-list { position: absolute; bottom: 100%; left: 12px; right: 12px; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; z-index: 5; }
.mention-opt { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 6px 10px; border-radius: 6px; font: inherit; color: var(--text); cursor: pointer; }
.mention-opt.active, .mention-opt:hover { background: var(--ice); }

@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: calc(100dvh - 120px); gap: 8px; }
  .chat-sidebar { padding: 6px; overflow-x: auto; overflow-y: hidden; }
  .chat-sidebar-head { display: none; }
  .channel-list { flex-direction: row; gap: 6px; }
  .channel { white-space: nowrap; border: 1px solid var(--line); padding: 6px 10px; }
  .chat-head { padding: 10px 12px; }
  .messages { padding: 8px 10px; }
  .msg-img img { max-width: 100%; }
  body.wide main { padding-top: 8px; }
  body.wide .site-footer { display: none; }
}

/* ---------- Terminkategorien (nur Farben) ---------- */
:root { --c-game: var(--primary); --c-fanclub: #e30613; --c-other: #7b8698; --c-birthday: #1e8e3e; }
@media (prefers-color-scheme: dark) { :root { --c-game: #5b95ff; --c-fanclub: #ff4d57; --c-other: #9aa6ba; --c-birthday: #3fbf68; } }
.cat-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; margin-right: 6px; vertical-align: 0; }
.cat-dot-game { background: var(--c-game); }
.cat-dot-fanclub { background: var(--c-fanclub); }
.cat-dot-other { background: var(--c-other); }
.cat-dot-birthday { background: var(--c-birthday); }
.cat-label { display: inline-flex; align-items: center; }
.cat-badge { display: inline-flex; align-items: center; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chip { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 500; }
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-game.active { background: var(--c-game); border-color: var(--c-game); }
.chip-fanclub.active { background: var(--c-fanclub); border-color: var(--c-fanclub); }
.chip-other.active { background: var(--c-other); border-color: var(--c-other); }
.chip-birthday.active { background: var(--c-birthday); border-color: var(--c-birthday); }
.chip.active .cat-dot { background: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: .85rem; color: var(--muted); margin: 12px 0 0; }
.legend span { display: inline-flex; align-items: center; }

/* Monatsraster */
.cal-head { position: relative; justify-content: center; gap: 18px; }
.cal-head h2 { min-width: 190px; text-align: center; }
.cal-nav { font-size: 1.8rem; line-height: 1; padding: 0 10px; border-radius: 8px; }
.cal-nav:hover { background: var(--ice); }
.cal-today { position: absolute; right: 0; }
.calendar td { height: 104px; }
.cal-event { display: block; font-size: .75rem; line-height: 1.35; color: #fff !important; border-radius: 5px; padding: 2px 6px; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; background: var(--c-other); }
.cal-event:hover { filter: brightness(1.08); }
.cal-event .cal-time { font-weight: 700; }
.cal-event.ev-game { background: var(--c-game); }
.cal-event.ev-fanclub { background: var(--c-fanclub); }
.cal-event.ev-other { background: var(--c-other); }
.cal-event.ev-birthday { background: var(--c-birthday); cursor: default; }
.cal-event.ev-birthday:hover { filter: none; }
.cal-more { display: block; font-size: .72rem; color: var(--muted); margin-top: 2px; padding-left: 2px; }
@media (max-width: 640px) {
  .cal-head .cal-today { position: static; }
  .calendar td { height: 58px; padding: 3px; }
  .cal-event { height: 6px; padding: 0; margin-top: 3px; border-radius: 3px; font-size: 0; }
  .cal-event .cal-time, .cal-event .cal-title { display: none; }
  .cal-more { display: none; }
}

/* Terminliste: farbiger Rand + farbiges Datum */
.event-row { text-decoration: none; color: var(--text); border-left: 5px solid var(--c-other); align-items: center; }
.event-row:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(20, 33, 61, .1); }
.event-row.ev-game { border-left-color: var(--c-game); }
.event-row.ev-fanclub { border-left-color: var(--c-fanclub); }
.event-row.ev-birthday { border-left-color: var(--c-birthday); }
.event-row .date-badge { background: var(--c-other); }
.event-row.ev-game .date-badge { background: var(--c-game); }
.event-row.ev-fanclub .date-badge { background: var(--c-fanclub); }
.event-row.ev-birthday .date-badge { background: var(--c-birthday); }
.event-main h3 { margin: 0 0 2px; color: var(--primary); }
@media (prefers-color-scheme: dark) { .event-main h3 { color: #8db4ff; } }
.event-main .meta { margin: 0; }
.event-cat { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 2px; color: var(--c-other); }
.ev-game .event-cat { color: var(--c-game); }
.ev-fanclub .event-cat { color: var(--c-fanclub); }
.ev-birthday .event-cat { color: var(--c-birthday); }
.tag-home { background: rgba(0, 79, 158, .12); color: var(--primary); border-color: transparent; }

/* Profil: Kategorien-Tabelle und Abo-Link */
.cat-table td.center, .cat-table th.center { text-align: center; width: 90px; }
.cat-table input[type="checkbox"] { width: 20px; height: 20px; }
.feed-box { margin-top: 16px; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--ice); display: flex; flex-direction: column; gap: 10px; }
.feed-row { display: flex; gap: 8px; }
.feed-row input { flex: 1; font: inherit; font-size: .85rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); min-width: 0; }
.cat-choice .check { margin: 2px 0; }
/* Heute: blauer Kreis um die Tageszahl statt rotem Rahmen (Rot = Spiele) */
.calendar td.today { outline: none; background: rgba(0, 79, 158, .05); }
.calendar td.today .day { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 999px; background: var(--primary); color: #fff; }
legend small { font-weight: 400; color: var(--muted); }

/* ---------- Nützliche Links ---------- */
.link-group { margin: 0 0 20px; }
.link-group h2 { margin: 0 0 4px; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.link-item:last-child { border-bottom: 0; padding-bottom: 0; }
.link-text { margin: 0 0 4px; }
.link-url { display: inline-block; font-size: .92rem; overflow-wrap: anywhere; }
.link-admin-cat { margin: 24px 0 8px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.link-admin-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.link-admin-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.link-admin-row form { display: inline; }
.footer-inner nav a { white-space: nowrap; }
.mail-status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 16px; }
.table-wrap { overflow-x: auto; }
.log-table td { vertical-align: top; }
.log-table .ua { max-width: 280px; overflow-wrap: anywhere; }
.log-failed td:first-child { border-left: 3px solid var(--c-fanclub); }

/* ---------- Bilder-Kiosk bei News ---------- */
/* Feste Seitenverhältnis-Box mit absolut positionierten Bildern – ohne Grid/Flex-Prozentwerte,
   die Safari auf dem Mac sonst auf 0 Pixel berechnen kann. */
.kiosk { position: relative; margin: 16px 0 20px; border-radius: 12px; overflow: hidden; background: #0d1626; }
.kiosk-track { position: relative; width: 100%; aspect-ratio: 3 / 2; max-height: 70vh; }
.kiosk-square .kiosk-track { aspect-ratio: 1 / 1; }
.kiosk-tall .kiosk-track { aspect-ratio: 4 / 5; }
.kiosk-slide { position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: 0; opacity: 0; transition: opacity .8s ease; }
.kiosk-slide.active { opacity: 1; z-index: 1; }
.kiosk-slide img { display: block; width: 100%; height: 100%; object-fit: contain; }
.kiosk-dots { position: absolute; z-index: 2; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 8px; }
.kiosk-dots button { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: rgba(255,255,255,.35); padding: 0; cursor: pointer; }
.kiosk-dots button[aria-selected="true"] { background: #fff; }
@media (prefers-reduced-motion: reduce) { .kiosk-slide { transition: none; } }
.news-image-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.news-image-row img { border-radius: 6px; flex: none; object-fit: cover; }
.news-image-row > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

/* ---------- App installieren ---------- */
.install-banner { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: 0 8px 28px rgba(0,0,0,.18); max-width: 560px; margin: 0 auto; }
.install-banner img { border-radius: 10px; flex: none; }
.install-banner p { margin: 0; font-size: .88rem; line-height: 1.3; flex: 1; min-width: 0; }
.install-close { background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 6px; }
.install-head { display: flex; gap: 16px; align-items: flex-start; }
.install-head img { border-radius: 20px; flex: none; }
.install-head h1 { margin-top: 0; }
.steps { padding-left: 1.3em; }
.steps li { margin: 6px 0; }
.install-now { margin: 8px 0 16px; }
@media (max-width: 520px) { .install-head { flex-direction: column; } }
/* In der installierten App etwas Platz unter der iPhone-Statusleiste/Home-Leiste */
body.standalone .site-footer { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }

/* ---------- News-Übersicht: Titel, Teaser, Vorschaubild ---------- */
.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-card { padding: 0; overflow: hidden; }
.news-card-link { display: flex; gap: 16px; align-items: flex-start; padding: 14px; color: var(--text); text-decoration: none; }
.news-card-link:hover .news-card-title { text-decoration: underline; }
.news-thumb { flex: none; width: 160px; height: 120px; object-fit: cover; border-radius: 8px; background: #0d1626; }
.news-thumb-empty { display: flex; align-items: center; justify-content: center; background: #e8f0fa; border: 1px solid #d3e1f3; box-sizing: border-box; }
.news-thumb-empty img { width: 40%; height: auto; max-height: 70%; object-fit: contain; border-radius: 6px; opacity: .9; }
@media (prefers-color-scheme: dark) { .news-thumb-empty { background: #13243d; border-color: #1f3657; } }
.news-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.news-card-title { font-weight: 700; font-size: 1.15rem; color: var(--primary); line-height: 1.3; }
.news-card-teaser { color: var(--text); }
@media (max-width: 560px) {
  .news-thumb { width: 96px; height: 72px; }
  .news-card-link { gap: 12px; padding: 12px; }
  .news-card-title { font-size: 1.02rem; }
  .news-card-teaser { font-size: .92rem; }
}
.tag-ai { background: #fff3cd; color: #7a5a00; }
@media (prefers-color-scheme: dark) { .tag-ai { background: #4a3b00; color: #ffe08a; } }
.news-teaser { font-weight: 500; }
.ai-note { margin-top: 20px; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }

/* ---------- Umfrage-Vorlagen / Terminabfrage ---------- */
.template-tile h2 { margin-top: 0; }
#date-options input[type="datetime-local"] { max-width: 280px; }
.option-none { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-style: italic; }
.result-none .bar span { background: var(--muted); }
.tag-best { background: var(--c-fanclub); color: #fff; }
.date-result { margin-top: 12px; }

/* Geburtstag im Formular (Registrierung, Profil) */
.grid.tight { gap: 12px; }
fieldset.birthday { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 4px; margin: 0; }
fieldset.birthday legend { font-weight: 600; padding: 0 4px; }
.birthday-row { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 10px; align-items: end; }
@media (max-width: 420px) { .birthday-row { grid-template-columns: 1fr 1fr; } .birthday-row label:last-child { grid-column: 1 / -1; } }

/* Anhänge an Terminen */
.file-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 8px; }
.file-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-list img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--line); }
.file-icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 48px; border-radius: 6px; background: #fdecea; color: #b3261e; font-weight: 700; font-size: .8rem; }
@media (prefers-color-scheme: dark) { .file-icon { background: #4a1f1c; color: #ffb4ab; } }
.event-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 16px 0; }
.event-images a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: var(--line); }
.event-images img { width: 100%; height: 100%; object-fit: cover; display: block; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* News: Daumen hoch / runter */
.news-vote { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 24px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.news-vote-label { color: var(--muted); font-size: .95rem; margin-right: 4px; }
.vote-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.vote-btn:hover { border-color: var(--primary); }
.vote-btn:disabled { opacity: .6; cursor: wait; }
.vote-down svg { transform: rotate(180deg); }
.vote-up[aria-pressed="true"] { background: #1e8e3e; border-color: #1e8e3e; color: #fff; }
.vote-down[aria-pressed="true"] { background: #b3261e; border-color: #b3261e; color: #fff; }
.vote-count { font-variant-numeric: tabular-nums; min-width: 1ch; }
.vote-mini { font-variant-numeric: tabular-nums; }
.news-vote-msg { flex-basis: 100%; margin: 0; font-size: .85rem; color: var(--muted); }
@media (max-width: 560px) { .news-vote-label { flex-basis: 100%; } }

/* ---------- Unsere Mitglieder: Stadion-Banner im Karussell ---------- */
.mshow { background: #0b0d12; border-radius: 18px; padding: 28px 20px 20px; display: flex; flex-direction: column; gap: 16px; margin-bottom: 12px; font-family: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif; }
.mshow-track { position: relative; }
.mshow-slide { background: #15171c; border: 6px solid #2b2f37; border-radius: 16px; padding: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 28px; box-shadow: 0 18px 48px #000c; color: #e8ebf0; }
.mshow-slide[hidden] { display: none; }
.mshow-slide.is-active { animation: mshow-in .45s ease; }
@keyframes mshow-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mshow-slide.is-active { animation: none; } }
.mshow-photo { flex: none; width: 210px; height: 210px; border-radius: 14px; overflow: hidden; background: #004f9e; border-bottom: 8px solid #e30613; display: flex; align-items: center; justify-content: center; }
.mshow-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mshow-initial { color: #fff; font-weight: 700; font-size: 96px; line-height: 1; }
.mshow-info { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.mshow-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mshow-count { font-size: .9rem; letter-spacing: .2em; color: #8b93a1; font-weight: 600; }
.mshow-badge { font-size: .85rem; letter-spacing: .14em; color: #ffb000; border: 1px solid #ffb00099; background: #2c2108; border-radius: 999px; padding: 4px 12px; font-weight: 700; }
.mshow-name { margin: 0; font-size: clamp(2.6rem, 7vw, 4.9rem); line-height: .95; color: #fff; text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; }
.mshow-stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mshow-stats > div { background: #08090b; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mshow-stats dt { font-size: .8rem; letter-spacing: .12em; color: #8b93a1; font-weight: 600; text-transform: uppercase; }
.mshow-stats dd { margin: 0; font-size: 1.7rem; font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
.mshow-stats .amber { color: #ffb000; text-shadow: 0 0 10px #ffb00066; }
.mshow-stats .red { color: #ff2a1a; text-shadow: 0 0 10px #ff2a1a66; }
.mshow-controls { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.mshow-nav { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #3a3f48; background: #15171c; color: #e8ebf0; font-size: 1.4rem; cursor: pointer; }
.mshow-dots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mshow-dots button { width: 12px; height: 12px; border-radius: 6px; border: 0; padding: 0; background: #3a3f48; cursor: pointer; }
.mshow-dots button[aria-current="true"] { width: 30px; background: #ffb000; }
.mshow-pause { font: inherit; font-size: .95rem; letter-spacing: .08em; color: #e8ebf0; background: transparent; border: 1px solid #3a3f48; border-radius: 999px; padding: 8px 16px; min-height: 44px; cursor: pointer; }
@media (max-width: 560px) {
  .mshow { padding: 16px 10px 14px; }
  .mshow-slide { padding: 16px; gap: 16px; justify-content: center; }
  .mshow-photo { width: 100%; height: auto; aspect-ratio: 1; max-width: 300px; }
  .mshow-stats { grid-template-columns: 1fr; }
  .mshow-stats > div { flex-direction: row; align-items: baseline; justify-content: space-between; }
  .mshow-stats dd { font-size: 1.7rem; }
}
/* Fan-Profil im Profil */
.fan-avatar-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.fan-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid #e30613; flex: none; }
.fan-avatar-empty { display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-size: 2.4rem; font-weight: 700; }
.fan-avatar-fields { flex: 1 1 240px; display: flex; flex-direction: column; gap: 8px; }
.consent-box { background: var(--ice, #f2f6fc); border-radius: 12px; padding: 12px 14px; }
.consent-box p { margin: 6px 0 0; }
@media (max-width: 560px) {
  .mshow-stats > div.mshow-stat-block { flex-direction: column; align-items: flex-start; }
  .mshow-stats dd { white-space: nowrap; }
  .mshow-stats dd.mshow-block { white-space: normal; }
}

/* Wochenübersicht (WhatsApp) */
.weekly-text { width: 100%; box-sizing: border-box; font: 14px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; }

/* Eigene Formular-Fehlerhinweise (siehe app.js) */
.field-error { display: block; color: #b00012; font-size: .9rem; font-weight: 600; margin-top: 2px; }
.form [aria-invalid="true"] { border-color: #b00012; outline: 2px solid #b0001233; }
.form-error-summary { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fde8ea; color: #8a000e; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .field-error { color: #ff8a94; }
  .form-error-summary { background: #3a1015; color: #ffc2c8; }
}

/* Umfragen per Link teilen */
.share-row { display: flex; gap: 8px; align-items: center; }
.share-row input { flex: 1 1 auto; min-width: 0; padding: 10px 12px; border: 1px solid var(--line, #c9d3e3); border-radius: 10px; font: inherit; font-size: .95rem; background: var(--ice); color: var(--text); }
.guest-name { border: 1px solid var(--line, #d6deeb); border-radius: 12px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.guest-name legend { font-weight: 700; padding: 0 4px; }
.guest-name legend small { font-weight: 400; color: var(--muted); }
.guest-name-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; }
.guest-name p { margin: 0; }
.guest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.guest-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line, #e3e9f3); }
.guest-list li:first-child { border-top: 0; }
@media (max-width: 420px) { .guest-name-row { grid-template-columns: 1fr; } .share-row { flex-direction: column; align-items: stretch; } }
.result-head > span:last-child { white-space: nowrap; }

/* Kontaktformular: Lockfeld für Bots unsichtbar (nicht display:none, das erkennen manche Bots) */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Nachrichten (Kontaktanfragen) */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tab { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 600; font-size: .95rem; }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tab.active .muted { color: #ffffffcc; }
.tile-alert { border-color: var(--accent); }
.msg-row { display: block; text-decoration: none; color: inherit; }
.msg-row .meta, .msg-preview { margin: 4px 0 0; }
.msg-preview { color: var(--muted); }
.msg-new { border-left: 4px solid var(--accent); }
.msg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.msg-head h1 { margin: 0; }
.tag.msg-new { background: #fde8ea; color: #8a000e; border: 1px solid transparent; }
.tag.msg-read { background: #eef2f8; color: #33415c; }
.tag.msg-answered { background: #e3f4e8; color: #1d6b35; }
.tag.msg-done { background: #ececec; color: #555; }
.msg-contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 14px 0; }
.msg-contact div { background: var(--ice); border-radius: 10px; padding: 8px 12px; }
.msg-contact dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.msg-contact dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.msg-reply { border-left: 4px solid var(--primary); }
@media (prefers-color-scheme: dark) {
  .tag.msg-new { background: #3a1015; color: #ffc2c8; }
  .tag.msg-read { background: #1e2a3d; color: #c9d6ea; }
  .tag.msg-answered { background: #12301d; color: #a8e2b8; }
  .tag.msg-done { background: #2a2a2a; color: #bbb; }
}

/* Statistik & Betrieb (Admin) – Diagrammfarben geprüft (Farbsehschwäche, Kontrast) für hell und dunkel */
:root { --ch-m: #004f9e; --ch-g: #e30613; --ch-line: #004f9e; --ch-grid: #e3e9f1; --ch-base: #9aa9bd; }
@media (prefers-color-scheme: dark) { :root { --ch-m: #4d8bf0; --ch-g: #f0505a; --ch-line: #4d8bf0; --ch-grid: #24324d; --ch-base: #5b6f90; } }
.chart { display: block; width: 100%; height: auto; margin: 4px 0 8px; overflow: visible; }
.chart .ch-grid { stroke: var(--ch-grid); stroke-width: 1; }
.chart .ch-base { stroke: var(--ch-base); }
.chart .ch-axis { fill: var(--muted); font-size: 11px; }
.chart .ch-m { fill: var(--ch-m); }
.chart .ch-g { fill: var(--ch-g); }
.chart .ch-line { fill: none; stroke: var(--ch-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ch-fail { fill: none; stroke: var(--err); stroke-width: 2.5; stroke-linecap: round; }
.chart .ch-hit { fill: transparent; }
.chart .ch-bar:hover .ch-hit, .chart .ch-pt:hover .ch-hit { fill: var(--ice); }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0 0 4px; padding: 0; font-size: .88rem; color: var(--muted); }
.ch-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ch-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.ch-key-m { background: var(--ch-m); }
.ch-key-g { background: var(--ch-g); }
.table-num td:not(:first-child), .table-num th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.health-card h3 { margin-top: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.health-card .st-label { font-size: .85rem; font-weight: 600; margin-left: auto; }
.st-icon { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; font-size: .9rem; font-weight: 800; }
.st-ok { border-left: 4px solid var(--ok); } .st-ok .st-icon { background: var(--ok-bg); color: var(--ok); } .st-ok .st-label { color: var(--ok); }
.st-bad { border-left: 4px solid var(--err); } .st-bad .st-icon { background: var(--err-bg); color: var(--err); } .st-bad .st-label { color: var(--err); }
.st-off { border-left: 4px solid var(--line); } .st-off .st-icon { background: var(--ice); color: var(--muted); } .st-off .st-label { color: var(--muted); }
.st-inline { border: 0; font-weight: 600; color: var(--err); }
.health-card .facts { margin-bottom: 0; }
.inline-form { margin: 0 0 16px; }
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-scroll .chart { min-width: 540px; }
.chart .ch-axis { font-size: 13px; }
@media (max-width: 600px) {
  .grid-4.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-4.stats .stat { padding: 14px; }
  .grid-4.stats .stat .num { font-size: 1.5rem; }
}

/* News teilen (Facebook/Instagram) */
.share-card-img { display: block; width: 100%; max-width: 360px; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.share-grid textarea { width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.share-steps { padding-left: 18px; margin: 0; display: grid; gap: 8px; font-size: .95rem; }
.share-done { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.share-done form { display: inline-flex; align-items: center; gap: 8px; }
.social-share.is-disabled { opacity: .55; }

/* Version & Änderungslog */
.changelog h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 0; }
.changelog h4 { margin: 14px 0 4px; font-size: .95rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.changelog ul { margin: 0; padding-left: 20px; }
.changelog.is-current { border-color: var(--primary); }

/* Bereich „Intern“: Termine ein-/ausblenden */
.section-actions { display: inline-flex; align-items: center; gap: 12px; }
.events-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.date-pick { margin-top: 12px; }
.date-pick .check { flex-wrap: wrap; }

/* Admin → Mitglieder: kleines Profilfoto */
.member-cell { display: flex; gap: 10px; align-items: flex-start; }
.member-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 40px; border: 1px solid var(--line); }
.member-avatar-empty { display: inline-flex; align-items: center; justify-content: center; background: var(--ice); color: var(--muted); font-weight: 700; }

/* News planen: Status in der Verwaltung, Vorschau-Hinweis, Zeitpunkt im Formular */
.tag-scheduled { background: var(--warn-bg); color: var(--warn); }
.tag-draft { background: var(--ice); color: var(--muted); border: 1px solid var(--line); }
.notice-preview { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; }
.news-publish .publish-at { margin: 2px 0 8px 28px; }
.news-publish .publish-at input { max-width: 260px; }
.news-publish:has(input[value="scheduled"]:not(:checked)) .publish-at { opacity: .55; }

/* Chat: Bildansicht über dem Chat (mit Schließen-Knopf, Tippen daneben, Esc, Zurück-Geste) */
.img-viewer { position: fixed; inset: 0; z-index: 1000; background: #05080e; display: flex; flex-direction: column; }
.img-viewer[hidden] { display: none; }
.img-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px; color: #e8eef8; }
.img-viewer-title { font-size: .9rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-viewer-close { flex: none; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 1rem; font-weight: 600; cursor: pointer; }
.img-viewer-close:hover, .img-viewer-close:focus-visible { background: rgba(255, 255, 255, .24); outline: 2px solid #fff; outline-offset: 2px; }
.img-viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: 0 12px calc(env(safe-area-inset-bottom, 0px) + 16px); }
.img-viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; touch-action: pinch-zoom; }
html.img-viewer-open, html.img-viewer-open body { overflow: hidden; }
@media (max-width: 480px) { .img-viewer-close span { display: none; } .img-viewer-close { width: 44px; padding: 0; } }

/* Social Media: Fehler beim automatischen Posten */
.tag-error { background: var(--err-bg); color: var(--err); }
.social-error { color: var(--err); margin: 2px 0 8px 28px; }

/* News-Formular: Vorschau für Facebook/Instagram */
.social-preview { display: grid; grid-template-columns: minmax(160px, 270px) 1fr; gap: 16px; margin: 10px 0 6px; align-items: start; }
.social-preview[hidden] { display: none; }
.social-preview-card { margin: 0; }
.social-preview-card img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--ice); }
.social-preview-card figcaption { margin-top: 6px; }
.social-preview-text textarea { width: 100%; min-height: 10rem; }
@media (max-width: 640px) { .social-preview { grid-template-columns: 1fr; } .social-preview-card { max-width: 270px; } }

/* ---------- AFCA: Untermenüs und Seiten (Design-Schicht: public/css/afca.css) ---------- */
.nav-group { position: relative; }
.nav-group > summary { list-style: none; cursor: pointer; color: #fff; padding: 8px 9px; border-radius: 8px; font-weight: 500; font-size: .97rem; user-select: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: " ▾"; font-size: .8em; opacity: .85; }
.nav-group > summary:hover, .nav-group[open] > summary, .nav-group.active > summary { background: rgba(255, 255, 255, .14); }
.nav-sub { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 230px; background: var(--primary); border-radius: 10px; padding: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); display: flex; flex-direction: column; }
.nav-sub a { white-space: nowrap; }
@media (max-width: 1240px) {
  .nav-sub { position: static; box-shadow: none; padding: 0 0 0 14px; background: transparent; min-width: 0; }
}
.page-card { overflow: hidden; }
.page-banner { display: block; width: calc(100% + 40px); max-width: none; margin: -20px -20px 16px; height: auto; max-height: 360px; object-fit: cover; }
.activity-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 16px; }
.activity-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; color: inherit; text-decoration: none; margin: 0; }
.activity-card img { width: 100%; height: 140px; object-fit: cover; }
.activity-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.activity-card:hover strong { color: var(--primary); text-decoration: underline; }
.tag { display: inline-block; background: var(--warn-bg); color: var(--warn); border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 600; }
