/* Jacky Schnecky – Design
   Farben aus dem Foto: Fell-Schiefer, Pflasterstein, Moos, Augenbraun. Amber = "hier wird jemand gebraucht". */

@font-face { font-family: "Bricolage Grotesque"; src: url(../fonts/bricolage-grotesque-latin-wght-normal.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url(../fonts/instrument-sans-latin-wght-normal.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #e6e9e4;
  --surface: #f6f7f4;
  --surface-2: #eceee9;
  --ink: #262a30;
  --ink-2: #5a616a;
  --line: #cdd3cc;
  --open: #f0ae2b;
  --open-ink: #2b2008;
  --open-soft: #fbe8b9;
  --ok: #3f7d4b;
  --danger: #b4402f;
  --danger-soft: #f6dcd6;
  --shadow: 0 1px 2px rgba(30, 36, 30, .08), 0 6px 20px rgba(30, 36, 30, .08);
  --head: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabbar-h: 62px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17191d; --surface: #22262b; --surface-2: #2b3036; --ink: #e8ebe6; --ink-2: #9aa2aa; --line: #3a4048;
    --open-soft: #4a3a14; --danger: #e0705e; --danger-soft: #4a2a25; --ok: #6fb47c; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17191d; --surface: #22262b; --surface-2: #2b3036; --ink: #e8ebe6; --ink-2: #9aa2aa; --line: #3a4048;
  --open-soft: #4a3a14; --danger: #e0705e; --danger-soft: #4a2a25; --ok: #6fb47c; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; }
body { min-height: 100vh; }
h1, h2, h3 { font-family: var(--head); font-weight: 650; letter-spacing: -.01em; margin: 0; line-height: 1.15; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--open); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-2); }
.small { font-size: .86rem; }
.num { font-variant-numeric: tabular-nums; }

/* Layout */
#app { max-width: 720px; margin: 0 auto; min-height: 100vh; padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px); }
#app.auth { padding-bottom: 32px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.topbar .grow { flex: 1; min-width: 0; }
.topbar .sub { color: var(--ink-2); font-size: .9rem; }
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; border: 2px solid var(--surface); box-shadow: var(--shadow); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.card { background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 2px 8px; }

/* Tabbar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar nav { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabbar-h); }
.tab { background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-2); font-size: .74rem; font-weight: 500; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 650; }
.tab[aria-current="page"] svg { stroke-width: 2.3; }
.tab .badge { position: relative; }
.tab .badge i { position: absolute; top: -3px; right: -6px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--open); color: var(--open-ink); font-style: normal; font-size: .68rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }

/* Buttons */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 16px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.open { background: var(--open); color: var(--open-ink); border-color: var(--open); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; padding: 0; }
.iconbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .lbl { font-size: .86rem; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=tel], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--open) 55%, transparent); border-color: var(--open); }
.hint { font-size: .84rem; color: var(--ink-2); }
.err { color: var(--danger); font-size: .92rem; font-weight: 500; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.switch input { appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(20px); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 9px 6px; font-weight: 600; font-size: .92rem; color: var(--ink-2); min-height: 40px; }
.seg.grid2 { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; width: 100%; }
.choice[aria-pressed="true"] { border-color: var(--ink); }
.choice .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink-2); flex: none; margin-top: 2px; display: grid; place-items: center; }
.choice[aria-pressed="true"] .dot { border-color: var(--ink); }
.choice[aria-pressed="true"] .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }

/* Tagesleiste: Jackys Tag als Streifen */
.strip { position: relative; height: 16px; border-radius: 8px; overflow: hidden; background:
  repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--ink-2) 28%, transparent) 4px 5px), var(--surface-2); }
.strip.mini { height: 6px; border-radius: 3px; }
.strip.big { height: 26px; border-radius: 13px; }
.strip i { position: absolute; top: 0; bottom: 0; display: block; }
.strip i.gap { background: var(--open); }
.strip i.now { width: 3px; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); z-index: 2; }
.ticks { display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink-2); margin-top: 4px; }

/* Hero */
.hero { position: relative; overflow: hidden; }
.hero.alert { background: var(--open-soft); }
.hero .who { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hero .who .bubble { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--head); font-weight: 700; color: #fff; font-size: 1.15rem; }
.hero h2 { font-size: 1.4rem; }

/* Zeilen im Tag */
.seglist { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.seg-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border-left: 6px solid var(--line); }
.seg-row.gap { background: var(--open-soft); border-left-color: var(--open); }
.seg-row .time { font-family: var(--head); font-weight: 650; font-size: 1.02rem; white-space: nowrap; }
.seg-row .who { flex: 1; min-width: 0; }
.seg-row .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg-row .acts { display: flex; gap: 6px; flex: none; }
.note { font-size: .9rem; color: var(--ink-2); padding: 2px 2px 0; }

/* Kalender */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h2 { font-size: 1.35rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { text-align: center; font-size: .78rem; color: var(--ink-2); font-weight: 600; padding: 2px 0 4px; }
.day { background: var(--surface); border: 1px solid transparent; border-radius: 12px; min-height: 58px; padding: 6px 5px 6px; display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; text-align: left; }
.day .n { font-family: var(--head); font-weight: 650; font-size: .98rem; padding-left: 2px; }
.day.out { background: transparent; opacity: .45; }
.day.today { border-color: var(--ink); }
.day.today .n { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.day.empty { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: .84rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 22px; height: 8px; border-radius: 4px; display: inline-block; }

/* Liste */
.daycard h3 { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.daycard h3 small { font-family: var(--body); font-weight: 500; color: var(--ink-2); font-size: .85rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: .9rem; min-height: 38px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.empty-state { text-align: center; padding: 34px 16px; color: var(--ink-2); }
.empty-state h3 { color: var(--ink); margin-bottom: 6px; }

/* Hund */
.dogphoto { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 18px; background: var(--surface-2); }
.infoblock { padding: 14px 0; border-bottom: 1px solid var(--line); }
.infoblock:last-child { border-bottom: 0; }
.infoblock h3 { font-size: .9rem; color: var(--ink-2); font-family: var(--body); font-weight: 600; margin-bottom: 4px; }
.infoblock .val { white-space: pre-wrap; }
.infoblock a { color: inherit; font-weight: 650; }

/* Listen (Admin) */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.item:last-child { border-bottom: 0; }
.item .dotc { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.item .grow b { display: block; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 650; background: var(--surface-2); color: var(--ink-2); }
.tag.admin { background: var(--ink); color: var(--bg); }
.tag.warn { background: var(--open-soft); color: var(--open-ink); }
.tag.off { background: var(--danger-soft); color: var(--danger); }
.code { font-family: var(--head); font-weight: 700; letter-spacing: .14em; font-size: 1.25rem; }

/* Sheet */
.backdrop { position: fixed; inset: 0; background: rgba(15, 18, 16, .5); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet { background: var(--bg); width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; border-radius: 24px 24px 0 0; padding: 20px 16px calc(env(safe-area-inset-bottom, 0px) + 20px); animation: up .2s ease; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: -8px auto 14px; }
.sheet h2 { margin-bottom: 14px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 14px; z-index: 60; max-width: calc(100% - 32px); font-weight: 550; box-shadow: var(--shadow); }
.toast.bad { background: var(--danger); color: #fff; }

/* Anmeldung */
.authwrap { max-width: 420px; margin: 0 auto; padding-top: 6vh; }
.authwrap .logo { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 18px; box-shadow: var(--shadow); border: 4px solid var(--surface); }
.authwrap h1 { text-align: center; margin-bottom: 4px; }
.authwrap .lead { text-align: center; color: var(--ink-2); margin-bottom: 22px; }

.banner { background: var(--open-soft); color: var(--ink); border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }

/* Etappe 2 + 3 */
a.btn { text-decoration: none; color: inherit; text-align: left; }
.iconbtn.sm { width: 36px; height: 36px; }
.iconbtn.sm svg { width: 19px; height: 19px; }
.lastrow { display: flex; flex-direction: column; }
.banner.soft { background: var(--surface-2); }
.banner b { font-weight: 650; }
.banner .row { flex: none; }
.bellbtn { position: relative; }
.bellbtn .dotn { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--open); color: var(--open-ink); font-style: normal; font-size: .7rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.toast { display: flex; align-items: center; gap: 14px; }
.toastbtn { background: transparent; border: 0; color: var(--open); font-weight: 700; padding: 4px 2px; }
.bar { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.bar.big { height: 14px; border-radius: 7px; }
.bar i { display: block; height: 100%; border-radius: inherit; transition: width .2s; }
.bigstat { font-family: var(--head); font-weight: 700; font-size: 1.9rem; line-height: 1.1; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; cursor: pointer; }
.note.ho { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; margin: 6px 2px 0; white-space: pre-wrap; }
.logrow .grow b { font-variant-numeric: tabular-nums; }
.logrow .grow span { display: block; }

@media (min-width: 720px) {
  #app { padding-top: 28px; }
  .day { min-height: 74px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
