/* =========================================================================
 * Stalbuddy 2.0 — styles.css
 * Design system: "Warm Premium Equestrian"
 * Mobile-first, licht/donker via [data-theme]. Serif-koppen + warme sans.
 * ========================================================================= */

:root {
  /* surfaces / canvas */
  --bg: #f1ebdd;
  --surface: #fdfbf6;
  --surface-2: #f4eddd;
  --surface-3: #efe7d4;
  /* tekst */
  --text: #2a2f25;
  --muted: #837e6c;
  --faint: #a39d88;
  /* lijnen */
  --border: #e6ddc9;
  --border-strong: #d8ccb0;
  /* merk */
  --primary: #4c7a63;
  --primary-2: #3f6a55;
  --primary-ink: #fbf8f1;
  --soft: #e4ede6;
  --accent: #bd7639;
  --accent-soft: #f3e4d1;
  --sand: #d8c6a2;
  --sand-soft: #ece0c8;
  /* status */
  --danger: #b1472f;
  --warn: #bd7a2c;
  --soon: #6e8a4e;
  --ok: #4c7a63;
  /* schaduw (warm, gelaagd, zacht) */
  --shadow: 0 1px 2px rgba(74,61,33,.05), 0 6px 16px rgba(74,61,33,.06);
  --shadow-lift: 0 2px 6px rgba(74,61,33,.08), 0 14px 30px rgba(74,61,33,.10);
  --shadow-up: 0 -10px 40px rgba(50,40,20,.16);
  /* vorm */
  --radius: 18px;
  --radius-sm: 13px;
  --radius-xs: 9px;
  --maxw: 600px;
  /* type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --dur: .24s;
}
[data-theme="dark"] {
  /* warm charcoal, strak en goed leesbaar — geen neon/gloed */
  --bg: #1a1c18;
  --surface: #242722;
  --surface-2: #2c2f29;
  --surface-3: #343832;
  --text: #f1f2ec;
  --muted: #b3b8ac;
  --faint: #868b7e;
  --border: #373a33;
  --border-strong: #474b41;
  --primary: #86b49d;
  --primary-2: #97c4ae;
  --primary-ink: #112019;
  --soft: #2a322c;
  --accent: #d39b5c;
  --accent-soft: #33302660;
  --sand: #38352b;
  --sand-soft: #30342b;
  --danger: #df7058;
  --warn: #d6a052;
  --soon: #a3b87f;
  --ok: #86b49d;
  --shadow: 0 1px 2px rgba(0,0,0,.30), 0 8px 22px rgba(0,0,0,.26);
  --shadow-lift: 0 2px 8px rgba(0,0,0,.34), 0 16px 34px rgba(0,0,0,.32);
  --shadow-up: 0 -10px 44px rgba(0,0,0,.45);
}
/* donker thema: vlak en strak — neutrale schaduwen, geen kleurgloed */
[data-theme="dark"] .btn.primary { box-shadow: none; }
[data-theme="dark"] .dot.online, [data-theme="dark"] .dot.offline { box-shadow: none; }
[data-theme="dark"] .bar-fill.good { background: #6fa98c; }
[data-theme="dark"] .bar-fill.mid { background: #c79257; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.012em; margin: 0; line-height: 1.18; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: .4em 0; }
a { color: var(--primary); text-decoration: none; }
.muted { color: var(--muted); }
.sm { font-size: .82rem; }
.center { text-align: center; }
.grow { flex: 1; }
.grow-right { margin-left: auto; }

#app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

/* ---------- icons ---------- */
.icon { width: 22px; height: 22px; flex: none; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 34px; height: 34px; }

/* ---------- avatars ---------- */
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--border); }
.avatar.mini { width: 30px; height: 30px; }
.avatar.xl { width: 104px; height: 104px; }
.avatar-horse { display: inline-flex; align-items: center; justify-content: center; background: var(--sand-soft); color: var(--primary); border: 1px solid var(--border); }
.avatar-horse .icon { width: 60%; height: 60%; }
.card-horse { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--sand-soft); color: var(--primary); }
.card-horse .icon { width: 38%; height: 38%; }
.avatar-fallback {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: var(--primary-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; text-transform: uppercase; flex: none; font-size: .85rem;
}
.avatar-fallback.lg { width: 64px; height: 64px; font-size: 1.6rem; }
.avatar-fallback.xl { width: 104px; height: 104px; font-size: 2.4rem; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 14px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-title { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; }
.horse-pill {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 14px 5px 5px; cursor: pointer;
  font-weight: 600; color: var(--text); box-shadow: var(--shadow);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.horse-pill:active { transform: scale(.97); }
.horse-pill .avatar { width: 28px; height: 28px; }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: transparent; border: none; color: var(--text); cursor: pointer;
  font-size: .8rem; font-weight: 600; transition: background var(--dur) var(--ease);
}
.iconbtn:hover { background: var(--surface-2); }
.iconbtn:active { transform: scale(.92); }
.iconbtn.sm { width: 33px; height: 33px; }

/* ---------- content + bottomnav ---------- */
.content { padding: 16px 15px 102px; display: flex; flex-direction: column; gap: 15px; animation: fade-up .26s var(--ease); }
.content.no-nav { padding-bottom: 28px; }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw); z-index: 30;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
}
.navitem {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); font-size: .68rem; font-weight: 600;
  padding: 4px 10px; border-radius: 12px; flex: 1; text-align: center;
  transition: color var(--dur) var(--ease);
}
.navitem .icon { transition: transform var(--dur) var(--ease); }
.navitem.active { color: var(--primary); }
.navitem.active .icon { transform: translateY(-2px) scale(1.06); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 12px 17px; font-size: .92rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: transform .06s var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:active { transform: scale(.975); }
.btn .icon { width: 18px; height: 18px; }
.btn.primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 2px rgba(74,61,33,.10), 0 6px 14px color-mix(in srgb, var(--primary) 28%, transparent); }
.btn.primary:hover { background: var(--primary-2); }
.btn.soft { background: var(--soft); color: var(--primary); }
.btn.soft:hover { background: color-mix(in srgb, var(--soft) 80%, var(--primary) 8%); }
.btn.ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 38%, transparent); }
.btn.full { width: 100%; }
.btn.sm { padding: 8px 13px; font-size: .82rem; }
.btn:disabled { opacity: .55; cursor: default; }
.link { font-weight: 600; font-size: .85rem; color: var(--primary); }

/* ---------- cards & rows ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 11px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card-head h2 .icon { color: var(--primary); }

.row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-top: 1px solid var(--border); }
.card .row:first-of-type, .timeline .row:first-child { border-top: none; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-main strong { font-weight: 600; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 2px; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.kv:first-child { border-top: none; }
.kv > span { color: var(--muted); }
.kv > strong { text-align: right; font-weight: 600; }

/* ---------- dashboard ---------- */
.hello { display: flex; align-items: center; justify-content: space-between; }
.hello h1 { font-size: 1.7rem; }
.today-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.today-block { background: var(--surface-2); border-radius: var(--radius-sm); padding: 13px; display: flex; flex-direction: column; gap: 4px; }
.today-block strong { font-size: 1.08rem; font-family: var(--font-display); font-weight: 600; }
.intensity { align-self: flex-start; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: .01em; }
.i-rust { background: #e4eaec; color: #46636d; }
.i-licht { background: #e6efe1; color: #4d7444; }
.i-matig { background: #f6e8d2; color: #8d621e; }
.i-zwaar { background: #f3ddd2; color: #9d4329; }
[data-theme="dark"] .i-rust { background: #28383d; color: #a4c8d2; }
[data-theme="dark"] .i-licht { background: #25382a; color: #a4d59b; }
[data-theme="dark"] .i-matig { background: #3c3220; color: #e8c478; }
[data-theme="dark"] .i-zwaar { background: #3d271f; color: #ef9e82; }

.ai-tile { background: linear-gradient(150deg, var(--soft) 0%, var(--surface) 70%); border-color: color-mix(in srgb, var(--primary) 16%, var(--border)); }
.chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.chiprow.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chiprow.scroll::-webkit-scrollbar { display: none; }

/* ---------- completeness / bars ---------- */
.completeness { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.completeness-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: .88rem; flex-wrap: wrap; }
.completeness-top .muted { font-weight: 400; }
.bar { height: 9px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar.sm { height: 5px; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width .6s var(--ease); }
.bar-fill.good { background: linear-gradient(90deg, var(--primary), #6fae8a); }
.bar-fill.mid { background: linear-gradient(90deg, var(--accent), #d39455); }
.bar-fill.low { background: var(--danger); }

/* ---------- badges & tags ---------- */
.badge { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge-info { background: #e4eaec; color: #46636d; }
.badge-warn { background: #f6e8d2; color: #8d621e; }
.badge-danger { background: #f3ddd2; color: #9d4329; }
.badge-soon { background: #e8efda; color: #5d7338; }
.badge-ok { background: var(--soft); color: var(--primary); }
.badge-soft { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
[data-theme="dark"] .badge-info { background: #28383d; color: #a4c8d2; }
[data-theme="dark"] .badge-warn { background: #3c3220; color: #e8c478; }
[data-theme="dark"] .badge-danger { background: #3d271f; color: #ef9e82; }
[data-theme="dark"] .badge-soon { background: #2c3422; color: #b6cc8f; }

.tag { font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.tag-wond, .tag-hoeven { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.tag-training { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.tag-voeding { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }

/* ---------- chips / choices ---------- */
.chip { font-size: .82rem; font-weight: 600; padding: 8px 14px; border-radius: 999px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); cursor: pointer; transition: all var(--dur) var(--ease); }
.chip:active { transform: scale(.96); }
.chip.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.chip-select { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.choice { padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); font-weight: 600; cursor: pointer; font-family: inherit; font-size: .9rem; transition: all var(--dur) var(--ease); }
.choice:active { transform: scale(.98); }
.choice.on { background: var(--soft); border-color: var(--primary); color: var(--primary); }

/* ---------- empty ---------- */
.empty { text-align: center; color: var(--muted); padding: 40px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .icon { color: var(--border-strong); }
.welcome { padding: 48px 22px; gap: 14px; }
.welcome h2 { color: var(--text); font-size: 1.4rem; }
.welcome p { max-width: 360px; line-height: 1.6; margin: 0; }
.welcome-logo { width: 84px; height: 84px; border-radius: 24px; background: var(--soft); color: var(--primary); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.welcome-logo .icon { width: 44px; height: 44px; color: var(--primary); }
.welcome .btn { margin-top: 6px; }

/* ---------- horses grid ---------- */
.cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.horse-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; text-align: left; padding: 0; display: flex; flex-direction: column; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.horse-card:active { transform: scale(.985); }
.horse-card-img { aspect-ratio: 4/3; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.horse-card-img img { width: 100%; height: 100%; object-fit: cover; }
.horse-card-body { padding: 11px 13px 14px; display: flex; flex-direction: column; gap: 6px; }
.horse-card-body strong { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.horse-card.add { align-items: center; justify-content: center; gap: 8px; min-height: 168px; color: var(--muted); border-style: dashed; font-weight: 600; }

/* ---------- wizard / intake ---------- */
.wizard { display: flex; flex-direction: column; gap: 17px; padding-top: 8px; }
.wizard-q { font-size: 1.5rem; line-height: 1.25; }
.req { color: var(--danger); }
.wizard-form { display: flex; flex-direction: column; gap: 10px; }
.wizard-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.photo-picker { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.photo-preview { width: 132px; height: 132px; border-radius: 24px; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--faint); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- profile ---------- */
.profile-hero { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; padding: 10px 0 4px; }
.hero-photo { position: relative; }
.hero-photo img { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface); box-shadow: var(--shadow); }
.profile-hero h1 { font-size: 1.7rem; }
.photo-edit { position: absolute; right: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: flex; align-items: center; justify-content: center; cursor: pointer; border: 3px solid var(--bg); }
.photo-edit .icon { width: 16px; height: 16px; }

/* ---------- planning ---------- */
.tabs { display: flex; gap: 6px; background: var(--surface-2); padding: 5px; border-radius: var(--radius-sm); }
.tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border: none; background: transparent; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit; font-size: .9rem; transition: all var(--dur) var(--ease); }
.tab .icon { width: 17px; height: 17px; }
.tab.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.planning-hint { margin: 0; }
.loadbar { gap: 9px; }
.week-list { display: flex; flex-direction: column; gap: 9px; }
.week-row { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px; cursor: pointer; text-align: left; box-shadow: var(--shadow); transition: transform var(--dur) var(--ease); }
.week-row:active { transform: scale(.99); }
.week-day { width: 36px; height: 36px; border-radius: 10px; background: var(--soft); display: flex; align-items: center; justify-content: center; font-weight: 700; text-transform: capitalize; color: var(--primary); flex: none; }
.week-main { flex: 1; display: flex; flex-direction: column; }
.feed-row { cursor: pointer; }
.cat-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.cat-ruwvoer { background: #7aa15a; }
.cat-krachtvoer { background: var(--accent); }
.cat-supplement { background: #5b95c9; }
.cat-medicatie { background: var(--danger); }

/* ---------- tasks ---------- */
.date-switch { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; box-shadow: var(--shadow); }
.date-switch strong { font-family: var(--font-display); }
.task-list { display: flex; flex-direction: column; gap: 9px; }
.task { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; cursor: pointer; box-shadow: var(--shadow); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.task:active { transform: scale(.99); }
.task.done { opacity: .55; }
.task.done .task-main strong { text-decoration: line-through; }
.checkbox { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--border-strong); display: flex; align-items: center; justify-content: center; flex: none; color: var(--primary-ink); transition: all var(--dur) var(--ease); }
.checkbox.on { background: var(--primary); border-color: var(--primary); animation: pop .26s var(--ease); }
.checkbox .icon { width: 16px; height: 16px; }
@keyframes pop { 0% { transform: scale(.7); } 55% { transform: scale(1.18); } 100% { transform: scale(1); } }
.task-main { display: flex; flex-direction: column; }

/* ---------- reminders ---------- */
.group-h { margin: 16px 0 2px; color: var(--text); font-size: .98rem; }
.group-h.muted { color: var(--muted); }
.reminder { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 9px; align-items: flex-start; }
.sticky-add { margin-top: 10px; }

/* ---------- logbook / timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 11px; }
.log { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.log.important { border-left: 3px solid var(--accent); }
.log-head { display: flex; align-items: center; gap: 8px; }
.log-head strong { font-weight: 600; }
.log-head .muted { flex: 1; }
.star { color: var(--border-strong); font-size: 1.05rem; }
.star.on { color: var(--accent); }
.log p { margin: 7px 0; }
.log-photo { width: 100%; max-height: 280px; object-fit: cover; border-radius: var(--radius-sm); margin: 7px 0; cursor: pointer; }
.log-photo.sm { max-height: 170px; }
.log-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.log-foot .iconbtn { margin-left: auto; }

/* ---------- health ---------- */
.health-event { display: flex; gap: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.he-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--soft); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.he-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.he-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.he-head strong { font-weight: 600; }
.he-actions { display: flex; justify-content: flex-end; }

/* ---------- AI ---------- */
.ai-status { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 13px; box-shadow: var(--shadow); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.online { background: #4caf7d; box-shadow: 0 0 0 3px color-mix(in srgb, #4caf7d 22%, transparent); }
.dot.offline { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.ai-summaries { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.ai-summaries::-webkit-scrollbar { display: none; }
.ai-summaries .btn { white-space: nowrap; }
.ai-thread { display: flex; flex-direction: column; gap: 11px; min-height: 180px; }
.ai-bubble { max-width: 88%; padding: 12px 15px; border-radius: 18px; line-height: 1.55; animation: fade-up .22s var(--ease); }
.ai-bubble.user { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 5px; }
.ai-bubble.ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; box-shadow: var(--shadow); }
.ai-bubble .md { font-size: .92rem; }
.ai-bubble .btn { margin-top: 9px; }
.based-on { margin-top: 9px; font-size: .74rem; color: var(--muted); border-top: 1px dashed var(--border-strong); padding-top: 7px; }
.ai-hint { text-align: center; color: var(--muted); padding: 22px 10px; display: flex; flex-direction: column; align-items: center; gap: 11px; }
.ai-hint .icon { color: var(--primary); }
.ai-hint .chiprow { justify-content: center; }
.typing { display: flex; gap: 4px; padding: 4px 0; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-input { display: flex; gap: 8px; position: sticky; bottom: 90px; }
.ai-input .input { flex: 1; }
.disclaimer { font-size: .74rem; color: var(--muted); text-align: center; margin: 2px 0 0; }

/* ---------- members ---------- */
.member-list { display: flex; flex-direction: column; gap: 9px; }
.member { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow); }
.mini-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.role-legend { margin-top: 6px; }
.role-legend h3 { margin-bottom: 4px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.field-label { font-size: .84rem; font-weight: 600; color: var(--muted); font-family: var(--font-sans); }
.field-hint { font-size: .76rem; color: var(--muted); }
.input {
  width: 100%; padding: 12px 13px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font-family: inherit; font-size: .95rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
textarea.input { resize: vertical; min-height: 62px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23837e6c' stroke-width='2'%3E%3Cpath d='M3 5l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px; }
.switch-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-weight: 500; cursor: pointer; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--primary); }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow .btn { flex: 1; }

/* ---------- modal / sheet ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(28,24,14,.42); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity var(--dur) var(--ease); backdrop-filter: blur(2px); }
.modal-overlay.show { opacity: 1; }
.modal { width: 100%; max-width: var(--maxw); background: var(--surface); border-radius: 24px 24px 0 0; max-height: 92vh; overflow-y: auto; transform: translateY(24px); transition: transform .26s var(--ease); box-shadow: var(--shadow-up); }
.modal-overlay.show .modal { transform: translateY(0); }
@media (min-width: 620px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: 22px; margin: 16px; }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 17px 8px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h3 { font-size: 1.15rem; }
.modal-body { padding: 4px 17px 8px; }
.modal-body > p:first-child { margin-top: 0; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 13px 17px calc(17px + env(safe-area-inset-bottom)); position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); }
.modal-foot .btn { flex-shrink: 0; }
.menu-list { padding: 6px 11px 18px; display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 15px 12px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; background: transparent; border: none; cursor: pointer; font-family: inherit; font-size: .96rem; text-align: left; width: 100%; transition: background var(--dur) var(--ease); }
.menu-item:hover { background: var(--surface-2); }
.menu-item .icon { color: var(--primary); }
.menu-item .avatar { width: 30px; height: 30px; }
.menu-item.on { background: var(--soft); color: var(--primary); }
.menu-item.add { color: var(--muted); }
.fullphoto { width: 100%; border-radius: 18px; display: block; }

/* ---------- update banner (nieuwe versie) ---------- */
.update-banner { position: fixed; bottom: 102px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 12px; background: var(--text); color: var(--bg); padding: 11px 14px 11px 18px; border-radius: 999px; box-shadow: var(--shadow-lift); font-size: .86rem; font-weight: 600; max-width: calc(100% - 28px); }
.update-banner button { background: var(--primary); color: var(--primary-ink); border: none; border-radius: 999px; padding: 7px 14px; font-weight: 700; cursor: pointer; font-family: inherit; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 108px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: 100%; max-width: var(--maxw); pointer-events: none; padding: 0 16px; }
.toast { background: #2a2f25; color: #fff; padding: 12px 19px; border-radius: 999px; font-size: .86rem; font-weight: 600; box-shadow: var(--shadow-lift); opacity: 0; transform: translateY(10px); transition: all .26s var(--ease); max-width: 100%; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--primary); }
.toast-error { background: var(--danger); }

/* desktop polish */
@media (min-width: 620px) {
  #app { box-shadow: 0 0 0 1px var(--border), var(--shadow); }
}
@media (hover: hover) and (pointer: fine) and (min-width: 620px) {
  .card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
  .horse-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
  .week-row:hover, .task:hover { box-shadow: var(--shadow-lift); }
}

/* ---------- AGENDA / KALENDER ---------- */
.cal-head { display: flex; align-items: center; gap: 6px; }
.cal-head strong { flex: 1; text-align: center; font-family: var(--font-display); font-size: 1.18rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { margin-top: 2px; }
.cal-dowcell { text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: capitalize; padding: 2px 0; }
.cal-cell { aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 2px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); cursor: pointer; font-family: inherit; color: var(--text); transition: transform var(--dur) var(--ease), background var(--dur) var(--ease); }
.cal-cell:active { transform: scale(.94); }
.cal-cell.out { opacity: .38; }
.cal-cell.today { background: var(--soft); border-color: var(--primary); }
.cal-cell.today .cal-num { color: var(--primary); font-weight: 700; }
.cal-cell.sel { box-shadow: 0 0 0 2px var(--primary); }
.cal-num { font-size: .86rem; font-weight: 600; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; min-height: 8px; }
.cdot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.cdot.info { background: #5b95c9; } .cdot.warn { background: var(--warn); } .cdot.danger { background: var(--danger); }
.cdot.health { background: var(--accent); } .cdot.wedstrijd { background: #a274c4; }
.cdot.ex-licht { background: #7aa15a; } .cdot.ex-matig { background: #c79a3e; } .cdot.ex-zwaar { background: #cc6a4a; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 13px; justify-content: center; margin-top: 12px; font-size: .74rem; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.agenda-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; box-shadow: var(--shadow); margin-bottom: 8px; cursor: pointer; }
.agenda-date { width: 44px; flex: none; display: flex; flex-direction: column; align-items: center; background: var(--soft); border-radius: 10px; padding: 6px 0; color: var(--primary); }
.ad-day { font-size: 1.15rem; font-weight: 700; font-family: var(--font-display); line-height: 1; }
.ad-dow { font-size: .64rem; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.week-overview { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.wk-row { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 13px; box-shadow: var(--shadow); cursor: pointer; text-align: left; font-family: inherit; color: var(--text); transition: transform var(--dur) var(--ease); }
.wk-row:active { transform: scale(.99); }
.wk-row.is-today { border-color: var(--primary); background: var(--soft); }
.wk-date { width: 40px; flex: none; display: flex; flex-direction: column; align-items: center; }
.wk-dow { font-size: .66rem; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.wk-num { font-size: 1.25rem; font-weight: 700; font-family: var(--font-display); line-height: 1.05; }
.wk-row.is-today .wk-num, .wk-row.is-today .wk-dow { color: var(--primary); }
.wk-side { display: flex; align-items: center; gap: 6px; flex: none; }
.cal-year { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.cal-mini { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 9px 8px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; font-family: inherit; transition: transform var(--dur) var(--ease); }
.cal-mini:active { transform: scale(.96); }
.mini-title { font-weight: 600; font-size: .78rem; text-align: center; color: var(--primary); font-family: var(--font-display); }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini-day { width: 100%; aspect-ratio: 1 / 1; border-radius: 2px; background: var(--surface-3); }
.mini-day.o { background: transparent; }
.mini-day.e { background: var(--primary); }
.mini-day.t { outline: 1.5px solid var(--accent); outline-offset: -1px; }

/* ---------- AI (herontwerp: vraag + antwoord bovenaan) ---------- */
.ai-ask { display: flex; gap: 8px; }
.ai-ask .input { flex: 1; }
.ai-ask .btn { flex: none; width: 50px; padding: 0; }
.ai-suggest { margin-top: -2px; }
.ai-summaries { align-items: center; }
.ai-sum-label { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.ai-current { min-height: 80px; }
.ai-q { font-weight: 600; color: var(--text); margin-bottom: 9px; padding-left: 12px; border-left: 3px solid var(--primary); border-radius: 0; }
.ai-answer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); animation: fade-up .22s var(--ease); }
.ai-answer .md { font-size: .94rem; line-height: 1.6; }
.ai-history { margin-top: 2px; }
.ai-history > summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 9px 2px; font-size: .86rem; list-style: none; }
.ai-history > summary::-webkit-details-marker { display: none; }
.ai-history > summary::before { content: "▸  "; color: var(--faint); }
.ai-history[open] > summary::before { content: "▾  "; }
.ai-history-list { display: flex; flex-direction: column; gap: 7px; }
.ai-hist { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.ai-hist > summary { cursor: pointer; padding: 12px 13px; font-size: .88rem; font-weight: 500; list-style: none; color: var(--text); }
.ai-hist > summary::-webkit-details-marker { display: none; }
.ai-hist > .ai-answer { border: none; border-radius: 0; box-shadow: none; border-top: 1px solid var(--border); }

/* ---------- zoeken ---------- */
.srch-results { margin-top: 12px; display: flex; flex-direction: column; gap: 14px; min-height: 60px; }
.srch-hint { padding: 8px 2px; }
.srch-group h4 { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 6px; font-family: var(--font-sans); font-weight: 600; }
.srch-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; cursor: pointer; font-family: inherit; font-size: .9rem; color: var(--text); margin-bottom: 6px; }
.srch-item:hover { background: var(--soft); }
.srch-item .icon { color: var(--primary); flex: none; }
.srch-item .avatar { width: 26px; height: 26px; }
.srch-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- multi-foto ---------- */
.multi-photo { display: flex; flex-direction: column; gap: 10px; }
.mp-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-strip:empty { display: none; }
.mp-thumb { position: relative; width: 74px; height: 74px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.mp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mp-del { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(20,16,8,.6); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.mp-del .icon { width: 13px; height: 13px; }

/* ---------- logboek galerij ---------- */
.log-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 7px 0; }
.log-gallery.single { grid-template-columns: 1fr; }
.log-gallery .log-photo { margin: 0; max-height: 200px; width: 100%; }
.log-gallery.single .log-photo { max-height: 280px; }

/* ---------- AI antwoord-acties ---------- */
.ai-answer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
