/* Hit or Run · Last Asylum Server 129 — Dark, Blutrot, Pergament */

/* Display-Schrift "Pirata One" (SIL Open Font License, Lizenztext liegt neben der Datei) */
@font-face {
  font-family: "Pirata One";
  src: url("../fonts/PirataOne-Regular.ttf") format("truetype");
  font-weight: 400 700;                 /* eine Strichstärke: kein künstliches Fettdrucken */
  font-display: swap;
}

:root {
  --bg: #0d0a09;
  --bg-2: #14100e;
  --surface: #1a1412;
  --surface-2: #231a17;
  --line: #3a2a25;
  --red: #b3121a;
  --red-hi: #d4202a;
  --red-dk: #6e0b10;
  --bone: #e8e0d2;
  --ash: #a89f94;
  --ember: #d9822b;

  --font-display: "Pirata One", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--bone);
  font: 16px/1.55 var(--font-body);
  padding-bottom: calc(var(--nav-h) + var(--safe-b));
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

/* Körnung wie verwittertes Metall */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 100;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; }
a { color: var(--bone); text-decoration: none; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.15;
  margin: 0 0 .4em;
}
h1 { font-size: clamp(2.5rem, 9vw, 3.8rem); }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.5rem; }
p { margin: 0 0 .8em; }

.wrap {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
.block { padding-block: 1.6rem; }

.icon {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -5px;
}
.icon-lg { width: 34px; height: 34px; }

/* ------------------------------------------------------------ Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 8px max(var(--gutter), env(safe-area-inset-right)) 8px max(var(--gutter), env(safe-area-inset-left));
  background: rgba(13, 10, 9, .92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar::after {            /* roter Schwerthieb unter der Leiste */
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: linear-gradient(90deg, transparent 0, var(--red) 20%, var(--red-hi) 55%, transparent 100%);
  opacity: .8;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.brand-text strong { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: .03em; white-space: nowrap; }
.brand-text small { color: var(--ash); font-size: .72rem; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topnav { display: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Sprachwahl */
.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 4px;
  font-size: .85rem; font-weight: 600; color: var(--bone);
}
.lang summary::-webkit-details-marker { display: none; }
.lang ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  margin: 0; padding: 6px; list-style: none; min-width: 150px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0,0,0,.6);
}
.lang li a { display: block; padding: 10px 12px; border-radius: 4px; }
.lang li a:hover, .lang li a[aria-current] { background: var(--red-dk); }

/* ------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  font: 600 .95rem/1 var(--font-body); letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid transparent; border-radius: 3px; cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%);
  transition: background .15s, transform .15s;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hi); }
.btn-ghost { background: transparent; color: var(--bone); border-color: var(--line); clip-path: none; }
.btn-ghost:hover { border-color: var(--red); background: rgba(179, 18, 26, .15); }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: .8rem; }
.btn-sm span { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 479px) {          /* schmale Handys: Anmelden nur als Symbol */
  .topbar-actions .btn-sm span { display: none; }
  .topbar-actions .btn-sm { padding: 0 10px; }
}

/* ------------------------------------------------------------ Hero */
.hero { position: relative; min-height: 600px; display: grid; align-items: end; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 0; z-index: -2; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(13,10,9,.25) 0%, rgba(13,10,9,.15) 30%, rgba(13,10,9,.8) 62%, var(--bg) 92%);
}
.hero-inner { text-align: center; padding-block: 13rem 2.2rem; }
.hero-logo { width: min(66vw, 280px); height: auto; filter: drop-shadow(0 6px 24px rgba(0,0,0,.75)); }
.hero-tag { margin: .6rem 0 1.4rem; color: var(--bone); font-size: 1.05rem; letter-spacing: .06em; text-shadow: 0 2px 10px #000; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 0; }

/* ------------------------------------------------------------ Überschriften-Banner (zerrissen) */
.h-banner {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 1rem; padding: .45rem 2.2rem .45rem 1rem;
  background: linear-gradient(90deg, var(--red-dk), var(--red));
  color: #fff; font-size: 1.55rem;
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 30%, 100% 52%, calc(100% - 9px) 78%, calc(100% - 16px) 100%, 0 100%);
}
.h-banner .icon { width: 22px; height: 22px; }

/* ------------------------------------------------------------ Kacheln & Karten */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 16px 14px; min-height: 132px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  overflow: hidden; transition: border-color .15s, transform .15s;
}
.tile::after {
  content: ""; position: absolute; left: -10%; right: -10%; bottom: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  transform: skewX(-30deg) scaleX(.3); transform-origin: left; transition: transform .25s;
}
.tile:hover, .tile:active { border-color: var(--red-dk); }
.tile:hover::after, .tile:active::after { transform: skewX(-30deg) scaleX(1); }
.tile .icon { color: var(--red-hi); margin-bottom: 4px; }
.tile strong { font-family: var(--font-display); font-size: 1.45rem; letter-spacing: .02em; overflow-wrap: anywhere; hyphens: auto; }
.tile span { color: var(--ash); font-size: .82rem; line-height: 1.35; }

.stack, .grid { display: grid; gap: 12px; }
.card {
  position: relative; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--red-dk);
  border-radius: 4px;
}
.card h3 { margin-bottom: .25em; }
.card p { color: var(--ash); margin-bottom: .5em; }
.card time, .meta { color: var(--ash); font-size: .8rem; }
.meta .icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.card-alert { border-left-color: var(--ember); background: linear-gradient(90deg, rgba(217,130,43,.08), var(--surface) 40%); }
.chip {
  display: inline-block; margin-bottom: 6px; padding: 1px 9px;
  background: var(--red-dk); color: var(--bone); border-radius: 2px;
  font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.card-event { display: flex; gap: 14px; align-items: center; }
.datebox {
  flex: none; width: 56px; padding: 6px 0; text-align: center;
  background: var(--bg); border: 1px solid var(--red-dk); border-radius: 3px;
}
.datebox b { display: block; font: 400 1.9rem/1 var(--font-display); }
.datebox span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ember); }

.empty { color: var(--ash); padding: 1.4rem; text-align: center; border: 1px dashed var(--line); border-radius: 4px; }
.notice { padding: 12px 14px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); }
.notice-warn { border-color: var(--ember); }

/* Seitenkopf der Bereiche */
.page-head {
  padding: 2rem 0 1.6rem;
  background:
    linear-gradient(180deg, rgba(110,11,16,.35), transparent),
    var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.page-head .icon-lg { color: var(--red-hi); }
.page-head p { color: var(--ash); margin: 0; max-width: 60ch; }

/* ------------------------------------------------------------ Fußzeile */
.footer { margin-top: 2rem; padding: 2rem 0 1.4rem; text-align: center; border-top: 1px solid var(--line); background: var(--bg-2); }
.footer img { border-radius: 50%; opacity: .9; }
.footer-title { font-family: var(--font-display); font-size: 1.45rem; margin: .4rem 0; }
.footer-links { display: flex; gap: 18px; justify-content: center; }
.footer-links a { color: var(--ash); text-decoration: underline; text-underline-offset: 3px; }
.footer-small { color: var(--ash); font-size: .75rem; margin: 0; }

/* ------------------------------------------------------------ Untere Navigation (Handy, Tablet) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(20, 16, 14, .97);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.bottomnav a, .bottomnav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; color: var(--ash); font: 600 .66rem/1.1 var(--font-body);
  letter-spacing: .02em; cursor: pointer; padding: 0 2px; min-width: 0;
}
.bottomnav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottomnav .icon { width: 24px; height: 24px; }
.bottomnav a.is-active { color: #fff; }
.bottomnav a.is-active .icon { color: var(--red-hi); }
.bottomnav a.is-active::before {
  content: ""; position: absolute; top: 0; width: 34px; height: 3px; background: var(--red); transform: skewX(-30deg);
}
.bottomnav a { position: relative; }

/* "Mehr"-Blatt */
.sheet { position: fixed; inset: 0; z-index: 70; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.65); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 560px; margin-inline: auto;
  padding: 14px var(--gutter) calc(16px + var(--safe-b));
  background: var(--surface-2); border-top: 2px solid var(--red); border-radius: 14px 14px 0 0;
  animation: sheet-up .22s ease-out;
}
.sheet-panel ul { list-style: none; margin: 0 0 8px; padding: 0; }
.sheet-panel li a { display: flex; align-items: center; gap: 14px; min-height: 52px; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
.sheet-lang { display: flex; gap: 8px; margin: 12px 0; }
.sheet-lang a { flex: 1; text-align: center; padding: 10px 0; border: 1px solid var(--line); border-radius: 4px; font-weight: 700; }
.sheet-lang a[aria-current] { background: var(--red-dk); border-color: var(--red); }
.sheet-panel .btn { width: 100%; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------ Formulare */
.narrow { max-width: 520px; }
.lead { font-size: 1.1rem; }
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.editor { min-width: 0; max-width: 100%; }
.field > span { font-size: .85rem; font-weight: 600; letter-spacing: .04em; color: var(--bone); }
.field input, .field select, .search input, .form-inline select {
  width: 100%; min-height: 48px; padding: 10px 12px;
  background: var(--bg); color: var(--bone);
  border: 1px solid var(--line); border-radius: 4px;
  font: inherit; font-size: 16px;               /* 16px verhindert Zoomen auf dem iPhone */
}
.search-form { display: flex; gap: 8px; align-items: stretch; margin-bottom: 16px; max-width: 560px; }
.search-form input { flex: 1; min-width: 0; }
.search-form .btn { flex: none; min-width: 52px; justify-content: center; }
.topbar-search { padding: 0 10px; }
.topbar-search.is-active { border-color: var(--red); }
@media (max-width: 479px) {          /* narrow phones: make room for the search button next to the brand */
  .topbar .brand { gap: 8px; }
  .topbar-actions { gap: 4px; }
  .topbar .topbar-actions .btn-sm { padding: 0 7px; }
  .topbar .lang summary { padding: 0 8px; }
  .topbar .lang summary .icon { display: none; }      /* the language code is enough */
}
@media (max-width: 359px) {
  .topbar .brand img { width: 36px; height: 36px; }
  .topbar .brand-text strong { font-size: 1.25rem; }
}
mark { background: rgba(179, 18, 26, .55); color: #fff; border-radius: 2px; padding: 0 1px; }
.field input:focus, .field select:focus, .search input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 2px rgba(179,18,26,.35); }
.field.has-error input { border-color: var(--red-hi); }
.hint { color: var(--ash); font-size: .78rem; }
.field-error { color: #ff7b72; font-size: .85rem; font-weight: 600; }
.btn-block { width: 100%; }
.form-links { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; margin: 0; font-size: .9rem; }
.form-links a { color: var(--ash); text-decoration: underline; text-underline-offset: 3px; }
.form-inline { display: flex; gap: 10px; align-items: center; }
.form-inline select { flex: 1; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.flashes { padding-top: 14px; display: grid; gap: 8px; }
.flashes .notice { margin: 0; font-weight: 600; }
.notice-ok { border-color: #2f7d4a; background: rgba(47,125,74,.15); }
.notice-err { border-color: var(--red-hi); background: rgba(179,18,26,.18); }

.meter { height: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--red-dk), var(--red-hi)); }

/* ------------------------------------------------------------ Verwaltung */
.subnav { background: var(--bg-2); border-bottom: 1px solid var(--line); position: sticky; top: 57px; z-index: 40; }
.subnav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.subnav a { flex: none; padding: 12px 14px; color: var(--ash); font-weight: 600; font-size: .9rem; border-bottom: 3px solid transparent; }
.subnav a.is-active { color: #fff; border-bottom-color: var(--red); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0 22px; }
.stat { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; text-align: center; }
.stat b { display: block; font: 400 2.4rem/1 var(--font-display); color: var(--bone); }
.stat span { color: var(--ash); font-size: .8rem; }

.toolbar { display: grid; gap: 10px; margin-bottom: 14px; }
.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.pill { flex: none; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--ash); }
.pill.is-active { background: var(--red-dk); border-color: var(--red); color: #fff; }

.user-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.user-card header h3 { overflow-wrap: anywhere; }
.user-card header h3 small { color: var(--ash); font-family: var(--font-body); font-size: .75rem; }
.user-card .chip { flex: none; }
.user-card .meta { overflow-wrap: anywhere; }
.user-form { margin-top: 10px; gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.chip-pending_admin { background: var(--ember); color: #1a0f05; }
.chip-pending_email { background: var(--line); }
.chip-active { background: #2f7d4a; }
.chip-blocked { background: var(--red); }
.status-pending_admin { border-left-color: var(--ember); }
.status-blocked { opacity: .8; }

.table-scroll { overflow-x: auto; margin: 0 calc(var(--gutter) * -1) 16px; padding: 0 var(--gutter); }
.matrix { width: 100%; min-width: 600px; border-collapse: collapse; }
.matrix th, .matrix td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.matrix tbody th { font-size: .85rem; width: 34%; min-width: 150px; }
.matrix thead th { color: var(--ash); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.matrix tbody th { text-align: left; font-weight: 500; }
.matrix input[type=checkbox] { width: 26px; height: 26px; accent-color: var(--red); }
.matrix-storage input { width: 90px; min-height: 40px; padding: 6px 8px; background: var(--bg); color: var(--bone); border: 1px solid var(--line); border-radius: 4px; font-size: 16px; text-align: center; }

.sheet-logout button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 14px; min-height: 52px; width: 100%; font-size: 1.05rem; cursor: pointer; }

/* ------------------------------------------------------------ Beiträge */
.icon-xs { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.head-action { margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.chips .chip { margin: 0; }
.chip-pin { background: var(--ember); color: #1a0f05; }
.chip-draft { background: var(--line); color: var(--bone); border: 1px dashed var(--ash); }
.chip-lock { background: transparent; border: 1px solid var(--red); color: var(--bone); }
.pills { margin-bottom: 16px; }
.card-post { padding-bottom: 12px; }
.card-link::after { content: ""; position: absolute; inset: 0; }   /* ganze Karte anklickbar */
.card-link:hover { color: var(--red-hi); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; }

.article-head h1 { margin-top: 4px; overflow-wrap: anywhere; }
.crumb { margin: 0 0 8px; font-size: .85rem; }
.crumb a { color: var(--ash); }
.narrow-read { max-width: 760px; }

.prose { font-size: 1.05rem; line-height: 1.7; overflow-wrap: anywhere; }
.prose h2 { margin-top: 1.6em; font-size: 2rem; color: #fff; }
.prose h3 { margin-top: 1.4em; font-size: 1.6rem; color: var(--bone); }
.prose a { color: var(--ember); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: .3em; }
.prose blockquote { margin: 1em 0; padding: .6em 1em; border-left: 3px solid var(--red); background: var(--surface); color: var(--ash); }
.prose hr { border: 0; height: 3px; margin: 1.6em 0; background: linear-gradient(90deg, transparent, var(--red), transparent); transform: skewX(-30deg); }
.prose code { padding: 1px 6px; background: var(--surface-2); border-radius: 3px; font-size: .9em; }
.owner-actions { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.owner-actions form { margin: 0; }
.btn-danger { border-color: var(--red-dk); color: #ff9189; }

.comment header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment header time { margin-left: auto; }
.comment-body { color: var(--bone) !important; margin-bottom: 6px !important; overflow-wrap: anywhere; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--ash); font: inherit; font-size: .8rem; text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--red-hi); }
.comment-form { margin-top: 18px; }
textarea {
  width: 100%; padding: 10px 12px; background: var(--bg); color: var(--bone);
  border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: 16px; line-height: 1.5; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 2px rgba(179,18,26,.35); }

/* Editor */
.editor { border: 1px solid var(--line); border-radius: 4px; background: var(--bg); }
.editor:focus-within { border-color: var(--red); }
.editor-bar { display: flex; gap: 4px; padding: 6px; overflow-x: auto; scrollbar-width: none; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 56px; z-index: 5; }
.editor-bar button {
  flex: none; min-width: 42px; height: 42px; padding: 0 10px;
  background: var(--surface-2); color: var(--bone); border: 1px solid var(--line); border-radius: 4px;
  font: 600 .9rem var(--font-body); cursor: pointer;
}
.editor-bar button:active, .editor-bar button:hover { border-color: var(--red); background: var(--red-dk); }
.editor-bar .icon { width: 18px; height: 18px; vertical-align: -3px; }
.editor-toggle { margin-left: auto; padding: 0 14px !important; }
.editor textarea { border: 0; border-radius: 0; box-shadow: none !important; min-height: 280px; }
.editor-preview { padding: 14px; min-height: 280px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--red); }

/* ------------------------------------------------------------ Zeitung */
.masthead { padding: 1.6rem 0 1.4rem; text-align: center; background: linear-gradient(180deg, rgba(110,11,16,.3), transparent), var(--bg-2); border-bottom: 1px solid var(--line); }
.masthead .crumb { text-align: left; }
.masthead-kicker { margin: 0; color: var(--ember); font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; }
.masthead h1 { margin: .25em 0 .35em; padding: .3em 0; border-top: 3px double var(--line); border-bottom: 3px double var(--line); font-size: clamp(2rem, 8vw, 3.4rem); overflow-wrap: anywhere; }
.masthead-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; align-items: center; margin: 0; color: var(--ash); font-size: .9rem; }
.masthead-meta .chip { margin: 0; }

.issue-card { position: relative; padding: 16px 16px 12px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: 3px; }
.issue-card.is-draft { border-top-style: dashed; }
.issue-no { margin: 0 0 4px; color: var(--ember); font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.issue-card h3 { font-size: 1.7rem; }
.issue-card .chips { margin: 6px 0 0; }

.toc { list-style: none; margin: 0 0 18px; padding: 0; counter-reset: toc; display: grid; gap: 12px; }
.toc-item { position: relative; counter-increment: toc; padding: 12px 14px 12px 52px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.toc-item::before { content: counter(toc); position: absolute; left: 12px; top: 10px; width: 30px; text-align: center; font: 700 1.6rem/1 var(--font-display); color: var(--red-hi); }
.toc-item h3 { margin-bottom: .2em; }
.toc-item p { color: var(--ash); margin-bottom: .3em; }
.toc-item .chip { margin-left: 6px; vertical-align: middle; }

/* ------------------------------------------------------------ Events */
.card-event-body { min-width: 0; flex: 1; }
.card-event-body .chips { margin: 6px 0 0; }
.chip-yes { background: #2f7d4a; }
.chip-mine.chip-yes { background: #2f7d4a; }
.chip-mine.chip-maybe { background: var(--ember); color: #1a0f05; }
.chip-mine.chip-no { background: var(--line); }

.facts { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; color: var(--bone); }
.facts .icon { color: var(--red-hi); margin-top: 2px; }
.facts small { color: var(--ash); }

.rsvp { margin-top: 28px; }
.rsvp-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.rsvp-btn {
  min-height: 56px; padding: 6px 8px; background: var(--surface); color: var(--bone);
  border: 2px solid var(--line); border-radius: 4px; font: 700 .9rem/1.15 var(--font-body); cursor: pointer;
}
.rsvp-btn:hover { border-color: var(--ash); }
.rsvp-yes.is-on { background: #2f7d4a; border-color: #4aa56a; color: #fff; }
.rsvp-maybe.is-on { background: var(--ember); border-color: #f0a050; color: #1a0f05; }
.rsvp-no.is-on { background: var(--red-dk); border-color: var(--red-hi); color: #fff; }
.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.count { padding: 10px 6px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.count b { display: block; font: 400 2.2rem/1 var(--font-display); }
.count span { font-size: .75rem; color: var(--ash); }
.count-yes b { color: #5fc07f; } .count-maybe b { color: var(--ember); } .count-no b { color: #ff7b72; }
.names { margin: 0 0 8px; overflow-wrap: anywhere; }
.names-yes strong { color: #5fc07f; } .names-maybe strong { color: var(--ember); } .names-no strong { color: #ff7b72; }

.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.month-nav h2 { margin: 0; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 22px; }
.cal-head { padding: 4px 0; text-align: center; color: var(--ash); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.cal-day {
  position: relative; min-height: 52px; padding: 5px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 3px; color: var(--ash);
}
.cal-day b { font-weight: 600; font-size: .9rem; }
.cal-empty { background: transparent; border-color: transparent; }
.cal-day.is-today { border-color: var(--ember); color: var(--bone); }
.cal-day.has-events { color: var(--bone); border-color: var(--red-dk); background: linear-gradient(180deg, rgba(110,11,16,.35), var(--surface)); }
.cal-day.has-events:hover { border-color: var(--red-hi); }
.dots { display: flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--red-hi); }
.month-list .card-event { scroll-margin-top: 80px; }
input[type=datetime-local] { color-scheme: dark; }

/* ------------------------------------------------------------ Galerie */
.album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.album-card { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.album-cover { position: relative; aspect-ratio: 4 / 3; background: var(--bg-2); overflow: hidden; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.album-card:hover .album-cover img { transform: scale(1.04); }
.album-cover-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--line); }
.album-info { padding: 10px 12px 12px; }
.album-info h3 { font-size: 1.05rem; margin-bottom: .1em; overflow-wrap: anywhere; }
.chip-vis { position: absolute; left: 8px; top: 8px; margin: 0; background: rgba(13,10,9,.85); border: 1px solid var(--line); }
.chip-v-private { border-color: var(--red); } .chip-v-roles { border-color: var(--ember); }
.page-head .chip-vis { position: static; display: inline-block; }

.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.thumb { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: var(--bg-2); border-radius: 2px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s, opacity .25s; }
.thumb:hover img { transform: scale(1.06); }

.upload-box { margin-bottom: 14px; }
.upload-pick { cursor: pointer; width: 100%; }
.upload-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.upload-list li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 3px; font-size: .85rem; }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-msg { color: var(--ash); font-size: .78rem; }
.up-track { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.up-track i { display: block; height: 100%; width: 0; background: var(--red-hi); transition: width .15s; }
.upload-list li.is-ok .up-track i { background: #4aa56a; } .upload-list li.is-ok .up-msg { color: #5fc07f; }
.upload-list li.is-err { border-color: var(--red-hi); } .upload-list li.is-err .up-msg { color: #ff7b72; font-weight: 600; }

.vis-choice, #roles-box { border: 0; padding: 0; margin: 0; }
.vis-choice legend, #roles-box legend { padding: 0; margin-bottom: 6px; }
#roles-box[hidden] { display: none; }
.radio { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; margin-bottom: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--red); background: rgba(110,11,16,.3); }
.radio input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--red); flex: none; }
.radio span { display: grid; gap: 2px; }
.radio small { color: var(--ash); font-size: .8rem; }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: rgba(5,3,3,.985); }
.lb[hidden] { display: none; }
.lb-top { display: flex; align-items: center; gap: 8px; padding: 10px max(12px, env(safe-area-inset-left)); padding-top: max(10px, env(safe-area-inset-top)); color: var(--bone); }
.lb-count { font-size: .85rem; color: var(--ash); }
.lb-note { flex: 1; font-size: .8rem; color: var(--ember); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-btn { min-height: 40px; padding: 0 12px; background: var(--surface-2); color: var(--bone); border: 1px solid var(--line); border-radius: 4px; font: 600 .8rem var(--font-body); cursor: pointer; }
.lb-btn[hidden] { display: none; }
.lb-del { border-color: var(--red-dk); color: #ff9189; }
.lb-close { font-size: 1.1rem; min-width: 44px; }
.lb-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 8px 12px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 72px; background: rgba(13,10,9,.55); color: #fff; border: 0; font-size: 2.2rem; cursor: pointer; border-radius: 4px; }
.lb-nav[hidden] { display: none; }
.lb-prev { left: 4px; } .lb-next { right: 4px; }

/* ------------------------------------------------------------ Bilder in Beiträgen, Titelbilder */
.md-img { margin: 1.4em 0; }
.md-img img { display: block; width: 100%; height: auto; border-radius: 3px; border: 1px solid var(--line); background: var(--bg-2); }
.md-img figcaption { margin-top: 6px; color: var(--ash); font-size: .85rem; text-align: center; }
.editor-status { margin: 0; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); color: var(--ember); font-size: .85rem; }
.editor-status[hidden] { display: none; }
.editor-status.is-err { color: #ff7b72; font-weight: 600; }
.cover-preview { display: block; max-width: 100%; max-height: 220px; border-radius: 3px; border: 1px solid var(--line); }
.cover-preview[hidden] { display: none; }
.cover-box .btn-row { margin-top: 4px; }
.issue-cover { margin: -16px -16px 12px; aspect-ratio: 3 / 2; overflow: hidden; background: var(--bg-2); border-radius: 2px 2px 0 0; }
.issue-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.masthead-cover { margin: 14px auto 0; max-width: 520px; }
.masthead-cover img { width: 100%; height: auto; display: block; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.5); }

/* ------------------------------------------------------------ Übersetzung */
.tr-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ember); border-radius: 3px; color: var(--ash); font-size: .85rem; }
.tr-note .icon { color: var(--ember); margin-top: 1px; }
.tr-note a { margin-left: 6px; color: var(--bone); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.tr-mark { color: var(--ember); line-height: 1; }
.usage-bar { height: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; position: relative; }
.usage-bar i { display: block; height: 100%; background: linear-gradient(90deg, #2f7d4a, var(--ember)); }
.usage-bar.is-high i { background: linear-gradient(90deg, var(--ember), var(--red-hi)); }
.usage-bar b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bone); opacity: .7; }
.term-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.term-list li { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.term-list form { margin: 0; }
.term-list button { background: none; border: 0; color: var(--ash); font-size: 1.1rem; line-height: 1; padding: 4px 6px; cursor: pointer; }
.term-list button:hover { color: var(--red-hi); }

/* ------------------------------------------------------------ System */
.sys { width: 100%; border-collapse: collapse; }
.sys th, .sys td { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: left; font-size: .9rem; }
.sys th { color: var(--ash); font-weight: 500; width: 46%; }
.ok-mark { color: #5fc07f; font-weight: 700; } .bad-mark { color: #ff7b72; font-weight: 700; }
.copy-field { width: 100%; padding: 10px 12px; background: var(--bg); color: var(--bone); border: 1px solid var(--line); border-radius: 4px; font: .8rem ui-monospace, Menlo, monospace; }
code { padding: 1px 5px; background: var(--surface-2); border-radius: 3px; font-size: .88em; }

/* ------------------------------------------------------------ Lange Wörter dürfen nie die Seite verbreitern */
h1, h2, h3, p, li, td, th, .card, .issue-card, .toc-item, .album-info, .prose, .meta, .tr-note, .notice, .chip { overflow-wrap: anywhere; }
.grid > *, .stack > *, .two-col > *, .tiles > *, .toc > *, .thumbs > * { min-width: 0; }
.two-col { min-width: 0; }

/* ------------------------------------------------------------ Intro-Video */
.intro { display: none; position: fixed; inset: 0; z-index: 200; background: #000; align-items: center; justify-content: center; transition: opacity .45s ease; }
html.intro-on .intro { display: flex; }
html.intro-on body { overflow: hidden; }
.intro.is-leaving { opacity: 0; pointer-events: none; }
.intro video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.intro-ui { position: absolute; top: 0; right: 0; left: 0; display: flex; justify-content: space-between; gap: 10px; padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); pointer-events: none; }
.intro-btn { pointer-events: auto; min-height: 44px; padding: 0 16px; background: rgba(13,10,9,.72); color: var(--bone); border: 1px solid rgba(232,224,210,.35); border-radius: 4px; font: 600 .85rem var(--font-body); letter-spacing: .04em; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.intro-btn:hover, .intro-btn:focus-visible { border-color: var(--red-hi); background: rgba(110,11,16,.85); color: #fff; }
.intro-skip { margin-left: auto; text-transform: uppercase; }
.intro-play { position: absolute; width: 88px; height: 88px; border-radius: 50%; border: 2px solid var(--bone); background: rgba(13,10,9,.7); color: var(--bone); font-size: 2rem; cursor: pointer; }
.intro-play[hidden] { display: none; }
.intro-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.12); }
.intro-bar i { display: block; height: 100%; width: 0; background: var(--red-hi); }

.intro-preview { width: 100%; max-height: 320px; background: #000; border-radius: 3px; }

/* ------------------------------------------------------------ Tablet */
@media (min-width: 700px) {
  :root { --gutter: 28px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cal-day { min-height: 76px; }
  .toolbar { grid-template-columns: 1fr 280px; align-items: center; }
  .hero { min-height: 680px; }
  .hero-bg { object-position: 50% 0; }
  .hero-inner { padding-top: 12rem; }
  .hero-logo { width: 340px; }
  .two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
  .bottomnav a, .bottomnav button { font-size: .75rem; }
  .brand-text strong { font-size: 1.7rem; }
}

/* ------------------------------------------------------------ Desktop */
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .album-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .thumbs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tile { min-height: 170px; }
}

/* Die Menüleiste oben braucht Platz (7 Bereiche): darunter bleibt die untere Leiste mit "Mehr" */
@media (min-width: 1180px) {
  body { padding-bottom: 0; }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .bottomnav, .sheet { display: none !important; }
  .topnav { display: flex; gap: 2px; margin-left: 16px; min-width: 0; }
  .topnav a {
    position: relative; padding: 10px 8px; font-weight: 600; font-size: .85rem; letter-spacing: .02em; color: var(--ash); white-space: nowrap;
  }
  .topnav a:hover, .topnav a.is-active { color: #fff; }
  .topnav a.is-active::after {
    content: ""; position: absolute; left: 8px; right: 8px; bottom: 2px; height: 3px; background: var(--red); transform: skewX(-30deg);
  }
}
@media (min-width: 1400px) {
  .topnav { gap: 4px; margin-left: 20px; }
  .topnav a { padding: 10px 12px; font-size: .9rem; letter-spacing: .03em; }
  .topnav a.is-active::after { left: 10px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Emoji-Auswahl (Editor und Kommentare) */
.emoji-row { margin: 8px 0; }
.emoji-panel { border: 1px solid var(--line); background: var(--surface); border-radius: 4px; margin: 6px 0 10px; }
.editor .emoji-panel { border-width: 0 0 1px; border-radius: 0; margin: 0; }
.emoji-tabs { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.emoji-tab, .emoji-pick { font: 1.35rem/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer; color: inherit; }
.emoji-tab { min-width: 44px; min-height: 40px; }
.emoji-tab[aria-pressed="true"] { border-color: var(--red); background: var(--red-dk); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 2px; padding: 6px; max-height: 188px; overflow-y: auto; }
.emoji-pick { min-height: 44px; }
.emoji-pick:hover, .emoji-pick:active { border-color: var(--red); background: var(--red-dk); }
.editor-bar button[data-emoji-for] { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.emoji-panel[hidden], .emoji-grid[hidden] { display: none; }

/* Tabellen in Texten (Markdown) und Inhaltsverzeichnis */
.prose .table-scroll { margin: 0 0 1.2em; padding: 0; }
.md-table { border-collapse: collapse; width: 100%; font-size: .95rem; line-height: 1.45; }
.md-table th, .md-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.md-table th { background: var(--surface-2); color: #fff; }
.toc-list { margin: 0; padding-left: 1.3em; }
.toc-list li { margin: .3em 0; }
.prose h2 { scroll-margin-top: 70px; }

/* ---- Allianz Mitglieder ---- */
button.pill { background: transparent; cursor: pointer; font-family: inherit; min-height: 40px; }
.alliance-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.alliance-tools .pills { margin-bottom: 0; }
.alliance-table { width: 100%; border-collapse: collapse; min-width: 560px; font-variant-numeric: tabular-nums; }
.alliance-table th, .alliance-table td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.alliance-table thead th { color: var(--ash); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; background: var(--surface); }
.alliance-table thead th a { color: inherit; }
.alliance-table thead th a:hover { color: #fff; }
.alliance-table tbody th { font-weight: 600; }
.alliance-table tbody th a { color: var(--bone); }
.alliance-table tbody th a:hover { color: #fff; text-decoration: underline; }
.alliance-table .num { text-align: right; white-space: nowrap; }
.alliance-table .num-empty { color: var(--ash); }
.alliance-table tbody tr:hover { background: rgba(255,255,255,.03); }
/* Namensspalte bleibt beim seitlichen Wischen stehen */
.alliance-table thead th:first-child, .alliance-table tbody th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.alliance-table tbody th:first-child { max-width: 10.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.alliance-table tbody th:first-child a { overflow-wrap: normal; }
.alliance-add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 8px; }
.alliance-edit input[type=text] { width: 100%; min-width: 7em; min-height: 40px; padding: 6px 8px; background: var(--bg); color: var(--bone); border: 1px solid var(--line); border-radius: 4px; font-size: 16px; }
.alliance-edit tbody th input { min-width: 11em; }
.alliance-edit input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 2px rgba(179,18,26,.35); }
.alliance-edit input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--red); }
.alliance-edit .has-error input { border-color: var(--red-hi); }
.alliance-add { margin-bottom: 18px; }
.alliance-preview { min-width: 480px; }
.alliance-preview .row-error { background: rgba(179,18,26,.12); }
.alliance-preview .row-warn { background: rgba(217,130,43,.1); }
.alliance-preview .row-same { opacity: .65; }
.alliance-preview s { color: var(--ash); }
.alliance-preview .similar { margin-top: 8px; }
.alliance-preview .similar .check { min-height: 36px; }
.chip-new { background: #2f7d4a; }
.chip-changed { background: var(--red-dk); }
.chip-same { background: var(--line); }
.chip-warn { background: var(--ember); color: #1a0f05; }
.chip-err { background: var(--red-hi); }
.alliance-table tbody th.pv-name { white-space: normal; max-width: 16rem; overflow: visible; }
.pv-status { margin-top: 6px; font-weight: 400; display: flex; flex-wrap: wrap; gap: 4px; }
.pv-status .similar { flex-basis: 100%; }

/* Allianz: Verlaufs-Diagramm (4 Team-Farben, auf dunklem Grund gut unterscheidbar; Linien 2px, Punkte 7px) */
.alliance-chart-box { margin-bottom: 18px; }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 0 0 8px; }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; color: var(--bone); font-size: .9rem; }
.chart-legend .sw { width: 14px; height: 4px; border-radius: 2px; background: currentColor; }
.alliance-chart { display: block; width: 100%; height: auto; max-height: 340px; }
.alliance-chart .grid { stroke: var(--line); stroke-width: 1; }
.alliance-chart .tick { fill: var(--ash); font-size: 11px; font-family: var(--font-body); }
.alliance-chart .s polyline { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.alliance-chart .s .dot { fill: currentColor; stroke: var(--surface); stroke-width: 2; }
.alliance-chart .s .hit { fill: transparent; }
.alliance-chart .s .hit:hover { fill: rgba(255,255,255,.12); }
.s1 { color: #5aa9e6; } .s2 { color: #e0903a; } .s3 { color: #62c283; } .s4 { color: #b891e8; }

/* Vorschau: Felder von Hand änderbar */
.alliance-preview input[type=text] { width: 100%; min-width: 7em; min-height: 40px; padding: 6px 8px; background: var(--bg); color: var(--bone); border: 1px solid var(--line); border-radius: 4px; font-size: 16px; }
.alliance-preview .num input[type=text] { text-align: right; min-width: 8.5em; }
.alliance-preview tbody th input[type=text] { min-width: 11em; }
.alliance-preview input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 2px rgba(179,18,26,.35); }
.alliance-preview input[type=checkbox], .alliance-preview input[type=radio] { accent-color: var(--red); }
.alliance-preview .row-error input[type=text] { border-color: var(--red-hi); }
.alliance-preview .row-skip { opacity: .55; }
.alliance-preview .pv-skip { min-height: 32px; font-weight: 400; font-size: .85rem; margin-top: 4px; }
.alliance-preview .pv-old { display: block; color: var(--ash); font-size: .78rem; margin-top: 2px; text-align: right; }
.chip-skip { background: var(--line); }

/* Diagramm-Legende als Knöpfe: Team anklicken = nur dieses Team zeigen */
.legend-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px; background: transparent; color: var(--bone); border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: .9rem; cursor: pointer; }
.legend-btn:hover { border-color: var(--ash); }
.legend-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(179,18,26,.6); }
.legend-btn.is-active { background: var(--surface-2); border-color: var(--bone); }
.chart-legend:has(.legend-btn.is-active:not([data-team="all"])) .legend-btn:not(.is-active) { opacity: .55; }
.chart-view[hidden] { display: none; }

/* Allianz: Tracker-Abgleich */
.tracker-card { margin-bottom: 18px; }
.tracker-facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px 14px; margin: 0 0 12px; }
.tracker-facts dt { color: var(--ash); }
.tracker-facts dd { margin: 0; overflow-wrap: anywhere; }
.tracker-error { color: var(--red-hi); }
.tracker-good { color: #5fc07f; }
@media (max-width: 480px) {
  #autolog .tracker-facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  #autolog .tracker-facts dd { margin-bottom: 10px; }
}
.tracker-declaration { white-space: normal; overflow-wrap: anywhere; }
.tracker-link { margin-bottom: 12px; max-width: 34rem; }
.tracker-link .chip { margin-left: 6px; font-style: normal; }
.tracker-dump { width: 100%; max-width: 100%; padding: 10px; background: var(--bg); color: var(--bone); border: 1px solid var(--line); border-radius: 4px; font: 13px/1.5 ui-monospace, Menlo, monospace; }
.tracker-teams .row-same { opacity: .65; }
.tracker-teams .pv-old { display: block; color: var(--ash); font-size: .78rem; margin-top: 2px; }
.tracker-take { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.tracker-take input { width: 22px; height: 22px; flex: none; accent-color: var(--red); }
.tracker-teams tbody th:first-child { white-space: normal; max-width: 12rem; }
.alliance-table .num.up { color: #6fcf7f; }
.alliance-table .num.down { color: var(--red-hi); }
.alliance-table .pv-since { display: block; color: var(--ash); font-size: .75rem; font-weight: 400; }
.tracker-changes { max-width: 34rem; }
.tracker-changes dd .meta { display: block; }
.tracker-events .nowrap { white-space: nowrap; }
.tracker-events .ev-detail { display: inline-block; margin-left: 6px; overflow-wrap: anywhere; }
.alliance-tools { flex-wrap: wrap; }
.tracker-pills a.pill { display: inline-flex; align-items: center; min-height: 40px; }
.tracker-events { min-width: 0; }
.tracker-events .chip + .ev-detail { margin-top: 4px; }

/* Member dossier */
.dossier-head .wrap { text-align: center; }
.dossier-avatar { display: inline-flex; align-items: center; justify-content: center; width: 84px; height: 84px; margin-bottom: 10px; border: 2px solid var(--red); border-radius: 14px; background: var(--surface-2); color: var(--bone); font-family: var(--font-head, inherit); font-size: 2.6rem; }
.dossier-head h1 { overflow-wrap: anywhere; }
.dossier-head p { margin-left: auto; margin-right: auto; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.dossier-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 24px; }
.dossier-tiles > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.dossier-tiles > .wide { grid-column: 1 / -1; }
.dossier-tiles dt { color: var(--ash); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.dossier-tiles dd { margin: 4px 0 0; font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.dossier-tiles dd.dossier-uid { font-size: .95rem; line-height: 1.6; }   /* 12 digits on one line */
.dossier-squads { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 18px; }
.squad-card { min-width: 0; padding: 14px; }
.squad-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.squad-card h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.squad-no { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; background: var(--red); color: #fff; font-family: var(--font-body); font-size: .85rem; }
.squad-power { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.squad-power span { display: block; color: var(--ash); font-size: .7rem; text-transform: uppercase; }
.squad-power strong { font-size: 1.25rem; }
.hero-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; list-style: none; padding: 0; margin: 12px 0; text-align: center; }
.hero-tile { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border: 1px solid var(--red-dk); border-radius: 8px; background: var(--surface-2); font-size: 1.3rem; font-weight: 700; }
.hero-tile em { position: absolute; font-style: normal; font-size: .68rem; line-height: 1; padding: 2px 4px; border-radius: 4px; }
.hero-lv { bottom: 2px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.75); color: #fff; }
.hero-awaken { top: 2px; right: 2px; background: var(--red); color: #fff; }
.hero-name { display: block; margin-top: 4px; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-stars { display: block; color: #e0a43a; font-size: .72rem; }
.squad-soldiers { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: .85rem; }
.squad-soldiers progress { flex: 1; min-width: 40px; height: 6px; accent-color: var(--red); }
.squad-troops { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.dossier-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.hero-tile { padding-bottom: 14px; }
.hero-tile em { white-space: nowrap; }
/* Hero pictures */
.hero-tile.has-image { padding: 0; overflow: hidden; }
.hero-tile img { width: 100%; height: 100%; object-fit: cover; }
.hero-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-bottom: 18px; }
.hero-edit { display: flex; gap: 12px; align-items: flex-start; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.hero-edit > .hero-tile { flex: none; width: 72px; height: 72px; padding-bottom: 0; }
.hero-fields { flex: 1; min-width: 0; }
.hero-fields .field { margin-bottom: 6px; }
.hero-fields .meta { display: block; margin-bottom: 8px; }
.hero-file { display: block; font-size: .85rem; }
.hero-file input { display: block; max-width: 100%; margin-top: 4px; }
/* Alliance comparison */
.tracker-compare .is-own th, .tracker-compare .is-own td { background: rgba(179,18,26,.18); }
.tracker-compare .is-own th { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--red), 1px 0 0 var(--line); }
.tracker-compare .nowrap { white-space: nowrap; }
.tracker-compare .pv-since { white-space: normal; }
.alliance-table.tracker-compare { min-width: 900px; }
.tracker-compare .btn { white-space: nowrap; overflow-wrap: normal; min-height: 40px; padding: 6px 12px; font-size: .75rem; }
/* Hive map */
.hive-box { padding: 8px; margin-bottom: 18px; overflow: auto; max-width: 760px; }
.hive-map { display: block; width: 100%; min-width: 560px; height: auto; }
.hive-map .grid { stroke: var(--line); stroke-width: 1; }
.hive-map .tick { fill: var(--ash); font-size: 11px; font-family: var(--font-body); }
.hive-map .radius { fill: rgba(179,18,26,.08); stroke: var(--red); stroke-dasharray: 5 5; }
.hive-map .spot circle { fill: var(--red); stroke: var(--surface); stroke-width: 1.5; }
.hive-map .spot.out circle { fill: #6b5a52; }
.hive-map .spot text { fill: #fff; font-size: 9.5px; font-weight: 700; font-family: var(--font-body); }
.hive-map .spot:hover circle, .hive-map .spot:focus circle { stroke: #fff; }
.alliance-table.hive-list { min-width: 0; }
.hive-list tbody th:first-child { max-width: 12rem; }
.hive-no { display: inline-block; min-width: 1.9em; color: var(--ash); font-variant-numeric: tabular-nums; }
.hive-list tr.is-out td, .hive-list tr.is-out th { color: var(--ash); }
@media (max-width: 480px) {
  .alliance-table.hive-list th, .alliance-table.hive-list td { padding-left: 7px; padding-right: 7px; }
  .hive-list tbody th:first-child { max-width: 9.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* strongest hero on the member page */
.top-hero { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--ember); border-radius: 10px; background: linear-gradient(90deg, rgba(217,130,43,.16), var(--surface) 70%); }
.top-hero > .hero-tile { flex: none; width: 68px; height: 68px; border-color: var(--ember); padding-bottom: 14px; }
.top-hero > .hero-tile.has-image { padding: 0; }
.top-hero .hero-awaken { background: var(--ember); color: #1a1007; font-weight: 700; }
.top-hero > div { min-width: 0; }
.top-hero p { margin: 0; overflow-wrap: anywhere; }
.top-hero-label { color: var(--ember); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.top-hero-name { font-size: 1.2rem; font-weight: 700; }
.top-hero-facts { color: var(--ash); font-size: .85rem; }

