/* Vereinskontor – Ergänzungen Kommunikation (News, Chat, Umfragen, Newsletter), Startseite, Profil */

/* ---------- News */
.news-feed { display: flex; flex-direction: column; }
.news-item { display: flex; gap: 18px; color: var(--ink); align-items: flex-start; }
.news-item:hover { text-decoration: none; border-color: var(--line-strong); }
.news-item h2 { margin: 6px 0 4px; }
.news-item p { margin-bottom: 8px; }
.news-item.unread { border-left: 3px solid var(--brand); }
.news-body { flex: 1; min-width: 0; }
.news-badges { gap: 6px; }
.news-thumb { width: 180px; height: 120px; object-fit: cover; border-radius: var(--radius-sm); flex: none; background: var(--surface-2); }
.news-hero { display: block; width: calc(100% + 40px); margin: -20px -20px 16px; max-height: 380px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }
.news-meta { margin-bottom: 14px; }
.news-meta .i { width: 14px; height: 14px; vertical-align: -2px; }
.news-thumb-edit { max-width: 220px; border-radius: var(--radius-sm); }
.news-article { max-width: 860px; }
.news-reads-head { padding: 14px 20px 6px; flex-wrap: wrap; gap: 10px; }
.news-reads-head form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.news-reads-note { padding: 0 20px 8px; margin: 0; }
.news-remind-mail { gap: 6px; }
.news-remind-mail input { width: auto; min-height: 0; }
.news-embed-code { font-size: 12.5px; resize: vertical; }
.news-embed-preview { width: 100%; min-height: 260px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }

/* ---------- Öffentliche News (news_public.php) */
.np { min-height: 100vh; background: var(--bg); }
.np-head { max-width: 900px; margin: 0 auto; padding: 22px 16px 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.np-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.np-brand:hover { text-decoration: none; }
.np-brand img { width: 44px; height: 44px; object-fit: contain; }
.np-brand .brand-mark { width: 44px; height: 44px; font-size: 16px; }
.np-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.np-brand b { font-size: 1.1rem; }
.np-main { max-width: 900px; margin: 0 auto; padding: 14px 16px 24px; }
.np-title { font-size: 1.6rem; margin: 4px 0 14px; }
.np-article { max-width: none; }
.np-more { color: var(--brand); font-weight: 600; }
.np-foot { max-width: 900px; margin: 0 auto; padding: 8px 16px 32px; text-align: center; }
.np-embed, .np-embed body { background: transparent; }
.np-embed .np-main { padding: 0; max-width: none; }
.np-embed .card { box-shadow: none; }


/* ---------- Chat */
.chat-li-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-li-title, .chat-li-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-li-title { font-size: 14px; }
.chat-list .avatar .i, .chat-head .avatar .i { width: 16px; height: 16px; }
.chat-back { display: none; }
.chat-empty { margin: auto; }
.chat-older { align-self: center; margin-bottom: 8px; }
.chat-input { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chat-input .chip { align-self: flex-start; height: 28px; }
.chat-input .chip .icon-btn { width: 22px; height: 22px; }
.chat-form label.icon-btn { flex: none; }
.msg-text { white-space: normal; overflow-wrap: anywhere; }
.msg-img img { display: block; max-width: min(320px, 100%); max-height: 260px; border-radius: 10px; margin: 4px 0; }
.msg-file { display: inline-block; padding: 6px 0; font-weight: 600; }
.msg.mine .msg-file { color: inherit; }
.msg-deleted { opacity: .65; font-style: italic; }
.msg-del { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; opacity: .85; }
/* Grid darf nicht über die feste Chat-Höhe hinauswachsen */
.chat { grid-template-rows: minmax(0, 1fr); }
.chat-main, .chat-list { min-height: 0; }
.chat-msgs { min-height: 0; }
.chat-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-mute span { font-size: 16px; line-height: 1; filter: grayscale(1); opacity: .7; }
.chat-mute.on span { filter: none; opacity: 1; }
.chat-muted-ico { font-size: 11px; font-weight: 400; }
.chat-pinned { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); font-size: 13.5px; }
.chat-pinned-text { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 4px 0; font: inherit; color: var(--ink-2); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pinned .icon-btn { width: 28px; height: 28px; }
.chat-readonly { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.chat-readonly .i { width: 15px; height: 15px; flex: none; }
.msg { position: relative; }
.msg:focus { outline: none; }
.msg:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.msg.flash-hl { animation: vkhl 1.6s ease; }
@keyframes vkhl { 0%, 60% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 45%, transparent); } 100% { box-shadow: none; } }
.msg-edited { font-style: italic; }
.msg-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.react { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 7px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; line-height: 1; }
.react b { font-size: 11.5px; font-weight: 650; }
.react:hover { border-color: var(--brand); }
.react.mine { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.msg.mine .react { background: color-mix(in srgb, #fff 18%, transparent); border-color: color-mix(in srgb, #fff 35%, transparent); color: var(--brand-ink); }
.msg.mine .react.mine { background: color-mix(in srgb, #fff 34%, transparent); border-color: var(--brand-ink); }
.msg-pinned { box-shadow: inset 3px 0 0 var(--warn); }
/* Nachrichtenzeile: Blase + „…“-Knopf. Die Zeile ist volle Breite → Hover reißt beim Weg zum Knopf nicht ab. */
.msg-row { display: flex; align-items: center; gap: 4px; align-self: stretch; min-width: 0; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-row > .msg { align-self: auto; max-width: min(560px, calc(100% - 44px)); }
.msg-more { flex: none; width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; transition: opacity .12s, background .12s; }
.msg-more .i { width: 20px; height: 20px; stroke-width: 3; }
.msg-more:hover, .msg-more[aria-expanded="true"] { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.msg-more:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; opacity: 1; }
/* PC mit Maus: Knopf erscheint beim Überfahren/Fokussieren der Zeile */
@media (hover: hover) and (pointer: fine) {
  .msg-more { opacity: 0; }
  .msg-row:hover .msg-more, .msg-row:focus-within .msg-more, .msg-row.menu-open .msg-more { opacity: 1; }
}
/* Touch: immer sichtbar, aber dezent; kein Text-Markieren/Kontextmenü beim langen Drücken */
@media (hover: none), (pointer: coarse) {
  .msg-more { opacity: .55; width: 36px; height: 36px; }
  .msg-row.menu-open .msg-more { opacity: 1; }
  .msg-row > .msg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}
.chat-msgs { touch-action: manipulation; }
.msg-row.menu-open > .msg { box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 40%, transparent); }
.msg.liked { animation: vklike .5s ease; }
@keyframes vklike { 0% { transform: scale(1); } 35% { transform: scale(1.04); } 100% { transform: scale(1); } }

/* Aktionsmenü: PC als Popover, Handy als Bottom-Sheet */
.msg-menu { position: fixed; z-index: 60; min-width: 230px; max-width: min(330px, calc(100vw - 16px)); padding: 6px; border-radius: 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.18)); outline: none; }
.msg-menu[hidden], .msg-menu-bd[hidden], .chat-toast[hidden] { display: none; }
.msg-menu-head { display: none; }
.msg-menu-emojis { display: flex; justify-content: space-between; gap: 2px; padding: 2px 2px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.msg-menu-emojis button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid transparent; background: none; font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.msg-menu-emojis button:hover, .msg-menu-emojis button:focus-visible { background: var(--surface-2); }
.msg-menu-emojis button.on { background: color-mix(in srgb, var(--brand) 16%, var(--surface)); border-color: var(--brand); }
.msg-menu-list { display: flex; flex-direction: column; }
.msg-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.msg-menu-item .i { width: 17px; height: 17px; color: var(--ink-2); flex: none; }
.msg-menu-item:hover, .msg-menu-item:focus-visible { background: var(--surface-2); }
.msg-menu-item.danger, .msg-menu-item.danger .i { color: var(--danger); }
.msg-menu button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.msg-menu-cancel { display: none; }
.msg-menu-bd { position: fixed; inset: 0; z-index: 59; background: rgba(10, 14, 22, .4); }
.msg-menu.sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; max-width: none; width: 100%; min-width: 0; border-radius: 18px 18px 0 0; border-bottom: 0; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); animation: vksheet .18s ease-out; }
.msg-menu.sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 2px auto 10px; }
.msg-menu.sheet .msg-menu-head { display: flex; flex-direction: column; gap: 2px; padding: 0 4px 10px; font-size: 13px; }
.msg-menu.sheet .msg-menu-head span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-menu.sheet .msg-menu-emojis { padding: 4px 0 10px; margin-bottom: 6px; }
.msg-menu.sheet .msg-menu-emojis button { width: 44px; height: 44px; font-size: 24px; }
.msg-menu.sheet .msg-menu-item { padding: 13px 10px; font-size: 15.5px; }
.msg-menu.sheet .msg-menu-cancel { display: block; width: 100%; margin-top: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
@keyframes vksheet { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .msg-menu.sheet, .msg.liked { animation: none; } }
.chat-toast { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: 24px; max-width: calc(100vw - 32px); padding: 9px 16px; border-radius: 20px; background: var(--ink); color: var(--surface); font-size: 13.5px; box-shadow: var(--shadow-lg, 0 6px 18px rgba(0,0,0,.2)); pointer-events: none; }
.chat-toast.err { background: var(--danger); color: #fff; }
.chat-flash { cursor: pointer; }
.chat-attach { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-att { display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 4px 4px 4px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.chat-att img, .chat-att-ico { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--surface); }
.chat-att-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; flex-direction: column; }
.chat-att-name small { color: var(--muted); }
.chat-att .icon-btn { width: 26px; height: 26px; font-size: 18px; }
.chat-att.too-big { border-color: var(--danger); }
.chat-att.too-big small { color: var(--danger); }
.chat-editbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--brand); font-weight: 600; }
.chat-editbar .i { width: 14px; height: 14px; vertical-align: -2px; }
.chat-form.editing textarea { border-color: var(--brand); }
.chat-pick { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.chat-pick label { gap: 8px; padding: 3px 0; cursor: pointer; }
.chat-pick input, .danger-text input { width: auto; min-height: 0; }
.danger-text { color: var(--danger); gap: 8px; }
@media (max-width: 860px) {
  .chat-back { display: inline-grid; }
  .chat-act { padding: 0 10px; }
  .chat-act span { display: none; }
  .msg-row > .msg { max-width: calc(100% - 44px); }
  .chat-toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .content:has(> .chat) { padding-bottom: 0; }
}

/* ---------- Umfragen */
.poll-option { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.poll-option:hover { border-color: var(--brand); }
.poll-option:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.poll-results { display: flex; flex-direction: column; gap: 12px; }
.poll-result .progress { height: 12px; margin-top: 4px; }
.poll-result.lead .progress > span { background: var(--ok); }
.poll-event { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); }
.poll-event:hover { text-decoration: none; border-color: var(--brand); }
.poll-event > .i:first-child { color: var(--brand); width: 20px; height: 20px; flex: none; }
.poll-event .grow { display: flex; flex-direction: column; min-width: 0; }
.poll-unlink { gap: 6px; white-space: nowrap; }
.poll-unlink input { width: auto; min-height: 0; }

/* ---------- Newsletter */
.nl-builder { align-items: start; }
.nl-block-head { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.nl-block-head .icon-btn[disabled] { opacity: .3; pointer-events: none; }
.nl-block .rte-area { min-height: 110px; }
.nl-img-thumb { max-width: 100%; max-height: 140px; border-radius: var(--radius-sm); object-fit: contain; align-self: flex-start; }
.nl-preview-card { position: sticky; top: 16px; }
.nl-preview { width: 100%; height: calc(100vh - 180px); min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f2f3f5; }
.nl-add .row { gap: 6px; }

/* ---------- Startseite */
.dash-hello { margin: 4px 0 18px; }
.dash-hello h2 { font-size: 1.35rem; margin-bottom: 2px; }
.dash-grid { align-items: start; }
.dash-grid .card-head h3 { display: flex; align-items: center; gap: 8px; }
.dash-grid .card-head .i { color: var(--brand); }
.dash-rsvp { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dash-unread .title { color: var(--brand); }
.dash-unread .title::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 7px; vertical-align: 1px; }
.dash-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-install { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.dash-install .i { width: 15px; height: 15px; vertical-align: -3px; }
.dash-install .avatar .i { width: 18px; height: 18px; }
.dash-quick .btn .i { color: var(--brand); }
.dash-people { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.dash-person { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-person-name { font-size: 13px; font-weight: 600; min-width: 46px; }
.dash-person .dash-rsvp { justify-content: flex-start; }
.dash-week-list { list-style: none; margin: 0; padding: 0; }
.dash-week-list > li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.dash-week-list > li:last-child { border-bottom: 0; }
.dash-week-day { width: 44px; flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.15; padding: 3px 0; border-radius: 8px; background: var(--surface-2); }
.dash-week-day small { color: var(--muted); font-size: 11px; }
.dash-week-day.today { background: var(--brand); color: var(--brand-ink); }
.dash-week-day.today small { color: inherit; opacity: .85; }
.dash-week-list .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 2px; }
.dash-week-item { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-week-item .muted { font-variant-numeric: tabular-nums; font-size: 12.5px; }
.dash-week-bd { color: var(--ink-2); }
.dash-card-tile { border-color: color-mix(in srgb, var(--brand) 45%, var(--line-strong)); }
@media (max-width: 860px) {
  .dash-event { flex-wrap: wrap; }
  .dash-rsvp { justify-content: flex-start; }
  .news-item { flex-direction: column; gap: 10px; }
  .news-thumb { width: 100%; height: 160px; }
  .news-hero { width: calc(100% + 32px); margin: -16px -16px 14px; }
  .nl-preview-card { position: static; }
  .nl-preview { height: 520px; }
}

/* ---------- Profil */
.profile-head .avatar.lg { margin-right: 6px; }
.profile-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 12px; }
.profile-dl dt { color: var(--muted); font-size: 13.5px; }
.profile-dl dd { margin: 0; font-weight: 550; }
.profile-card-head { padding: 16px 20px 4px; }
.profile-pad { padding: 0 20px 16px; }
.profile-notify td, .profile-notify th { padding: 8px 10px; }
.profile-notify input[type=checkbox] { width: 18px; height: 18px; min-height: 0; }
#push .row { flex-wrap: wrap; }
#bank summary { list-style: none; }
#bank summary::-webkit-details-marker { display: none; }
#bank details[open] summary { display: none; }

/* ---------- Allgemein: .grow außerhalb von .list */
.row > .grow, .chat-head > .grow, .chat-form > .grow { flex: 1; min-width: 0; }
.dash-grid > .card { margin-bottom: 0; }
