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

::selection { background: var(--accent); color: #0b1221; }

:root {
  --bg: #0b1221;
  --card: #162032;
  --border: #3d5068;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --accent: #5ec4b6;
  --green: #4ade80;
  --red: #f87171;
  --warning: #ff9f0a;
  --danger: #ff453a;
  --success: #30d158;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
  min-height: 100dvh;
}

body { display: flex; flex-direction: column; }

#header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
}
.header-inner {
  max-width: 430px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.header-title { font-size: 20px; font-weight: 700; }
.header-user {
  color: var(--text-secondary); font-size: 14px;
  display: flex; align-items: center; gap: 10px;
}
.header-user button { min-height: 0; padding: 6px 10px; font-size: 13px; }

#main {
  flex: 1; width: 100%; max-width: 430px; margin: 0 auto;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 80px);
  -webkit-overflow-scrolling: touch;
}

#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar-inner { max-width: 430px; margin: 0 auto; display: flex; }
.tab {
  /* flex-basis 0 + min-width 0: six equal tabs that shrink instead of
     pushing the last one off narrow screens */
  flex: 1 1 0; min-width: 0; min-height: 56px; padding: 0 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: none; color: var(--text-secondary);
  font-size: 10px; cursor: pointer;
}
.tab-label { max-width: 100%; white-space: nowrap; overflow: hidden; }
.tab .tab-icon { font-size: 22px; line-height: 1; }
.tab.active { color: var(--accent); }

h2 { font-size: 18px; margin-bottom: 12px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.section-head h2 { margin-bottom: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.card.tappable { cursor: pointer; }

.card-title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-sub { color: var(--text-secondary); font-size: 14px; margin-top: 6px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.badge {
  display: inline-block; padding: 3px 8px; border-radius: 8px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-blocked { background: rgba(255, 69, 58, 0.18); color: var(--danger); }
.badge-free { background: rgba(48, 209, 88, 0.15); color: var(--success); }
.badge-warn { background: rgba(255, 159, 10, 0.15); color: var(--warning); }
.badge-info { background: rgba(94, 196, 182, 0.15); color: var(--accent); }
.badge-muted { background: rgba(148, 163, 184, 0.15); color: var(--text-secondary); }

button, .btn {
  min-height: 44px; padding: 10px 16px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--text);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #0b1221; }
.btn-danger { background: none; border-color: var(--danger); color: var(--danger); }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; margin-bottom: 12px; }
.btn-row > * { flex: 1; }

input, select, textarea {
  width: 100%; min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
  font-size: 16px; font-family: inherit;
}
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: 13px; color: var(--text-secondary); margin: 10px 0 4px; }
.form-row { display: flex; gap: 8px; }
.form-row > * { flex: 1; }
form .btn-row { margin-top: 12px; margin-bottom: 0; }

.list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .muted { color: var(--text-secondary); font-size: 13px; }

.chip {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 14px; margin: 3px 4px 3px 0; cursor: pointer;
}
/* Chip mit Zusatzzeile darunter */
.chip-stack { vertical-align: top; border-radius: 14px; }
.chip-sub { display: block; font-size: 11px; color: var(--text-secondary); margin-top: 1px; }

.empty { color: var(--text-secondary); text-align: center; padding: 24px 0; font-size: 14px; }

.check {
  width: 28px; height: 28px; min-height: 28px; padding: 0;
  border-radius: 50%; border: 2px solid var(--border);
  background: none; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--success);
}
.check.done { border-color: var(--success); background: rgba(48, 209, 88, 0.15); }

.done-title { text-decoration: line-through; color: var(--text-secondary); }

.back-link {
  display: inline-block; color: var(--accent); font-size: 15px;
  margin-bottom: 12px; cursor: pointer; padding: 4px 0; border: none; background: none;
  min-height: 0; font-weight: 600;
}

.date-group { color: var(--text-secondary); font-size: 13px; font-weight: 700; margin: 16px 0 4px; text-transform: uppercase; letter-spacing: 0.03em; }
.date-group:first-child { margin-top: 0; }

.login-wrap { padding-top: 12dvh; text-align: center; }
.login-logo { font-size: 64px; margin-bottom: 8px; }
.login-wrap h1 { font-size: 24px; margin-bottom: 24px; }
.login-wrap form { text-align: left; }
.login-toggle { margin-top: 16px; background: none; border: none; color: var(--accent); font-size: 14px; }

.error-msg { color: var(--danger); font-size: 14px; margin-top: 10px; text-align: center; }

.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 12px; }
.check-item { display: flex; align-items: center; gap: 8px; font-size: 15px; min-height: 32px; }
.check-item input { width: 18px; min-height: 0; height: 18px; padding: 0; accent-color: var(--accent); }

.tab-icon { position: relative; }
.tab-badge {
  position: absolute; top: -4px; right: -14px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  padding: 3px 5px; border-radius: 9px; min-width: 17px; text-align: center;
}

/* Waagerechte Auswahlleiste (Status-Filter) */
.chip-row {
  display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px;
  padding-bottom: 4px; -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row .chip { flex: 0 0 auto; margin: 0; white-space: nowrap; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #0b1221; font-weight: 600; }

/* ---------- Hunde ---------- */

.dog-row { display: flex; align-items: center; gap: 12px; }
.dog-row .grow { flex: 1; min-width: 0; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 96px; height: 96px; font-size: 48px; }
.dog-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.dog-head h2 { margin-bottom: 4px; font-size: 22px; }
.icons { font-size: 14px; letter-spacing: 2px; }

.chip.warn { border-color: var(--warning); color: var(--warning); cursor: default; }
.chip.plain { cursor: default; }

.kv { padding: 8px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: none; padding-bottom: 0; }
.kv:first-child { padding-top: 0; }
.kv-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.kv-value { font-size: 15px; margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }

.call-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.call-row:last-child { border-bottom: none; padding-bottom: 0; }
.call-row:first-child { padding-top: 0; }
.call-row .grow { flex: 1; min-width: 0; }
.call-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; border-radius: 50%;
  background: rgba(48, 209, 88, 0.15); color: var(--success);
  text-decoration: none; font-size: 20px; flex-shrink: 0;
}
.card.alert { border-color: var(--warning); }
.card.new { border-color: var(--accent); }
.card-head { font-size: 13px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 10px; }

/* ---------- Formular (Aufnahmebogen + Bearbeiten) ---------- */

.form-section { margin-bottom: 16px; }
.form-section > h3 { font-size: 17px; margin-bottom: 2px; }
.form-hint { color: var(--text-secondary); font-size: 14px; margin-bottom: 4px; }
.req { color: var(--accent); }
.radio-group { display: flex; flex-direction: column; gap: 2px; }
.check-list { display: flex; flex-direction: column; }
.check-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 15px; color: var(--text); margin: 0; padding: 10px 0;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.check-item:last-child { border-bottom: none; }
.check-item input[type="checkbox"], .check-item input[type="radio"] {
  width: 22px; height: 22px; min-height: 0; padding: 0; flex-shrink: 0;
  accent-color: var(--accent); margin-top: 0;
}
.check-detail { margin: -4px 0 8px 32px; width: calc(100% - 32px); }
.photo-pick { display: flex; align-items: center; gap: 12px; }
.form-actions { position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); display: flex; gap: 8px; margin-top: 8px; }
.form-actions > * { flex: 1; box-shadow: 0 4px 16px rgba(0,0,0,0.5); }
.public-intro { margin-bottom: 16px; }
.public-intro h1 { font-size: 22px; margin-bottom: 6px; }
.public-done { text-align: center; padding-top: 14dvh; }
.public-done .big { font-size: 64px; margin-bottom: 12px; }
.link-box {
  font-size: 13px; color: var(--text-secondary); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  margin: 8px 0; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all;
}
.search { margin-bottom: 12px; }

/* Isa's logo, recoloured: line art in --text, paws in their own colours,
   straight on the dark background (icons/logo.png). */
.logo-card { margin-bottom: 16px; text-align: center; }
.logo-card img { width: 100%; max-width: 300px; display: block; margin: 0 auto; }
.login-wrap .logo-card { margin-bottom: 24px; }
.check-note { display: block; font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.public-footer { text-align: center; color: var(--text-secondary); font-size: 13px; line-height: 1.6; margin: 24px 0 8px; }
.public-footer a, .check-item a { color: var(--accent); }
