:root {
  --blau: #1f3a5f;
  --blau-dunkel: #15293f;
  --akzent: #c8762a;
  --hintergrund: #f4f3ef;
  --karte: #ffffff;
  --text: #1c1c1c;
  --text-leise: #6b6b6b;
  --linie: #dcd9d1;
  --fehler: #b3261e;
  --ok: #2e7d32;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--hintergrund); }
body { min-height: 100dvh; -webkit-font-smoothing: antialiased; }
a { color: var(--blau); }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 .75rem; }

/* Kopf */
.kopf {
  background: var(--blau); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 1rem; gap: 1rem; position: sticky; top: 0; z-index: 10;
}
.kopf a { color: #fff; text-decoration: none; }
.kopf .marke { font-weight: 700; letter-spacing: .02em; display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; }
.kopf nav { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.kopf nav::-webkit-scrollbar { display: none; }
.kopf nav a { white-space: nowrap; }
.kopf nav a { padding: .4rem .7rem; border-radius: 6px; font-size: .95rem; }
.kopf nav a:hover, .kopf nav a[aria-current="page"] { background: rgba(255,255,255,.14); }
.kopf .wer { font-size: .85rem; opacity: .85; }

main { max-width: 960px; margin: 0 auto; padding: 1rem; }
@media (min-width: 700px) { main { padding: 1.5rem; } }

/* Karten und Formulare */
.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); padding: 1rem; margin-bottom: 1rem; }
.karte h2 { margin-bottom: .75rem; }
label { display: block; font-size: .85rem; color: var(--text-leise); margin-bottom: .25rem; }
input, select, textarea {
  width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid var(--linie);
  border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blau); outline-offset: 1px; border-color: var(--blau); }
textarea { min-height: 5rem; resize: vertical; }
.feld { margin-bottom: .9rem; }
.zeile { display: grid; grid-template-columns: 1fr; gap: .9rem; }
@media (min-width: 600px) {
  .zeile.z2 { grid-template-columns: 1fr 1fr; }
  .zeile.z3 { grid-template-columns: 1fr 1fr 1fr; }
}
.zeile .feld { margin-bottom: 0; }
.knopf {
  display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-weight: 600;
  padding: .6rem 1rem; border-radius: 8px; border: 1px solid var(--blau);
  background: var(--blau); color: #fff; cursor: pointer; text-decoration: none;
}
.knopf:hover { background: var(--blau-dunkel); }
.knopf.leise { background: transparent; color: var(--blau); }
.knopf.leise:hover { background: rgba(31,58,95,.07); }
.knopf.gefahr { background: transparent; color: var(--fehler); border-color: var(--fehler); }
.knopf.klein { padding: .35rem .7rem; font-size: .9rem; }
.knoepfe { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.hinweis { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .95rem; }
.hinweis.fehler { background: #fde8e6; color: var(--fehler); }
.hinweis.ok { background: #e6f4e7; color: var(--ok); }
.leise { color: var(--text-leise); font-size: .9rem; }

/* Listen */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); margin-bottom: .5rem; }
.liste a { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; text-decoration: none; color: inherit; }
.liste .mini { width: 48px; height: 48px; border-radius: 8px; background: #e8e5dd; object-fit: cover; flex: none; display: grid; place-items: center; color: var(--text-leise); font-size: 1.3rem; }
.liste .ring { font-weight: 600; font-variant-numeric: tabular-nums; }
.liste .neben { font-size: .85rem; color: var(--text-leise); }
.liste .rechts { margin-left: auto; text-align: right; }
.marke-g { display: inline-block; min-width: 1.4rem; text-align: center; padding: .1rem .4rem; border-radius: 6px; font-size: .8rem; font-weight: 700; }
.marke-g.V { background: #dbe7f6; color: #1f3a5f; }
.marke-g.W { background: #f6e3db; color: #8a3b14; }
.marke-g.U { background: #e8e5dd; color: #555; }
.status { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; background: #e8e5dd; color: #444; }
.status.zucht { background: #e2efd9; color: #2e5e1f; }
.status.reise { background: #dbe7f6; color: #1f3a5f; }
.status.jung { background: #fdf1d6; color: #7a5a0a; }
.status.fremd { background: #eee; color: #666; }
.status.verkauft, .status.verliehen { background: #ece5f5; color: #4b2d7a; }
.status.verloren, .status.verstorben { background: #f3d9d7; color: #7a1f1a; }

.suche { display: flex; gap: .5rem; margin-bottom: 1rem; }
.suche input { flex: 1; }
.suche select { width: auto; }

/* Detailseite */
.daten { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .95rem; }
.daten dt { color: var(--text-leise); }
.daten dd { margin: 0; }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.fotos figure { margin: 0; position: relative; }
.fotos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.fotos figcaption { font-size: .8rem; color: var(--text-leise); margin-top: .2rem; }
.eltern { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.eltern a { display: block; padding: .6rem .8rem; border: 1px solid var(--linie); border-radius: 8px; text-decoration: none; color: inherit; }
.eltern .wer { font-size: .8rem; color: var(--text-leise); }
.protokoll { font-size: .85rem; }
.protokoll li { padding: .4rem 0; border-bottom: 1px solid var(--linie); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: #eee; padding: .1rem .3rem; border-radius: 4px; }

/* Anmeldung */
.mitte { max-width: 420px; margin: 2rem auto; }
.logo-gross { text-align: center; margin-bottom: 1.5rem; color: var(--blau); }
.logo-gross h1 { font-size: 2rem; letter-spacing: .02em; }

/* Ringfelder */
.ring-felder { display: grid; grid-template-columns: 1.2fr 1fr .7fr 1fr; gap: .5rem; }
.ring-felder .feld { margin-bottom: .5rem; }
.inz { display: inline-block; margin-top: .2rem; padding: .05rem .4rem; border-radius: 6px; font-weight: 600; }
.inz.leicht { background: #fdf1d6; color: #7a5a0a; }
.inz.mittel { background: #f9ddc9; color: #8a3b14; }
.inz.hoch { background: #f3d9d7; color: #7a1f1a; }
.stammbaum { display: grid; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; }
.sb-spalte { display: grid; gap: .4rem; min-width: 150px; }
.sb-box { border: 1px solid var(--linie); border-radius: 8px; padding: .4rem .55rem; font-size: .8rem; background: #fff; display: flex; flex-direction: column; justify-content: center; text-decoration: none; color: inherit; min-height: 2.6rem; }
.sb-box.V { border-left: 4px solid #1f3a5f; }
.sb-box.W { border-left: 4px solid #c8762a; }
.sb-box.leer { border-style: dashed; color: var(--text-leise); background: transparent; }
.sb-box .ring { font-weight: 600; font-variant-numeric: tabular-nums; }
.sb-box .neben { color: var(--text-leise); font-size: .75rem; }
.sb-box.wdh-1 { background: #fdf1d6; } .sb-box.wdh-2 { background: #e2efd9; } .sb-box.wdh-3 { background: #dbe7f6; }
.sb-box.wdh-4 { background: #ece5f5; } .sb-box.wdh-5 { background: #f6e3db; } .sb-box.wdh-6 { background: #e0f2f1; }
.sb-wurzel { font-size: .95rem; }
.ring { white-space: nowrap; }
@media (max-width: 600px) { .kopf .wer { display: none; } }
details.karte > summary { cursor: pointer; font-weight: 700; font-size: 1.15rem; list-style: none; }
details.karte > summary::-webkit-details-marker { display: none; }
details.karte > summary::after { content: ' ▾'; color: var(--text-leise); }
details.karte[open] > summary { margin-bottom: .75rem; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabelle th { text-align: left; font-weight: 600; color: var(--text-leise); font-size: .8rem; padding: .3rem .5rem; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.tabelle td { padding: .45rem .5rem; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.tabelle td a { text-decoration: none; color: inherit; }
.tabelle input[type=time], .tabelle input[type=text], .tabelle input[inputmode] { padding: .35rem .45rem; min-width: 5.5rem; }
.tabelle input[type=checkbox] { width: 1.2rem; height: 1.2rem; }
.setzen { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .3rem .8rem; }
.setzen-zeile { display: flex; align-items: center; gap: .5rem; padding: .35rem .4rem; border-radius: 6px; color: var(--text); font-size: .95rem; cursor: pointer; }
.setzen-zeile:hover { background: rgba(31,58,95,.06); }
.setzen-zeile input { width: 1.2rem; height: 1.2rem; }
