:root {
  --magenta: #c44d8a;
  --magenta-dark: #9a3a6c;
  --teal: #1a8a8a;
  --teal-dark: #146868;
  --bg: #f6f4f7;
  --card: #ffffff;
  --text: #222;
  --muted: #666;
  --border: #ddd;
  --female: #c44d8a;
  --danger: #b33;
  --ok: #1a7a4a;
  --touch: 44px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--teal-dark); }

.topbar {
  background: linear-gradient(90deg, var(--magenta), var(--teal));
  color: #fff;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  text-decoration: none;
}

.topbar .brand:hover { text-decoration: none; opacity: 0.95; }

.topbar .brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 2px;
  flex-shrink: 0;
}

.topbar .brand-text { line-height: 1.2; }

.topbar nav { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.topbar a {
  color: #fff;
  text-decoration: none;
  opacity: 0.95;
  font-weight: 500;
  padding: 0.35rem 0.25rem;
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
}

.topbar a:hover { text-decoration: underline; }

.topbar .user {
  margin-left: auto;
  font-size: 0.9rem;
  opacity: 0.95;
}

.container {
  max-width: 1100px;
  width: 100%;
  margin: 1.25rem auto;
  padding: 0 1rem 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

h1, h2 { margin-top: 0; }

.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.flash.ok { background: #e8f6ee; color: var(--ok); border: 1px solid #b7e0c7; }
.flash.err { background: #fdeeee; color: var(--danger); border: 1px solid #f0c0c0; }
.flash.info { background: #eef6f6; color: var(--teal-dark); border: 1px solid #c5e0e0; }

.login-wrap {
  max-width: 420px;
  margin: 3rem auto;
}

label { display: block; font-weight: 600; margin: 0.75rem 0 0.35rem; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  min-height: var(--touch);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: var(--teal);
  min-height: var(--touch);
}

.btn:hover { background: var(--teal-dark); }
.btn.secondary { background: #666; }
.btn.magenta { background: var(--magenta); }
.btn.magenta:hover { background: var(--magenta-dark); }
.btn.small { padding: 0.45rem 0.75rem; font-size: 0.85rem; min-height: 2.5rem; }
.btn.danger { background: var(--danger); }

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.orient-hint {
  display: none;
  color: var(--teal-dark);
  background: #eef6f6;
  border: 1px solid #c5e0e0;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.female { color: var(--female); font-weight: 600; }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.25rem;
  padding-bottom: 0.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.pairing-table {
  min-width: 42rem;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f0eef2;
  position: sticky;
  top: 0;
  z-index: 1;
}

tr.me { background: #f3faf8; }
tr.female-row { background: #fdf5f9; }

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.count-pill {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.9rem;
}

.count-pill strong { color: var(--teal-dark); }

.inline-form { display: inline; }

.field-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.field-row input[type="text"],
.field-row select {
  width: auto;
  min-width: 7rem;
  max-width: 12rem;
  min-height: 2.5rem;
}

.input-groesse { width: 4.5rem; min-width: 4.5rem; }
.input-nr { width: 4rem; min-width: 4rem; }
.input-merch { width: 3.5rem; min-width: 3.5rem; }

.touch-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-weight: 500;
  min-height: var(--touch);
  white-space: nowrap;
}

.touch-check input {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
}

.training-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 700px) {
  .training-grid { grid-template-columns: 1fr 1fr; }
}

.slot {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: #fff;
}

.slot h3 { margin: 0 0 0.35rem; color: var(--magenta-dark); }
.slot .when { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.75rem; }

.who { list-style: none; padding: 0; margin: 0.5rem 0 0.75rem; }
.who li {
  padding: 0.25rem 0;
  border-bottom: 1px dashed #eee;
}

.muted { color: var(--muted); }
.admin-only { font-size: 0.8rem; color: var(--magenta); }

.readonly { color: var(--muted); }

.calc { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Portrait phones: stack controls, show landscape hint, keep table scrollable */
@media (max-width: 700px) and (orientation: portrait) {
  .orient-hint { display: block; }

  .container {
    margin: 0.75rem auto;
    padding: 0 0.65rem 1.5rem;
  }

  .card { padding: 1rem 0.75rem; }

  .topbar .user { margin-left: 0; width: 100%; }

  .field-row {
    flex-direction: column;
    align-items: stretch;
  }

  .field-row select,
  .field-row input[type="text"] {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .field-row .btn {
    width: 100%;
  }

  .pairing-table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.45rem 0.4rem;
  }
}

/* Landscape phones / short height: denser table, full width */
@media (orientation: landscape) and (max-height: 500px),
       (orientation: landscape) and (max-width: 950px) {
  .orient-hint { display: none; }

  .container {
    max-width: none;
    margin: 0.5rem auto;
    padding: 0 0.5rem 1rem;
  }

  .card { padding: 0.75rem; }

  .topbar {
    padding: 0.4rem 0.75rem;
    gap: 0.5rem 1rem;
  }

  .pairing-table {
    font-size: 0.8rem;
    min-width: 38rem;
  }

  th, td {
    padding: 0.28rem 0.35rem;
  }

  .field-row select,
  .field-row input[type="text"] {
    min-width: 6rem;
    max-width: 10rem;
    min-height: 2.25rem;
    padding: 0.3rem 0.45rem;
  }

  .btn.small {
    min-height: 2.25rem;
    padding: 0.3rem 0.55rem;
  }

  .touch-check { min-height: 2.25rem; }
}

@media (max-width: 600px) {
  .topbar .user { margin-left: 0; width: 100%; }
}

/* Schlüssel (key holder) */
.slot-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.slot-actions form { margin: 0; }
.key-icon { margin-left: .25rem; }
.key-status { margin: .25rem 0 .5rem; font-size: .9em; }

/* Language switcher (DE | EN) */
.topbar .lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  margin-left: auto;
}
.topbar .user + .lang-switch { margin-left: 0.5rem; }
.topbar .lang-switch strong { padding: 0.35rem 0.25rem; }
.topbar .lang-switch a { padding: 0.35rem 0.4rem; min-height: var(--touch); opacity: 0.85; }
.topbar .lang-switch .sep { opacity: 0.6; }

/* --- admin T-shirt list ------------------------------------------------ */
.merch-totals { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: .5rem 0 1rem; font-size: .95rem; }
.merch-table td.center { text-align: center; }
.merch-table .input-qty { width: 4rem; }
.merch-table .input-note { min-width: 9rem; }
.merch-table .input-nr.warn { border-color: #d97706; background: #fff7ed; }
.merch-table .extra-cost { color: var(--magenta-dark); font-weight: 600; white-space: nowrap; }
.merch-table .small { font-size: .8rem; }
.merch-table .warn-text { color: #b45309; }
.tag { display: inline-block; font-size: .7rem; padding: 0 .35rem; margin-left: .25rem; border-radius: .5rem; background: #eee; color: #555; vertical-align: middle; }

/* --- trainings: sign-up count ----------------------------------------- */
.signup-count { margin: 0 0 .5rem; font-weight: 600; }
.count-badge { display: inline-block; min-width: 1.6rem; padding: .05rem .45rem; margin-right: .3rem; border-radius: 1rem; background: var(--magenta); color: #fff; text-align: center; }

/* --- admin Erima stock -------------------------------------------------- */
.small-text { font-size: .9rem; }
.stock-table { margin-bottom: .75rem; }
.stock-table th, .stock-table td { text-align: center; }
.stock-table th:first-child, .stock-table td:first-child { text-align: left; white-space: nowrap; }
.stock-table td.center, .stock-orders td.center, .stock-orders th.center { text-align: center; }
.stock-pos { color: #15803d; font-weight: 600; }
.stock-neg { color: var(--danger); font-weight: 600; }
.erima-orders { margin: .5rem 0 1.25rem; }
.erima-orders summary { cursor: pointer; font-weight: 600; color: var(--magenta-dark); margin-bottom: .5rem; }
.stock-orders .small { font-size: .8rem; }
.stock-orders tr.order-first td { border-top: 2px solid #ddd; }
.order-add { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .5rem; }
.order-add input[type=text] { min-width: 9rem; }

/* --- not-allowed tournament cells (grey, like the sheet) --------------- */
.pairing-table td.na,
tr.female-row td.na,
tr.me td.na {
  background: #8f8f8f;
  color: #eee;
  text-align: center;
  cursor: not-allowed;
}
.rules-note { font-size: .9rem; color: var(--muted); margin: -.25rem 0 1rem; }
.na-swatch { display: inline-block; width: 1.1em; height: .9em; background: #8f8f8f; border-radius: 2px; vertical-align: -1px; }
.extern { font-style: italic; }
.field-row input.extern-name { min-width: 7rem; max-width: 12rem; }
.training-note { background: #fff8e1; border: 1px solid #f0d78c; border-radius: 8px; padding: .5rem .75rem; margin: 0 0 1rem; font-size: .95rem; }

/* --- profile ------------------------------------------------------------ */
.login-info { background: #eef6f6; border: 1px solid #c5e0e0; border-radius: 8px; padding: .6rem .8rem; }
.login-wrap h2 { margin-top: 1.5rem; }
.pw-reset-form select, .pw-reset-form input[type="text"] { max-width: 16rem; }

/* --- sortable tournament headers --------------------------------------- */
th.sortable { padding: 0; }
.sort-btn {
  all: unset; box-sizing: border-box; display: block; width: 100%;
  padding: 0.4rem 0.5rem; min-height: 2.5rem; cursor: pointer; font-weight: 700;
  -webkit-tap-highlight-color: rgba(0,0,0,.08); white-space: nowrap;
}
.sort-btn:focus-visible { outline: 2px solid var(--teal-dark); outline-offset: -2px; }
th[aria-sort="ascending"], th[aria-sort="descending"] { background: #e3dfe8; }
.sort-ind { font-size: .8em; }

/* --- pairing change request (members) ---------------------------------- */
.pairing-request { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 1rem; }
.pairing-request .btn { white-space: normal; text-align: left; }

/* --- Atomiade 2027 event ------------------------------------------------ */
.event-intro { font-size: 1.05rem; line-height: 1.5; }
.event-notice { background: #fff3cd; border: 1px solid #f0c36d; border-left: 5px solid #e0a800; border-radius: 8px; padding: .75rem 1rem; margin: 1rem 0; }
.event-me { background: #f3faf8; border: 1px solid #c5e0e0; border-radius: 8px; padding: .75rem 1rem; margin: 1rem 0; }
.event-me form { margin: .25rem 0; }
.place-badge { width: auto; padding: 0 .55rem; border-radius: 999px; }
.late-signoff input[type="text"] { max-width: 22rem; }
.late-signoff .touch-check { white-space: normal; align-items: flex-start; }
.event-table { max-width: 40rem; }
tr.waitlist td { color: var(--muted); font-style: italic; }
.event-settings label { display: flex; flex-direction: column; font-weight: 600; margin: 0; }

/* --- group chat --------------------------------------------------------- */
.nav-badge { display: inline-block; min-width: 1.25rem; padding: 0 .35rem; margin-left: .15rem; border-radius: 999px; background: #fff; color: var(--magenta-dark); font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.25rem; vertical-align: 1px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.chat-card { position: relative; padding: .75rem; max-width: 820px; margin: 0 auto; }
.chat-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin: 0 .25rem .5rem; }
.chat-head h1 { margin: 0; font-size: 1.4rem; }
.chat-sub { font-size: .85rem; }
.chat-scroll { height: 60vh; min-height: 260px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: #efeaf1; border-radius: 8px; padding: .5rem .5rem .75rem; }
.chat-older-wrap { text-align: center; }
.chat-older-wrap .btn { margin: .25rem 0 .5rem; }
.chat-empty { text-align: center; margin-top: 2rem; }
.day-sep { text-align: center; margin: .6rem 0; }
.day-sep span { display: inline-block; background: rgba(255,255,255,.85); color: var(--muted); font-size: .75rem; padding: .1rem .6rem; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.msg-row { display: flex; flex-direction: column; align-items: flex-start; margin: .2rem 0 .35rem; }
.msg-row.mine { align-items: flex-end; }
.bubble { position: relative; max-width: min(82%, 520px); background: #fff; border-radius: 10px 10px 10px 2px; padding: .35rem .55rem .2rem; box-shadow: 0 1px 1px rgba(0,0,0,.08); overflow-wrap: anywhere; }
.msg-row.mine .bubble { background: #d6efe9; border-radius: 10px 10px 2px 10px; }
.bubble.deleted { background: #f7f7f7; color: var(--muted); font-style: italic; }
.msg-row.mine .bubble.deleted { background: #e9f3f1; }
.msg-author { font-size: .8rem; font-weight: 700; color: var(--teal-dark); margin-bottom: .1rem; }
.msg-author.female { color: var(--female); }
.msg-badge { display: inline-block; margin-left: .35rem; padding: 0 .35rem; font-size: .65rem; font-weight: 700; font-style: normal; line-height: 1.1rem; border-radius: 4px; background: var(--magenta); color: #fff; vertical-align: 1px; text-transform: uppercase; letter-spacing: .02em; }
.msg-text { white-space: pre-wrap; font-size: .97rem; }
.msg-text.big-emoji { font-size: 2.1rem; line-height: 1.2; }
.msg-text a { word-break: break-all; }
.msg-deleted { font-size: .9rem; }
.msg-photos { display: grid; gap: 3px; margin: .1rem 0 .25rem; border-radius: 6px; overflow: hidden; }
.msg-photos.n2, .msg-photos.n3, .msg-photos.n4 { grid-template-columns: 1fr 1fr; }
.msg-photos img { display: block; width: 100%; max-height: 320px; object-fit: cover; cursor: zoom-in; background: #ddd; min-height: 80px; }
.msg-photos.n1 img { max-height: 420px; object-fit: contain; background: transparent; }
.msg-photos.n2 img, .msg-photos.n3 img, .msg-photos.n4 img { aspect-ratio: 1 / 1; }
.msg-meta { display: flex; justify-content: flex-end; align-items: center; gap: .35rem; font-size: .7rem; color: var(--muted); }
.msg-del { all: unset; cursor: pointer; padding: .1rem .3rem; font-size: .85rem; border-radius: 4px; opacity: .7; }
.msg-del:hover, .msg-del:focus-visible { opacity: 1; background: rgba(0,0,0,.06); }
.msg-reactions { position: relative; display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .15rem; }
.react { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: .05rem .45rem; font-size: .85rem; line-height: 1.5; cursor: pointer; min-height: 1.8rem; }
.react.on { border-color: var(--teal); background: #e0f2ef; }
.react.add { color: var(--muted); opacity: .75; font-size: .8rem; }
.react-bar { position: absolute; z-index: 5; bottom: 2rem; left: 0; display: flex; gap: .1rem; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: .2rem .35rem; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.msg-row.mine .react-bar { left: auto; right: 0; }
.react-bar button { all: unset; cursor: pointer; font-size: 1.35rem; padding: .1rem .2rem; border-radius: 6px; }
.react-bar button:hover { background: #f0f0f0; }
.chat-status { font-size: .85rem; padding: .25rem .25rem 0; }
.chat-newpill { position: absolute; left: 50%; transform: translateX(-50%); bottom: 5.2rem; border: none; border-radius: 999px; background: var(--teal); color: #fff; padding: .35rem .9rem; font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,.2); cursor: pointer; z-index: 4; }
.chat-composer { display: flex; align-items: flex-end; gap: .35rem; margin-top: .5rem; }
.chat-composer textarea { flex: 1; resize: none; min-height: var(--touch); max-height: 140px; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 22px; font: inherit; font-size: 1rem; line-height: 1.35; }
.icon-btn { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; width: var(--touch); height: var(--touch); flex: 0 0 var(--touch); font-size: 1.35rem; border-radius: 50%; cursor: pointer; position: relative; }
.icon-btn:hover, .icon-btn:focus-within, .icon-btn:focus-visible { background: #f0edf2; }
.send-btn { flex: 0 0 var(--touch); width: var(--touch); height: var(--touch); border: none; border-radius: 50%; background: var(--teal); color: #fff; font-size: 1.15rem; cursor: pointer; }
.send-btn:disabled { opacity: .5; }
.emoji-panel { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.4rem, 1fr)); gap: .1rem; max-height: 11.5rem; overflow-y: auto; margin-top: .5rem; padding: .35rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.emoji-panel[hidden] { display: none; }
.emoji-panel button { all: unset; text-align: center; font-size: 1.45rem; padding: .2rem 0; border-radius: 6px; cursor: pointer; }
.emoji-panel button:hover { background: #f0edf2; }
.chat-previews { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .5rem; }
.chat-previews[hidden] { display: none; }
.preview { position: relative; width: 64px; height: 64px; }
.preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.preview-x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border: none; border-radius: 50%; background: #333; color: #fff; font-size: .7rem; cursor: pointer; }
.preview-hint { font-size: .8rem; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100vw; max-height: 100vh; max-height: 100dvh; object-fit: contain; }
.lightbox-close { position: absolute; top: .75rem; right: .75rem; width: 44px; height: 44px; border: none; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff; font-size: 1.2rem; cursor: pointer; }
.female-name { color: var(--female); }
@media (max-width: 600px) {
  .chat-card { padding: .5rem; border-radius: 8px; }
  .chat-scroll { padding: .4rem .3rem .6rem; }
  .bubble { max-width: 88%; }
}

/* --- auth pages (login / signup) on phones: form at the very top -------- */
.fee-bottom { display: none; }
.auth-submit { margin-top: 1.25rem; }
.label-hint { font-weight: 400; color: var(--muted); font-size: .9em; }
@media (max-width: 700px) {
  /* inputs ≥ 16px → iOS Safari does not auto-zoom on focus */
  .login-wrap input, .login-wrap select, .login-wrap textarea { font-size: 16px; }

  body.auth-page .topbar { padding: .3rem .75rem; gap: .25rem .75rem; flex-wrap: nowrap; }
  body.auth-page .topbar .brand { font-size: .95rem; gap: .5rem; min-width: 0; }
  body.auth-page .topbar .brand-logo { width: 30px; height: 30px; border-radius: 6px; }
  body.auth-page .topbar .brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.auth-page .topbar .lang-switch { margin-left: auto; font-size: .9rem; flex-shrink: 0; }
  body.auth-page .topbar .lang-switch a, body.auth-page .topbar .lang-switch strong { min-height: 36px; padding-top: .2rem; padding-bottom: .2rem; }
  body.auth-page .container { margin: .4rem auto; padding: 0 .5rem 1rem; }
  body.auth-page .flash { padding: .5rem .75rem; margin-bottom: .5rem; }
  body.auth-page .login-wrap { margin: 0 auto; padding: .55rem .8rem .9rem; }
  body.auth-page .login-wrap h1 { font-size: 1.15rem; margin: 0; }
  body.auth-page .label-hint { font-size: .8rem; }
  body.auth-page .auth-intro { display: none; }
  body.auth-page .auth-form label { margin: .4rem 0 .2rem; font-size: .9rem; line-height: 1.25; }
  body.auth-page .auth-form input[type="text"],
  body.auth-page .auth-form input[type="password"],
  body.auth-page .auth-form input[type="email"],
  body.auth-page .auth-form select { min-height: 42px; padding: .45rem .65rem; }
  body.auth-page .auth-submit { margin: .65rem 0 0; }
  body.auth-page .auth-submit .btn { width: 100%; }
  body.auth-page .auth-submit .btn + .btn { margin: .5rem 0 0 !important; }
  body.auth-page .fee-top { display: none; }
  body.auth-page .fee-bottom { display: block; margin: .9rem 0 0; font-size: .9rem; }
}
@media (max-width: 380px) {
  body.auth-page .label-hint { font-size: .72rem; letter-spacing: -.01em; }
  body.auth-page .topbar .brand { font-size: .9rem; }
}

/* --- chat: videos, upload progress, link previews ----------------------- */
.msg-video { margin: .1rem 0 .25rem; }
.msg-video video { display: block; width: 100%; max-width: 420px; max-height: min(420px, 55vh); border-radius: 6px; background: #000; }
.msg-video-meta { display: flex; justify-content: space-between; gap: .5rem; font-size: .75rem; color: var(--muted); margin-top: .15rem; }
.preview-video { width: auto; min-width: 64px; display: flex; align-items: center; gap: .4rem; }
.preview-video video { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: #000; }
.preview-dur { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.chat-progress { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .6rem; margin-top: .5rem; }
.chat-progress[hidden] { display: none; }
.progress-track { flex: 1 1 140px; height: 8px; background: #e6e1e9; border-radius: 4px; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--teal); transition: width .2s; }
.progress-text { font-size: .8rem; color: var(--muted); }
.link-card { display: flex; gap: .55rem; margin: .3rem 0 .15rem; border: 1px solid var(--border); border-left: 4px solid var(--teal); border-radius: 6px; background: rgba(255,255,255,.75); color: inherit; text-decoration: none; overflow: hidden; max-width: 420px; }
.link-card:hover { background: #fff; }
.link-card img { width: 84px; min-height: 84px; max-height: 110px; object-fit: cover; flex: 0 0 84px; background: #eee; }
.link-card .lc-body { padding: .35rem .5rem .4rem 0; min-width: 0; }
.link-card img + .lc-body { padding-left: 0; }
.link-card .lc-body:first-child { padding-left: .55rem; }
.lc-site { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.lc-title { display: block; font-weight: 700; font-size: .9rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lc-desc { font-size: .8rem; color: #444; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lc-cta { font-size: .8rem; font-weight: 700; color: var(--magenta-dark); margin-top: .15rem; }
.link-card.reel { border-left-color: var(--magenta); }
.yt-embed { margin: .3rem 0 .15rem; max-width: 420px; }
.yt-embed .yt-thumb, .yt-embed iframe { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 6px; overflow: hidden; background: #000; padding: 0; cursor: pointer; }
.yt-embed.short .yt-thumb, .yt-embed.short iframe { aspect-ratio: 9 / 16; max-width: 260px; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; }
.yt-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 44px; border-radius: 12px; background: rgba(220,0,0,.9); color: #fff; font-size: 1.4rem; display: flex; align-items: center; justify-content: center; }
.yt-cap { display: block; margin-top: .2rem; color: inherit; text-decoration: none; }
.yt-cap .lc-title { font-size: .85rem; }

/* --- global keyboard helper: room to scroll fields above the keyboard ---- */
body { padding-bottom: env(safe-area-inset-bottom); }
body.kb-open { padding-bottom: 55vh; }

/* --- profile: T-shirt ---------------------------------------------------- */
.profile-wrap { max-width: 560px; }
.profile-wrap h3 { margin: 1.1rem 0 .4rem; font-size: 1.02rem; }
/* Poppins Bold (SIL Open Font License 1.1, static/Poppins-OFL.txt) – only for the shirt print */
@font-face { font-family: "Poppins Shirt"; src: url("Poppins-Bold.woff?v=20261008m") format("woff");
  font-weight: 700; font-style: normal; font-display: swap; }
.shirt-preview { margin: .5rem auto .25rem; width: 100%; max-width: 340px; text-align: center; }
.shirt-svg { display: block; width: 100%; height: auto; aspect-ratio: 1440 / 1420; filter: drop-shadow(0 4px 8px rgba(0,0,0,.16)); }
.shirt-print { font-family: "Poppins Shirt", "Poppins", "Arial Rounded MT Bold", Arial, Helvetica, sans-serif; font-weight: 700; }
.shirt-preview figcaption { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
.shirt-missing { background: #fff8e1; border: 1px solid #f0d78c; border-radius: 8px; padding: .6rem .8rem; margin: .5rem 0; }
.shirt-nr-fixed { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .25rem 0; }
.nr-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 2.6rem; height: 2.6rem; padding: 0 .5rem; border-radius: 8px; background: #2453c4; color: #fff; font-weight: 900; font-size: 1.25rem; }
.shirt-nr-form select, .profile-wrap .field-row select { max-width: 12rem; }
.shirt-request-form .field-row label { display: flex; flex-direction: column; font-weight: 600; margin: 0; }
.shirt-req-table td, .shirt-req-table th { font-size: .9rem; }
tr.req-storniert td { color: var(--muted); text-decoration: line-through; }
tr.req-erledigt td { color: var(--muted); }
@media (max-width: 699px) {
  .chat-card.typing .chat-head { display: none; }
}
.venue-line { margin: -.4rem 0 .9rem; font-size: .95rem; color: var(--muted); }
.venue-line a { white-space: normal; }

/* --- mobile menu (≤ 760px, logged in) ----------------------------------
   Thumb-reachable: a floating round ☰ button bottom-right (above the iPhone
   home indicator), the menu opens from the bottom as a sheet; ✕ on the same
   button. Safe areas (notch / Dynamic Island / home bar) via env(). menu.js
   hides the button while the keyboard is open and lifts it above the chat
   composer (--fab-min). Desktop and login pages are unaffected. */
.mnav { display: none; }
@keyframes mnav-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes mnav-fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 760px) {
  .topbar.has-mnav { position: relative; flex-wrap: nowrap; gap: .5rem; min-height: 52px; z-index: 40;
    padding: max(.3rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) .3rem max(.75rem, env(safe-area-inset-left)); }
  .topbar.has-mnav > nav, .topbar.has-mnav > .user, .topbar.has-mnav > .lang-switch { display: none; }
  .topbar.has-mnav .brand { font-size: .98rem; gap: .5rem; min-width: 0; flex: 1 1 auto; min-height: 44px; padding: 0; }
  .topbar.has-mnav .brand-logo { width: 36px; height: 36px; border-radius: 7px; }
  .topbar.has-mnav .brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mnav { display: block; flex: 0 0 0; width: 0; height: 0; }

  /* floating action button */
  .mnav-btn { list-style: none; position: fixed; z-index: 3;
    right: calc(16px + env(safe-area-inset-right));
    bottom: max(calc(16px + env(safe-area-inset-bottom)), var(--fab-min, 0px));
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 50%; cursor: pointer; color: #fff;
    background: linear-gradient(135deg, var(--magenta), var(--teal));
    box-shadow: 0 6px 16px rgba(0,0,0,.28), 0 1px 3px rgba(0,0,0,.22);
    font-size: 1.6rem; line-height: 1; -webkit-tap-highlight-color: transparent;
    user-select: none; -webkit-user-select: none; touch-action: manipulation;
    transition: opacity .18s, transform .18s, bottom .18s, visibility 0s; }
  .mnav-btn::-webkit-details-marker { display: none; }
  .mnav-btn::marker { content: ""; }
  .mnav-btn:active { transform: scale(.93); }
  .mnav-btn:focus-visible { outline: 3px solid var(--magenta-dark); outline-offset: 3px; }
  .mnav-icon::before { content: "☰"; }
  .mnav[open] .mnav-icon::before { content: "✕"; font-size: 1.35rem; }
  .mnav[open] .mnav-btn { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .mnav-badge { position: absolute; top: -3px; right: -3px; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; border-radius: 999px;
    background: var(--magenta-dark); color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.35rem; text-align: center;
    box-shadow: 0 0 0 2px #fff; }
  .mnav[open] .mnav-badge { display: none; }
  body.fab-hidden .mnav:not([open]) .mnav-btn { opacity: 0; transform: scale(.5); visibility: hidden; pointer-events: none;
    transition: opacity .15s, transform .15s, visibility 0s .15s; }

  /* bottom sheet */
  .mnav-backdrop { position: fixed; inset: 0; z-index: 1; background: rgba(30,16,28,.42); animation: mnav-fade .18s ease-out; }
  .mnav-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; background: #fff; color: var(--text);
    border-radius: 18px 18px 0 0; box-shadow: 0 -8px 28px rgba(0,0,0,.25);
    max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px - env(safe-area-inset-top));
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    animation: mnav-up .22s cubic-bezier(.2,.8,.3,1); }
  .mnav-panel::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: #d8d0d8; margin: 8px auto 4px; }
  .mnav-panel nav { display: flex; flex-direction: column; }
  .topbar .mnav-panel a { color: var(--text); display: flex; align-items: center; min-height: 52px; padding: .5rem 1.25rem; font-size: 1.05rem; font-weight: 500; opacity: 1; border-left: 4px solid transparent; }
  .topbar .mnav-panel a:hover { text-decoration: none; background: #f4eef3; }
  .topbar .mnav-panel a.active { border-left-color: var(--magenta); background: #fbf0f6; color: var(--magenta-dark); font-weight: 700; }
  .mnav-panel .nav-badge { background: var(--magenta); color: #fff; margin-left: .45rem; }
  .topbar .mnav-panel a.mnav-logout { color: var(--danger); border-top: 1px solid var(--border); margin-top: .25rem; }
  /* last row sits next to the ✕ button (same height/centre: 16px + 56px + 16px) */
  .mnav-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 88px;
    padding: .25rem 88px .25rem 1.25rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .95rem; }
  .mnav-user { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mnav-lang { display: inline-flex; align-items: center; gap: .2rem; flex-shrink: 0; }
  .mnav-lang strong { padding: .35rem .4rem; color: var(--text); }
  .topbar .mnav-lang a { min-height: 44px; padding: .35rem .6rem; border: 0; font-size: .95rem; color: var(--teal-dark); }
  .mnav-lang .sep { opacity: .5; }
  html.mnav-lock, html.mnav-lock body { overflow: hidden; }

  /* room so the button never hides the end of a page / the newest chat message */
  body.has-fab:not(.kb-open):not(.chat-page) { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  body.has-fab .chat-card:not(.typing) .chat-scroll { padding-bottom: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .mnav-panel, .mnav-backdrop { animation: none; }
  .mnav-btn { transition: none; }
}

/* --- Galerie ------------------------------------------------------------- */
.gal-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; }
.gal-title-row h1 { margin: 0; }
.gal-new { margin-top: .9rem; }
.gal-new > summary, .gal-edit > summary { list-style: none; display: inline-flex; align-items: center; cursor: pointer; }
.gal-new > summary::-webkit-details-marker, .gal-edit > summary::-webkit-details-marker { display: none; }
.gal-new[open] > summary { background: #666; }
.gal-form { margin-top: .75rem; max-width: 36rem; }
.gal-form textarea { width: 100%; box-sizing: border-box; font: inherit; padding: .6rem; border: 1px solid var(--border); border-radius: 8px; }
.gal-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin: 1rem 0; }
.gal-album { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; color: var(--text); text-decoration: none; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.gal-album:hover { text-decoration: none; box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.gal-album:focus-visible { outline: 3px solid var(--teal-dark); outline-offset: 2px; }
.gal-cover { display: block; aspect-ratio: 4 / 3; background: #ece6ec; position: relative; }
.gal-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-cover-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; opacity: .55; }
.gal-album-body { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .85rem .85rem; }
.gal-album-title { font-size: 1.05rem; color: var(--magenta-dark); overflow-wrap: anywhere; }
.gal-album-meta { font-size: .85rem; }
.gal-empty { text-align: center; padding: 1.5rem 0; }
.gal-back { margin: .25rem 0 .5rem; }
.gal-back a { display: inline-flex; align-items: center; min-height: var(--touch); }
.gal-album-head h1 { margin: 0 0 .35rem; overflow-wrap: anywhere; }
.gal-album-desc { white-space: pre-wrap; overflow-wrap: anywhere; margin: .25rem 0 .5rem; }
.gal-album-info { margin: .25rem 0; font-size: .9rem; }
.gal-edit { margin-top: .5rem; }
.gal-del-form { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--border); }

.gal-upload { padding-top: .9rem; }
.gal-drop { border: 2px dashed #cdbfcb; border-radius: 12px; padding: 1rem; text-align: center; background: #fcf9fb; transition: background .15s, border-color .15s; }
.gal-drop.is-over { border-color: var(--magenta); background: #fbeaf3; }
.gal-drop-text { margin: 0 0 .6rem; font-size: 1.02rem; }
.gal-actions { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.gal-actions .btn { cursor: pointer; }
.gal-limits { margin: .6rem 0 0; }
.gal-qhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin: .9rem 0 .4rem; font-weight: 600; }
.gal-qbtns { display: inline-flex; gap: .4rem; }
.gal-upload [hidden] { display: none !important; }
.gal-queue { list-style: none; margin: 0; padding: 0; }
.gq { display: flex; gap: .65rem; align-items: flex-start; padding: .55rem 0; border-top: 1px solid #eee; }
.gq-prev { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 8px; background: #eee; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; overflow: hidden; }
.gq-prev img { width: 100%; height: 100%; object-fit: cover; }
.gq-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.gq-top { display: flex; gap: .5rem; align-items: baseline; min-width: 0; }
.gq-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gq-size { flex-shrink: 0; font-size: .82rem; }
.gq-status { font-size: .85rem; }
.gq-done .gq-status { color: var(--ok); }
.gq-error .gq-status { color: var(--danger); }
.gq-canceled { opacity: .55; }
.gq-bar { flex: 0 0 auto; height: 6px; }
.gq-bar[hidden] { display: none; }
.gq-desc { width: 100%; box-sizing: border-box; min-height: 40px; }
.gq-btns { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; flex-shrink: 0; }
.gq-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #f0eaef; color: #555; font-size: 1rem; cursor: pointer; }

.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; margin: 1rem 0 2rem; }
.gtile { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.gthumb { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #e6e0e6; cursor: zoom-in; }
.gthumb:focus-visible { outline: 3px solid var(--teal-dark); outline-offset: 2px; }
.gthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gthumb-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; }
.gbadge { position: absolute; left: 6px; bottom: 6px; padding: .1rem .45rem; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff; font-size: .78rem; font-weight: 600; }
.gcover-badge { position: absolute; right: 6px; top: 6px; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: rgba(0,0,0,.55); color: #ffd84a; font-size: .9rem; display: flex; align-items: center; justify-content: center; }
.gcap { display: flex; align-items: flex-start; gap: .25rem; padding-top: .3rem; min-height: 0; }
.gdesc { flex: 1 1 auto; min-width: 0; font-size: .85rem; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gtile-act { margin-left: auto; display: inline-flex; gap: .15rem; flex-shrink: 0; }
.gmini { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: .95rem; color: #555; }
.gmini:hover { background: #f0eaef; }

/* lightbox: above the floating ☰ (topbar stacking context z 40) */
html.glb-lock, html.glb-lock body { overflow: hidden; }
.glb { position: fixed; inset: 0; z-index: 100; background: #0d0b0d; color: #fff; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.glb[hidden] { display: none; }
.glb-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .5rem; flex: 0 0 auto; }
.glb-count { font-size: .9rem; opacity: .85; padding-left: .4rem; }
.glb-tools { display: inline-flex; align-items: center; gap: .25rem; }
.glb-btn { min-width: 44px; height: 44px; padding: 0 .55rem; border: 0; border-radius: 22px; background: rgba(255,255,255,.12); color: #fff; font-size: 1.1rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.glb-btn:hover { background: rgba(255,255,255,.24); text-decoration: none; }
.glb-btn[hidden] { display: none; }
#glb-cover { font-size: .85rem; }
#glb-cover:disabled { opacity: .7; cursor: default; color: #ffd84a; }
.glb-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.glb-media { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; touch-action: pan-y pinch-zoom; }
.glb-media img, .glb-media video { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.glb-media video { background: #000; }
.glb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 48px; height: 64px; border: 0; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; font-size: 2.2rem; line-height: 1; cursor: pointer; }
.glb-nav:hover { background: rgba(255,255,255,.25); }
.glb-nav[hidden] { display: none; }
.glb-prev { left: .5rem; }
.glb-next { right: .5rem; }
.glb-cap { flex: 0 0 auto; max-height: 30vh; overflow-y: auto; padding: .5rem 1rem .75rem; }
.glb-desc { margin: 0 0 .25rem; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1rem; }
.glb-meta { margin: 0; font-size: .8rem; opacity: .7; }

/* description editor: sheet at the TOP (stays above the iPhone keyboard) */
.gedit { position: fixed; inset: 0; z-index: 110; background: rgba(20,10,18,.5); display: flex; align-items: flex-start; justify-content: center;
  padding: calc(env(safe-area-inset-top) + .75rem) .75rem .75rem; }
.gedit[hidden] { display: none; }
.gedit-box { background: #fff; color: var(--text); border-radius: 14px; padding: 1rem; width: 100%; max-width: 34rem; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.gedit-box h2 { margin: 0 0 .6rem; font-size: 1.1rem; }
.gedit-row { display: flex; gap: .6rem; align-items: flex-start; }
.gedit-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.gedit-row img[hidden] { display: none; }
.gedit-row textarea { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 16px; padding: .55rem; border: 1px solid var(--border); border-radius: 8px; }
.gedit-btns { display: flex; justify-content: flex-end; gap: .5rem; margin: .75rem 0 0; }

@media (hover: none), (max-width: 760px) {
  .only-desk { display: none; }
}
@media (max-width: 760px) {
  .gal-albums { grid-template-columns: 1fr 1fr; gap: .65rem; }
  .gal-album-body { padding: .5rem .6rem .65rem; }
  .gal-album-title { font-size: .98rem; }
  .gal-album-meta { font-size: .78rem; }
  .gal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin-top: .75rem; }
  .gthumb { border-radius: 6px; }
  .gdesc { font-size: .78rem; -webkit-line-clamp: 2; }
  .gmini { width: 32px; height: 32px; font-size: .85rem; }
  .gcap { flex-wrap: wrap; }
  /* keep the upload button clear of the floating ☰ button (bottom-right) */
  body.has-fab .gal-actions { justify-content: flex-start; padding-right: 72px; }
  .gal-drop { text-align: left; padding: .85rem; }
  .gal-drop-text { display: none; }
  .glb-nav { display: none; }       /* phones: swipe */
  .glb-btn { min-width: 42px; height: 42px; }
  #glb-cover { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 360px) {
  .gal-albums { grid-template-columns: 1fr; }
}
/* short phones (iPhone SE/8, 667 px): 7 menu rows → slightly denser sheet (tap targets stay ≥ 44 px) */
@media (max-width: 760px) and (max-height: 720px) {
  .topbar .mnav-panel a { min-height: 44px; padding-top: .25rem; padding-bottom: .25rem; }
  .mnav-panel::before { margin: 6px auto 2px; }
}

/* --- chat on phones: fixed column = visible area (chat.js adds html.chat-fixed) ---
   The card covers exactly the visual viewport (above the keyboard while typing);
   list flexes, composer stays at the bottom. The page itself does not scroll, so
   iOS has nothing to re-scroll while typing (no more "jumping" composer). */
.chat-composer textarea { font-size: 16px; }            /* ≥ 16px: iOS does not zoom on focus */
html.chat-fixed, html.chat-fixed body { overflow: hidden; overscroll-behavior: none; }
html.chat-fixed .chat-card { position: fixed; z-index: 2; margin: 0; max-width: none;
  left: max(6px, env(safe-area-inset-left)); right: max(6px, env(safe-area-inset-right));
  top: 6px; height: calc(100vh - 12px); height: calc(100dvh - 12px);   /* JS sets the exact px */
  display: flex; flex-direction: column; }
html.chat-fixed .chat-card > * { flex: 0 0 auto; }
html.chat-fixed .chat-card > .chat-scroll { flex: 1 1 auto; height: auto; min-height: 0; }
html.chat-fixed .chat-card > .chat-newpill { position: absolute; }
/* floating ☰ + bottom sheet stay above the fixed chat card */
html.chat-fixed .topbar.has-mnav { z-index: auto; }
html.chat-fixed .mnav-backdrop { z-index: 5; }
html.chat-fixed .mnav-panel { z-index: 6; }
html.chat-fixed .mnav-btn { z-index: 7; }
