/* WuffUp - Oberfläche.
 *
 * Ruhiger neutraler Grund, weiße Karten, ein kräftiges Grün als einzige
 * Akzentfarbe, Tennisball-Gelb ausschließlich für den Check-in.
 * Schrift: Plus Jakarta Sans, mitgeliefert, damit nichts nachgeladen wird.
 */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/vendor/pjs-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/vendor/pjs-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Grundflächen */
  --bg: #F6F6F3;
  --surface: #FFFFFF;
  --surface-2: #F0F1EC;

  /* Text */
  --ink: #14180F;
  --ink-2: #3D453A;
  --muted: #767E71;

  /* Akzente */
  --green: #0F8A56;
  --green-deep: #0A6B42;
  --green-soft: #E4F4EB;
  --live: #22C55E;
  --ball: #FFD43B;
  --ball-deep: #F0BE00;
  --danger: #C4362B;
  --warn-soft: #FDEBD2;

  --line: #E4E5DF;
  --line-2: #CFD2C8;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --shadow-1: 0 1px 2px rgba(20, 24, 15, .05);
  --shadow-2: 0 2px 4px rgba(20, 24, 15, .04), 0 12px 28px -14px rgba(20, 24, 15, .18);
  --shadow-3: 0 -8px 40px -12px rgba(20, 24, 15, .28);

  --tabs-h: 62px;
  --top-h: 54px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.025em; font-weight: 800; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; font-family: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
img { max-width: 100%; }

/* ---------- Gerüst ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 18px 0;
  display: flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top .brand {
  font-weight: 800; font-size: 1.06rem; letter-spacing: -0.02em;
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.top .back {
  background: var(--surface); border: 1px solid var(--line); border-radius: 50%;
  width: 34px; height: 34px; display: grid; place-items: center;
  font-size: 1.05rem; cursor: pointer; color: var(--ink); box-shadow: var(--shadow-1);
}
.top .back:active { background: var(--surface-2); }
.updated { color: var(--muted); font-size: .8rem; }

main {
  position: absolute;
  top: calc(var(--top-h) + env(safe-area-inset-top));
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  left: 0; right: 0;
  overflow: hidden;
}
.view {
  height: 100%; overflow-y: auto; padding: 16px 18px 32px;
  display: grid; gap: 18px; align-content: start;
  max-width: 34rem; margin: 0 auto;
}
.view-map { padding: 0; max-width: none; display: block; overflow: hidden; }

#map { position: absolute; inset: 0; }
.map-hint {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px;
  font-size: .87rem; font-weight: 500; z-index: 2; max-width: 90%; text-align: center;
  box-shadow: var(--shadow-2);
}
.locate {
  position: absolute; right: 14px; bottom: 18px; z-index: 2;
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); font-size: 1.15rem; cursor: pointer; color: var(--green);
  box-shadow: var(--shadow-2);
}
.locate:active { background: var(--surface-2); }
.me-dot {
  width: 16px; height: 16px; border-radius: 50%; background: var(--green);
  border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(15, 138, 86, .5), 0 2px 8px rgba(0,0,0,.25);
}

/* ---------- Karten (Blöcke) ---------- */
.block {
  background: var(--surface); border-radius: var(--r-lg); padding: 18px;
  box-shadow: var(--shadow-1); border: 1px solid var(--line);
  display: grid; gap: 14px;
}
.block > h2 {
  font-size: .76rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}
.muted { color: var(--muted); }
.small { font-size: .88rem; }

.hero { display: grid; gap: 8px; padding: 6px 2px 0; }
.hero h1 { font-size: 2.2rem; letter-spacing: -0.035em; }
.hero h1.empty { color: var(--ink-2); font-weight: 700; font-size: 1.65rem; letter-spacing: -0.02em; }
.facts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Check-in: die einzige gelbe Stelle ---------- */
.checkin {
  background: var(--ball); border-radius: var(--r-lg); padding: 18px;
  display: grid; gap: 14px; box-shadow: 0 6px 20px -10px rgba(240, 190, 0, .8);
}
.checkin .go {
  background: var(--ink); color: var(--ball); border: 0; border-radius: 999px;
  padding: 19px; font-size: 1.22rem; font-weight: 800; letter-spacing: -0.01em;
  cursor: pointer; width: 100%;
}
.checkin .go:active { transform: scale(.985); }
.checkin .go:disabled { opacity: .65; }
.checkin .small { color: #574A00; }
.checkin input[type=text] { width: 100%; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; }
.chips span {
  display: inline-block; padding: 9px 15px; border-radius: 999px;
  border: 1.5px solid var(--line-2); background: var(--surface);
  cursor: pointer; line-height: 1.2; font-weight: 500; font-size: .95rem;
  transition: background .12s, border-color .12s, color .12s;
}
.chips input:checked + span {
  background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600;
}
.chips input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.checkin .chips span { background: rgba(255,255,255,.65); border-color: rgba(20,24,15,.18); }
.checkin .chips input:checked + span { background: var(--ink); color: var(--ball); }

/* ---------- Listen ---------- */
/* Eine Zeile je Hund. Antippbar, wenn ein Profil dahintersteckt. */
.dogs { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.dogs li { border-bottom: 1px solid var(--line); }
.dogs li:last-child { border-bottom: 0; }
.dog-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 0; background: none; border: 0; text-align: left;
  font: inherit; color: inherit; cursor: pointer;
}
.dog-row.plain { cursor: default; }
.dogs li:first-child .dog-row { padding-top: 0; }
.dogs li:last-child .dog-row { padding-bottom: 0; }
button.dog-row:active { background: var(--surface-2); }
.dog-main { flex: 1; display: grid; gap: 2px; min-width: 0; }
.dogs .name { font-weight: 700; letter-spacing: -0.01em; }
.dogs .meta { color: var(--muted); font-size: .87rem; }
.dogs .when { color: var(--muted); font-size: .87rem; white-space: nowrap; align-self: center; }

/* Profil eines fremden Hundes */
.dog-profile { display: grid; justify-items: center; gap: 6px; text-align: center; padding-top: 4px; }
.dog-profile h2 { font-size: 1.7rem; letter-spacing: -0.03em; }
.avatar.xl {
  width: 118px; height: 118px; font-size: 2.8rem; margin-bottom: 6px;
  box-shadow: 0 0 0 4px var(--surface), var(--shadow-2);
}
.dog-profile + .facts { justify-content: center; }

.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: .78rem; font-weight: 600; margin-right: 5px;
}
.tag.warn { background: var(--warn-soft); color: #7A4B10; }

/* ---------- Gesichter ---------- */
.avatar {
  display: inline-grid; place-items: center; border-radius: 50%;
  object-fit: cover; background: var(--green-soft); color: var(--green-deep);
  font-weight: 800; overflow: hidden; flex: none;
  box-shadow: 0 0 0 2px var(--surface);
}
.avatar.sm { width: 28px; height: 28px; font-size: .8rem; }
.avatar.md { width: 44px; height: 44px; font-size: 1.05rem; }
.avatar.lg { width: 84px; height: 84px; font-size: 2rem; box-shadow: 0 0 0 3px var(--surface), var(--shadow-1); }
.faces { display: inline-flex; }
.faces .avatar + .avatar { margin-left: -10px; }
.row-faces { margin-top: 2px; }

.photo-row { display: flex; gap: 16px; align-items: flex-start; }
/* justify-items, sonst zieht das Grid den Knopf auf volle Breite und er
   sieht aus wie ein Eingabefeld. */
.photo-actions { display: grid; gap: 8px; align-content: start; justify-items: start; }
.photo-pick { cursor: pointer; display: inline-block; }

/* ---------- Eigener Zustand ---------- */
.mine {
  background: var(--green-soft); border: 1px solid #C4E6D3; border-radius: var(--r-lg);
  padding: 16px 18px; display: grid; gap: 12px;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }

/* ---------- Schaltflaechen ---------- */
.btn {
  border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 11px 18px; font-weight: 600; font-size: .95rem;
  cursor: pointer; line-height: 1.2; letter-spacing: -0.01em;
  transition: background .12s, border-color .12s;
}
.btn:active { background: var(--surface-2); }
.btn.fill {
  background: var(--green); color: #fff; border-color: var(--green);
  box-shadow: 0 6px 16px -8px rgba(15, 138, 86, .9);
}
.btn.fill:active { background: var(--green-deep); border-color: var(--green-deep); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); padding-inline: 10px; }
.btn.quiet:active { background: var(--surface-2); }
.btn.danger { color: var(--danger); border-color: #EBC7C3; background: var(--surface); }
.btn.small { padding: 7px 13px; font-size: .87rem; }
.btn:disabled { opacity: .5; cursor: default; }

.counter {
  display: inline-flex; align-items: center; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden;
}
.counter button {
  background: transparent; border: 0; width: 44px; height: 42px;
  font-size: 1.3rem; cursor: pointer; color: var(--green);
}
.counter button:active { background: var(--surface-2); }
.counter output { min-width: 40px; text-align: center; font-weight: 800; }

/* ---------- Formulare ---------- */
form { display: grid; gap: 14px; }
label.field { display: grid; gap: 6px; }
label.field > span {
  font-size: .76rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted);
}
input[type=text], input[type=email], input[type=time], input[type=datetime-local], select {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm); background: var(--surface); font-size: 1rem;
}
input::placeholder { color: #A3A99E; }
input:focus, select:focus {
  border-color: var(--green); outline: 0;
  box-shadow: 0 0 0 3px rgba(15, 138, 86, .14);
}
.check { display: flex; gap: 12px; align-items: center; font-size: .95rem; }
.check input { width: 22px; height: 22px; accent-color: var(--green); }

/* ---------- Treffen ---------- */
.meetup { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.meetup:last-of-type { border-bottom: 0; }
.meetup .time { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.meetup .who { color: var(--muted); font-size: .88rem; }

/* ---------- Typische Zeiten ---------- */
.heat { display: grid; grid-template-columns: 2.2em repeat(17, 1fr); gap: 3px; align-items: center; }
.heat .d { font-size: .76rem; font-weight: 600; color: var(--muted); }
.heat .h { font-size: .68rem; color: var(--muted); text-align: center; }
.heat .c { aspect-ratio: 1; border-radius: 4px; background: var(--green); }

.notice {
  background: var(--green-soft); border-radius: var(--r-sm); padding: 13px 15px;
  font-size: .92rem; color: var(--ink-2);
}

/* ---------- Kurzübersicht beim Antippen eines Pins ---------- */
.peek-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.peek-nums > div {
  background: var(--surface-2); border-radius: var(--r); padding: 14px 16px;
  display: grid; gap: 1px;
}
.peek-nums strong {
  font-size: 2.4rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.peek-nums span { color: var(--muted); font-size: .85rem; font-weight: 500; }
.peek-nums > div:first-child { background: var(--green-soft); }
.peek-nums > div:first-child strong { color: var(--green-deep); }
.peek-nums .zero { background: var(--surface-2); }
.peek-nums .zero strong { color: #A3A99E; }
.peek-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 2px; }
.peek-actions .btn { text-align: center; text-decoration: none; }

/* ---------- Optionen ---------- */
.menu {
  display: grid; gap: 0; background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-1); overflow: hidden;
}
.menu button {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 1px 12px; width: 100%; text-align: left; cursor: pointer;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}
.menu button:last-child { border-bottom: 0; }
.menu .menu-title { grid-column: 1; grid-row: 1; font-weight: 700; font-size: 1.02rem; letter-spacing: -0.015em; }
.menu .menu-status { grid-column: 1; grid-row: 2; color: var(--muted); font-size: .87rem; }
.menu .menu-arrow { grid-column: 2; grid-row: 1 / span 2; justify-self: end; font-size: 1.4rem; color: var(--line-2); }
.menu button:active { background: var(--surface-2); }

/* Der Check-in bekommt seine eigene Karte darueber. */
.menu button.primary {
  background: var(--ball); border-bottom: 0; padding: 20px 18px;
  border-radius: var(--r-lg);
}
.menu button.primary .menu-title { font-size: 1.16rem; font-weight: 800; }
.menu button.primary .menu-status { color: #6B5B00; }
.menu button.primary .menu-arrow { color: #6B5B00; }
.menu button.primary:active { background: var(--ball-deep); }

/* ---------- Reiter ---------- */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding: 7px 12px env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; align-items: center;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line);
}
.tabs button {
  background: none; border: 0; color: var(--muted); font-weight: 600; font-size: .87rem;
  cursor: pointer; border-radius: 999px; padding: 10px 4px; letter-spacing: -0.01em;
}
.tabs button.active { color: var(--green-deep); background: var(--green-soft); font-weight: 700; }

/* ---------- Blatt ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 10;
  background: rgba(20, 24, 15, .38); backdrop-filter: blur(2px);
  display: flex; align-items: flex-end;
}
.sheet-inner {
  background: var(--surface); width: 100%; max-width: 34rem; margin: 0 auto;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 26px 20px calc(24px + env(safe-area-inset-bottom));
  display: grid; gap: 14px; position: relative; max-height: 88%; overflow-y: auto;
  box-shadow: var(--shadow-3);
  animation: sheet-up .22s cubic-bezier(.2, .8, .3, 1);
}
@keyframes sheet-up { from { transform: translateY(14px); opacity: .6; } }
.sheet-inner::before {
  content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 38px; height: 4px; border-radius: 999px; background: var(--line-2);
}
.sheet-inner > h2 { font-size: 1.5rem; letter-spacing: -0.03em; }
.dog-profile h2 + p { margin-top: -2px; }
.sheet-close {
  position: absolute; top: 16px; right: 16px; background: var(--surface-2); border: 0;
  width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; line-height: 1;
  cursor: pointer; color: var(--ink-2);
}

/* ---------- Hinweis ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 18px + env(safe-area-inset-bottom));
  z-index: 20; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px;
  max-width: 90vw; text-align: center; font-size: .92rem; font-weight: 500;
  box-shadow: var(--shadow-2);
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  .toast, .chips span, .btn { transition: none; }
  .sheet-inner { animation: none; }
  .checkin .go:active { transform: none; }
}
