/* Hof Tierisch verrückt – App-Stil (mobil zuerst) */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.da03732a27e1.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.51205681a1ba.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.2ede57db1a3a.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.8ca0a5155296.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 600; font-display: swap; src: url("../fonts/fraunces-latin-600-normal.b8dca52ca5f9.woff2") format("woff2"); }

:root {
  --bg: #F6F3EC;
  --card: #FFFFFF;
  --text: #1F2A24;
  --muted: #5B665F;
  --line: #E4DED2;
  --green: #2F5D46;
  --green-dark: #234836;
  --green-soft: #DCEBE2;
  --sky: #E6EEE0;
  --gold: #C39A45;
  --hay: #F2E2BD;
  --hay-text: #5A3F0A;
  --alert: #F6DDD5;
  --alert-text: #7A2A16;
  --brown: #7A5230;
  --radius: 16px;
  --nav-h: 68px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}
a { color: var(--green); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.7rem; color: var(--green); }
h2 { font-size: 1.05rem; font-weight: 700; margin-top: 1.4rem; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }

/* Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(246,243,236,.94);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar .wrap { display: flex; align-items: center; gap: 10px; height: 58px; }
.topbar .logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.topbar .logo img { width: 36px; height: 36px; }
.topbar .logo span { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.15rem; color: var(--green); }
.topbar .spacer { flex: 1; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--green-soft); color: var(--green);
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; text-decoration: none;
}
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 12px; }
.page-head h1 { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-top: 16px; text-decoration: none; font-weight: 600; font-size: .9rem; }

/* Karten & Listen */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(31,42,36,.06); }
.card.pinned { border-left: 4px solid var(--gold); }
.card h3 { margin-bottom: 4px; }
.card .meta { font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
.card .body { white-space: pre-line; }
.card img.foto { border-radius: 12px; margin-top: 10px; }
.list { background: var(--card); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(31,42,36,.06); }
.list > a, .list > div.row, .list > form.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.list > :last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; }
.list .sub { font-size: .85rem; color: var(--muted); }
.chev { color: var(--muted); }
.icon-round { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); flex: none; font-weight: 700; }
.icon-round img { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px; text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgba(31,42,36,.06); }
.stat b { display: block; font-size: 1.6rem; color: var(--green); line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

/* Chips & Badges */
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--green-soft); color: var(--green); white-space: nowrap; }
.chip.hay { background: var(--hay); color: var(--hay-text); }
.chip.alert { background: var(--alert); color: var(--alert-text); }
.chip.grey { background: #ECE8DF; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--alert-text); display: inline-block; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 12px; padding: 11px 16px; font: inherit; font-weight: 600;
  background: var(--green); color: #fff; text-decoration: none; cursor: pointer; min-height: 44px;
}
.btn:hover { background: var(--green-dark); }
.btn.sec { background: var(--green-soft); color: var(--green); }
.btn.ghost { background: transparent; color: var(--green); border: 1.5px solid var(--green-soft); }
.btn.warn { background: var(--alert); color: var(--alert-text); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: .88rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
form.inline { display: inline; margin: 0; }

/* Segment-Tabs */
.tabs { display: flex; gap: 4px; background: #ECE8DF; padding: 4px; border-radius: 12px; margin: 4px 0 14px; overflow-x: auto; }
.tabs a { flex: 1; text-align: center; padding: 8px 10px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.tabs a.on { background: #fff; color: var(--green); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Formulare */
.form p, .form .field { margin: 0 0 14px; }
.form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=number],
.form input[type=date], .form input[type=time], .form input[type=datetime-local], .form input[type=tel],
.form select, .form textarea {
  width: 100%; font: inherit; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--text);
}
.form textarea { min-height: 110px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--green); }
.form input[type=checkbox] { width: 20px; height: 20px; vertical-align: middle; margin-right: 6px; accent-color: var(--green); }
.form .helptext, .form .help { display: block; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.form .errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--alert-text); font-size: .85rem; }
.form ul:not(.errorlist) { list-style: none; padding: 0; margin: 0; }
.form ul:not(.errorlist) li { margin: 4px 0; }
.form ul:not(.errorlist) li label { font-weight: 500; display: inline; }
.check label { display: inline !important; font-weight: 500 !important; }

/* Meldungen (Toasts) */
.messages { list-style: none; padding: 0; margin: 14px 0 0; }
.messages li { background: var(--green); color: #fff; padding: 12px 14px; border-radius: 12px; margin-bottom: 8px; font-weight: 500; }
.messages li.error, .messages li.warning { background: var(--alert); color: var(--alert-text); }

/* Dienste */
.week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.week-nav a { text-decoration: none; font-weight: 600; padding: 6px 10px; }
.day { margin-bottom: 14px; }
.day-head { font-weight: 700; font-size: .9rem; color: var(--muted); margin: 0 0 6px 4px; text-transform: uppercase; letter-spacing: .04em; }
.day-head.today { color: var(--green); }
.shift { background: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(31,42,36,.06); }
.shift.full { opacity: .92; }
.shift.mine { box-shadow: inset 4px 0 0 var(--green), 0 1px 2px rgba(31,42,36,.06); }
.shift.cancelled { opacity: .55; }
.shift-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.shift-top .time { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.people { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.person { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 999px; padding: 3px 10px 3px 3px; font-size: .85rem; }
.person i { width: 24px; height: 24px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-style: normal; font-weight: 700; font-size: .7rem; display: grid; place-items: center; }
.person.swap { background: var(--hay); }
.slot-free { display: inline-flex; align-items: center; border: 1.5px dashed var(--line); border-radius: 999px; padding: 2px 10px; font-size: .82rem; color: var(--muted); }
.fair td, .fair th { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line); font-size: .9rem; }
.fair { width: 100%; border-collapse: collapse; }
.fair .bar { height: 8px; background: var(--green-soft); border-radius: 4px; overflow: hidden; min-width: 60px; }
.fair .bar span { display: block; height: 100%; background: var(--green); }

/* Unterhaltung */
.bubble { background: #fff; border-radius: 14px; padding: 10px 14px; margin: 0 0 10px; max-width: 88%; box-shadow: 0 1px 2px rgba(31,42,36,.06); }
.bubble.me { margin-left: auto; background: var(--green-soft); }
.bubble .meta { font-size: .75rem; color: var(--muted); margin-bottom: 2px; }
.bubble .body { white-space: pre-line; }

/* Untere Navigation */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav .wrap { display: flex; height: var(--nav-h); padding: 0 4px; }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600; position: relative; }
.bottom-nav a svg { width: 24px; height: 24px; }
.bottom-nav a.on { color: var(--green); }
.bottom-nav a .badge { position: absolute; top: 9px; left: 50%; margin-left: 6px; background: var(--alert-text); color: #fff; border-radius: 999px; font-size: .65rem; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; }
.fab { position: fixed; right: 18px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); z-index: 25; width: 56px; height: 56px; border-radius: 18px; background: var(--green); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(47,93,70,.35); text-decoration: none; font-size: 28px; }
@media (min-width: 720px) { .fab { right: calc(50% - 340px + 18px); } }

/* Login */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 0; }
.login .brand { text-align: center; margin-bottom: 24px; }
.login .brand img { width: 220px; margin: 0 auto; }
body.no-nav { padding-bottom: 0; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-line; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- Desktop-Ansicht ---------- */
.nav-logo { display: none !important; }
@media (min-width: 1024px) {
  :root { --side: 248px; }
  body { padding-bottom: 32px; padding-left: var(--side); }
  body.no-nav { padding-left: 0; }
  .wrap.wide { max-width: 1180px; padding: 0 32px; }
  .topbar .logo { display: none; }
  .bottom-nav { top: 0; right: auto; width: var(--side); border-top: 0; border-right: 1px solid var(--line); padding: 0; }
  .bottom-nav .wrap { flex-direction: column; height: 100%; padding: 20px 14px; gap: 4px; max-width: none; }
  .bottom-nav a.nav-logo { display: block !important; flex: none; padding: 6px 8px 22px; }
  .bottom-nav a.nav-logo img { width: 170px; }
  .bottom-nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; border-radius: 12px; font-size: .95rem; }
  .bottom-nav a:hover { background: var(--bg); }
  .bottom-nav a.on { background: var(--green-soft); }
  .bottom-nav a .badge { position: static; margin-left: auto; }
  .fab { right: 32px; bottom: 32px; }
  h1 { font-size: 2rem; }
  .page-head { margin-top: 28px; }
  .grid2.stats { grid-template-columns: repeat(4, 1fr); }
  .dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 32px; align-items: start; }
  .dash-a > h2:first-child, .dash-b > .page-head:first-child { margin-top: 1.4rem; }
  .days { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 16px; align-items: start; }
  .card.form, form.card { max-width: 720px; }
  .list, .card { box-shadow: 0 1px 3px rgba(31,42,36,.07); }
  .bubble { max-width: 70%; }
  .login .wrap, .login { max-width: 440px; margin: 0 auto; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .dash { grid-template-columns: 1fr; }
}

/* Datei-/Foto-Auswahl */
.form input[type=file] { width: 100%; font: inherit; padding: 10px; border: 1.5px dashed var(--green); border-radius: 12px; background: var(--green-soft); color: var(--green); }
.form input[type=file]::file-selector-button { font: inherit; font-weight: 600; border: 0; border-radius: 10px; background: var(--green); color: #fff; padding: 9px 14px; margin-right: 10px; cursor: pointer; }
.page-head .btn-row { justify-content: flex-end; }

/* Startseite: Mein Pferd */
.mein-pferd { padding: 16px; }
.mp-foto { width: 64px; height: 64px; border-radius: 18px; overflow: hidden; background: var(--green-soft); display: grid; place-items: center; flex: none; text-decoration: none; }
.mp-foto img { width: 100%; height: 100%; object-fit: cover; }
.mp-foto span { font-family: "Fraunces", Georgia, serif; font-size: 1.8rem; color: var(--green); }
.mp-titel { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 4px; }
.mp-zeile { display: block; padding: 8px 10px; border-radius: 10px; background: var(--bg); margin-top: 6px; font-size: .92rem; color: inherit; text-decoration: none; overflow: hidden; }
.mp-aktionen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

/* Foto-Feld mit Vorschau */
.foto-vorschau { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.foto-vorschau img { width: 96px; height: 96px; object-fit: cover; border-radius: 14px; }
.form .foto-weg { display: inline-flex !important; align-items: center; gap: 6px; font-weight: 600 !important; color: var(--alert-text); background: var(--alert); padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.form .foto-weg input { margin: 0 !important; }

/* Pinnwand */
.tabs .zaehler { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--alert-text); color: #fff; font-size: .7rem; margin-left: 4px; }
.form label.zg-alle { background: var(--hay); color: var(--hay-text); border-radius: 8px; padding: 4px 8px; }
