/* Waffenbuch - eine einzige Stylesheet-Datei.
   Nur Flexbox, kein Grid: die Buchvorschau und der PDF-Renderer muessen es
   auch koennen. Immer gap UND margin setzen, weil gap nicht ueberall greift.
   Keine Schriften von fremden Servern. */

:root {
  --grund: #faf9f7;
  --flaeche: #ffffff;
  --text: #1f2328;
  --grau: #6b7178;
  --linie: #dcd8d2;
  --akzent: #5a4632;          /* Nussbraun, wie ein Schaft */
  --akzent-hell: #f0ece5;
  --warn: #8a2b2b;
  --warn-hell: #fbf1f1;
  --gut: #2f6b45;
  --alt: #7a5c2e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--grund);
}

a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------- Kopf */

.kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  padding: 10px 18px;
  background: #2b2320;
  color: #f3efe9;
  border-bottom: 3px solid var(--akzent);
}
.marke {
  font-size: 17px; font-weight: 700; letter-spacing: .02em;
  color: #f3efe9; margin-right: 6px;
}
.marke:hover { text-decoration: none; color: #fff; }
.kopf-untertitel { font-size: 12px; color: #b6ac9e; margin-right: 12px; }
.kopf-rest { flex: 1 1 auto; margin: 0 8px; }
.rolle { font-size: 12px; color: #d9d1c6; margin-right: 10px; }
.rolle-eigentuemer::before { content: "◆ "; color: #d8b26a; }
.rolle-sachverstaendiger::before { content: "◇ "; }
.rolle-gast::before { content: "○ "; }

/* ------------------------------------------------------------------ Rumpf */

.rumpf { display: flex; flex-wrap: wrap; gap: 0; margin: 0; align-items: stretch; }

.leiste {
  flex: 0 0 210px;
  min-width: 180px;
  margin: 0;
  padding: 14px 10px 40px;
  background: var(--flaeche);
  border-right: 1px solid var(--linie);
}
.leiste details { margin-bottom: 6px; }
.leiste summary {
  cursor: pointer; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--grau); padding: 5px 6px; list-style: none;
}
.leiste summary::-webkit-details-marker { display: none; }
.leiste summary::before { content: "▸ "; }
.leiste details[open] summary::before { content: "▾ "; }
.leiste ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 12px; }
.leiste li { margin: 1px 0; }
.leiste a {
  display: block; padding: 4px 8px; color: var(--text);
  font-size: 13px; border-radius: 4px;
}
.leiste a:hover { background: var(--akzent-hell); text-decoration: none; }
.leiste a.aktiv { background: var(--akzent); color: #fff; font-weight: 600; }

.inhalt {
  flex: 1 1 520px;
  min-width: 0;
  margin: 0;
  padding: 18px 22px 60px;
}

/* ----------------------------------------------------------- Ueberschriften */

h1 { font-size: 22px; margin: 0 0 2px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 14px; margin: 0 0 8px; font-weight: 700;
     text-transform: uppercase; letter-spacing: .05em; color: var(--akzent); }
.unter { margin: 0 0 16px; color: var(--grau); font-size: 13px; }
.brotkrume { margin: 0 0 4px; font-size: 12px; color: var(--grau); }
.klein { font-size: 12px; color: var(--grau); }
.grau { color: var(--grau); }
.bruch { word-break: break-all; }
.fundstelle { font-size: 12px; color: var(--akzent); font-style: italic; margin: -4px 0 8px; }

/* ---------------------------------------------------------------- Bausteine */

.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 6px;
  margin: 0 0 14px;
  padding: 14px 16px;
}
.reihe { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 0; }
.reihe > * { margin-bottom: 14px; }
.wachsend { flex: 1 1 320px; min-width: 260px; }
.mitte-schmal { max-width: 420px; margin: 40px auto; }

.hinweis {
  background: var(--akzent-hell);
  border-left: 3px solid var(--akzent);
  padding: 9px 12px; margin: 10px 0 0;
  font-size: 12.5px; line-height: 1.5; color: #4a3f33;
}
.warnung {
  background: var(--warn-hell);
  border-left: 3px solid var(--warn);
  padding: 9px 12px; margin: 10px 0;
  font-size: 12.5px; line-height: 1.5; color: #6d2323;
}
.hinweis a, .warnung a { color: inherit; text-decoration: underline; }

/* ------------------------------------------------------------------ Tabellen */

table { border-collapse: collapse; width: 100%; margin: 0 0 4px; }
th, td { text-align: left; padding: 5px 8px 5px 0; vertical-align: top;
         border-bottom: 1px solid var(--linie); }
th { font-size: 11px; font-weight: 700; color: var(--grau);
     text-transform: uppercase; letter-spacing: .04em; }
table.schmal th { width: 34%; text-transform: none; font-size: 12px; letter-spacing: 0; }
table.schmal th.zahl { width: auto; }
table.breit { font-size: 13px; }
.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.summe td { font-weight: 700; border-top: 2px solid var(--linie); border-bottom: none; }
tr.erledigt { opacity: .45; }
tr.erledigt td { text-decoration: line-through; }
tr.prio1 td:first-child, tr.prio2 td:first-child { color: var(--warn); font-weight: 700; }
tr.heikel-zeile { background: #fdf7f2; }
.heikel { color: var(--warn); font-weight: 600; }
.sicherheit-nied { color: var(--warn); }
.sicherheit-mitt { color: var(--alt); }
.sicherheit-hoch { color: var(--gut); }

/* --------------------------------------------------------------- Kartenraster */

.karten { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.stueck {
  display: flex; flex-direction: column;
  flex: 1 1 220px; max-width: 280px;
  margin: 0 0 12px;
  background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: 6px;
  overflow: hidden; color: var(--text);
}
.stueck:hover { border-color: var(--akzent); text-decoration: none;
                box-shadow: 0 1px 6px rgba(90,70,50,.13); }
.stueck-bild {
  display: flex; align-items: center; justify-content: center;
  height: 130px; margin: 0; background: #f2efe9; overflow: hidden;
}
.stueck-bild img { width: 100%; height: 130px; object-fit: cover; display: block; }
.ohne-bild { font-size: 11px; color: #a89c8c; letter-spacing: .08em; }
.stueck-text { display: flex; flex-direction: column; gap: 2px;
               margin: 0; padding: 9px 11px 11px; }
.stueck-kopf { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 2px;
               align-items: center; }
.inventar { font-size: 11px; font-weight: 700; color: var(--grau);
            letter-spacing: .05em; }
.ordonnanz { font-size: 12px; color: var(--akzent); font-style: italic; }
.ordonnanz.gross { font-style: normal; font-weight: 600; }
.sammelgebiet-hinweis { color: var(--akzent); }
.wert { font-variant-numeric: tabular-nums; color: var(--text); }

.fahne { display: inline-block; font-size: 10px; font-weight: 700;
         letter-spacing: .04em; padding: 1px 6px; border-radius: 9px;
         margin: 0 2px 0 0; background: #eee9e1; color: #5a4632; }
.fahne.alt { background: #f4ead6; color: var(--alt); }
.fahne.offen { background: var(--warn-hell); color: var(--warn); }
.fahne.vorhanden { background: #e6f0e9; color: var(--gut); }
.fahne.vorlaeufig { background: #f0eeea; color: var(--grau); }
.marke-zahl { float: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- Formulare */

label { display: block; margin: 0 0 9px; font-size: 12px; color: var(--grau); }
input, select, textarea {
  display: block; width: 100%; margin: 2px 0 0;
  padding: 6px 8px; font: inherit; font-size: 13px; color: var(--text);
  background: #fff; border: 1px solid var(--linie); border-radius: 4px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--akzent);
  box-shadow: 0 0 0 2px var(--akzent-hell);
}
textarea { line-height: 1.5; resize: vertical; }
fieldset { border: 1px solid var(--linie); border-radius: 5px;
           margin: 0 0 12px; padding: 10px 12px; }
legend { font-size: 11px; font-weight: 700; color: var(--akzent);
         text-transform: uppercase; letter-spacing: .05em; padding: 0 4px; }

.felder { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 6px; }
.felder > label { flex: 0 1 180px; margin-bottom: 9px; }
.felder > label.wachsend { flex: 1 1 300px; }

.einzeiler { display: flex; flex-wrap: wrap; align-items: flex-end;
             gap: 8px; margin: 8px 0 0; }
.einzeiler > * { margin-bottom: 8px; }
.einzeiler label { margin-bottom: 0; }
.einzeiler input, .einzeiler select { width: auto; min-width: 130px; }
.einzeiler .wachsend { flex: 1 1 200px; }
.einzeiler .wachsend input { width: 100%; }

.filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px;
          align-items: center; }
.filter > * { margin-bottom: 8px; }
.filter input, .filter select { width: auto; min-width: 140px; }

.ankreuz { display: flex; align-items: flex-start; gap: 8px;
           margin: 0 0 9px; font-size: 13px; color: var(--text); }
.ankreuz input { width: auto; margin: 3px 0 0; flex: 0 0 auto; }
.ankreuz span { flex: 1 1 auto; }

.inline { display: inline; margin: 0; }

.knopf {
  display: inline-block; margin: 4px 0 0; padding: 7px 15px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: #fff; background: var(--akzent);
  border: 1px solid var(--akzent); border-radius: 4px; cursor: pointer;
}
.knopf:hover { background: #6b5540; text-decoration: none; color: #fff; }
.knopf.klein { padding: 5px 11px; font-size: 12px; }
.knopf.winzig { padding: 2px 8px; font-size: 11px; margin: 0; }
.knopf.hell { background: #fff; color: var(--akzent); }
.knopf.hell:hover { background: var(--akzent-hell); color: var(--akzent); }

/* ------------------------------------------------------------------ Bilder */

.bilderreihe { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.bilderreihe figure { flex: 1 1 200px; max-width: 300px; margin: 0 0 10px; }
.bilderreihe img { width: 100%; height: auto; display: block;
                   border: 1px solid var(--linie); border-radius: 4px; }
.bilderreihe figcaption { font-size: 11px; color: var(--grau); margin-top: 3px; }

.qr { margin: 8px 0; }
.qr svg { max-width: 190px; height: auto; }
.klartext { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
            font-size: 13px; letter-spacing: .05em; }
.auswaehlbar { user-select: all; background: var(--akzent-hell);
               padding: 6px 9px; border-radius: 4px; display: inline-block; }

.liste { list-style: none; margin: 0; padding: 0; }
.liste li { padding: 3px 0; margin: 0; border-bottom: 1px solid var(--linie); }

.pruefzeile { display: flex; flex-wrap: wrap; align-items: flex-end;
              gap: 8px; margin: 0 0 8px; padding: 10px 12px; }
.pruefzeile > * { margin-bottom: 0; }
.pruefzeile select, .pruefzeile input { width: auto; min-width: 120px; }
.pruefzeile .wachsend { flex: 1 1 240px; display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- Schmalbild */

@media (max-width: 760px) {
  .rumpf { flex-direction: column; }
  .leiste { flex: 1 1 auto; border-right: none;
            border-bottom: 1px solid var(--linie); padding-bottom: 10px; }
  .inhalt { padding: 14px 13px 50px; }
  .stueck { max-width: none; }
}

@media print {
  .kopf, .leiste, .knopf, .filter, form { display: none; }
  .inhalt { padding: 0; }
  .karte { border: none; padding: 0; }
}
