/* PferdeZeit – Design System */
:root {
  --forest: #1F3A2E;
  --forest-2: #2C4D3D;
  --forest-3: #3E6651;
  --moss: #7C9A7E;
  --sage: #C9D6C3;
  --sage-2: #E8EEE3;
  --beige: #EDE3D1;
  --sand: #D9C6A3;
  --sand-2: #F4EDE0;
  --cream: #F8F4EC;
  --paper: #FFFDF9;
  --ink: #1B211D;
  --ink-2: #414943;
  --muted: #7D8279;
  --line: #ECE5D8;
  --amber: #B97A1F;
  --amber-bg: #FAEFD9;
  --clay: #B04F37;
  --clay-bg: #F8E4DC;
  --sky: #4F7A8C;
  --sky-bg: #E2EDF0;
  --ok: #3A7550;
  --ok-bg: #E2EFE5;
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(31, 58, 46, .05), 0 6px 20px rgba(31, 58, 46, .06);
  --shadow-lg: 0 10px 40px rgba(31, 58, 46, .16);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(1200px 700px at 15% 10%, #EFE6D4 0%, transparent 60%), radial-gradient(900px 600px at 90% 90%, #DCE5D6 0%, transparent 60%), var(--cream);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.ic { flex: none; display: block; }
.ic.inline { display: inline-block; vertical-align: -2px; }
.tl-card > button.grow { text-align: left; min-width: 0; }
.device.on-hero.scrolled .statusbar { background: rgba(255, 253, 249, .96); color: var(--ink); }
@media (min-width: 561px) { .device.on-hero .tabs { top: 50px; } }

/* ---------- Bühne / Gerät ---------- */
.stage { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 72px; padding: 28px; }
.intro { max-width: 360px; display: none; }
.intro .logo { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--forest); }
.intro .logo-mark { width: 48px; height: 48px; border-radius: 15px; background: var(--forest); color: var(--beige); display: grid; place-items: center; }
.intro h2 { font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1.15; margin: 28px 0 14px; color: var(--forest); letter-spacing: -.01em; }
.intro p { color: var(--ink-2); margin: 0 0 22px; }
.intro ul { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.intro li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: 14px; }
.intro li .ic { color: var(--forest-3); margin-top: 1px; }
.intro .hint { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
.intro .who { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.intro .who button { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.intro .who button.active { border-color: var(--forest); background: var(--forest); color: #fff; }
@media (min-width: 1000px) { .intro { display: block; } }

.device {
  position: relative; width: 402px; height: min(874px, calc(100vh - 56px)); min-height: 640px;
  border-radius: 54px; background: var(--paper); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 0 0 11px #171a18, 0 0 0 12px #3b403c, 0 50px 100px rgba(31, 40, 30, .35);
}
.statusbar { flex: none; height: 50px; display: flex; justify-content: space-between; align-items: center; padding: 8px 34px 0; font-weight: 600; font-size: 15px; z-index: 40; background: var(--paper); position: relative; }
.statusbar .notch { position: absolute; left: 50%; top: 11px; transform: translateX(-50%); width: 120px; height: 34px; background: #111; border-radius: 20px; }
.statusbar .sb-icons { display: flex; gap: 6px; align-items: center; }
.device.on-hero .statusbar { background: transparent; color: #fff; position: absolute; left: 0; right: 0; top: 0; }

@media (max-width: 560px) {
  .stage { padding: 0; display: block; }
  .device { width: 100%; height: 100vh; height: 100dvh; min-height: 0; border-radius: 0; box-shadow: none; }
  .statusbar { display: none; }
  .device.on-hero .statusbar { display: none; }
}

#view { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: 112px; position: relative; }
#view::-webkit-scrollbar { display: none; }

/* ---------- Tab Bar ---------- */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px 10px calc(14px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 249, .88); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-top: 1px solid var(--line);
}
.device:not(.mobile) .tabbar { padding-bottom: 24px; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 2px; color: var(--muted); font-size: 10.5px; font-weight: 500; position: relative; }
.tab .tab-ic { width: 52px; height: 32px; border-radius: 16px; display: grid; place-items: center; transition: background .2s, color .2s; }
.tab.active { color: var(--forest); font-weight: 600; }
.tab.active .tab-ic { background: var(--sage-2); }
.tab .dot { position: absolute; top: 4px; right: calc(50% - 20px); width: 8px; height: 8px; border-radius: 50%; background: var(--clay); border: 2px solid var(--paper); }

/* ---------- Seiten ---------- */
.page { padding: 6px 20px 20px; animation: fadeIn .28s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 0 18px; }
.eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--moss); }
.title { font-family: var(--serif); font-weight: 500; font-size: 31px; line-height: 1.1; letter-spacing: -.015em; color: var(--forest); margin: 4px 0 0; }
.subtitle { color: var(--muted); margin: 6px 0 0; font-size: 14.5px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 16px 4px; position: sticky; top: 0; z-index: 8; background: rgba(255, 253, 249, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.topbar h2 { font-size: 16px; font-weight: 600; margin: 0; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); color: var(--forest); position: relative; flex: none; transition: transform .15s; }
.icon-btn:active { transform: scale(.94); }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.glass { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .35); color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.icon-btn.solid { background: var(--forest); border-color: var(--forest); color: #fff; }
.icon-btn .badge-dot { position: absolute; top: -2px; right: -2px; min-width: 19px; height: 19px; border-radius: 10px; background: var(--clay); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--paper); }

.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-head h3 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.section-head h3 small { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 6px; }
.link { color: var(--forest-3); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 2px; }

.card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid rgba(236, 229, 216, .7); }
.card.pad { padding: 16px; }
.card.flat { box-shadow: none; }
.card.beige { background: var(--sand-2); border-color: transparent; box-shadow: none; }
.card.sage { background: var(--sage-2); border-color: transparent; box-shadow: none; }
.card.forest { background: var(--forest); color: #F3EEE3; border: 0; }
.card + .card { margin-top: 12px; }
.card-title { font-weight: 650; font-size: 15.5px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.card-sub { color: var(--muted); font-size: 13.5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Pills & Badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--sand-2); color: var(--ink-2); white-space: nowrap; line-height: 1.35; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--amber-bg); color: var(--amber); }
.pill.urgent { background: var(--clay-bg); color: var(--clay); }
.pill.info { background: var(--sky-bg); color: var(--sky); }
.pill.dark { background: var(--forest); color: #fff; }
.pill.line { background: transparent; border: 1px solid var(--line); }
.pill.glass { background: rgba(255, 255, 255, .2); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* ---------- Avatare ---------- */
.avatar { width: var(--s); height: var(--s); border-radius: 50%; background: var(--c); color: #fff; display: inline-grid; place-items: center; font-size: calc(var(--s) * .38); font-weight: 650; flex: none; letter-spacing: .02em; }
.avatar.ring { box-shadow: 0 0 0 2px #fff; }
.avatars { display: inline-flex; }
.avatars .avatar { box-shadow: 0 0 0 2px #fff; }
.avatars .avatar + .avatar { margin-left: -8px; }
.hthumb { width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; flex: none; display: inline-block; background: var(--sage); }
.hthumb img { width: 100%; height: 100%; object-fit: cover; }
.img-fallback { object-fit: cover; }

/* ---------- Dashboard ---------- */
.greet-date { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.weather { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--sand-2); margin-top: 2px; }
.weather .w-ic { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; color: var(--sky); flex: none; }
.weather strong { font-size: 14px; }
.weather span { font-size: 12.5px; color: var(--ink-2); }

.alert { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); position: relative; overflow: hidden; width: 100%; text-align: left; }
.alert + .alert { margin-top: 10px; }
.alert .a-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.alert.urgent { background: var(--clay-bg); border-color: #F0CFC3; }
.alert.urgent .a-ic { background: var(--clay); color: #fff; }
.alert.warn { background: var(--amber-bg); border-color: #F1DFB9; }
.alert.warn .a-ic { background: var(--amber); color: #fff; }
.alert.info .a-ic { background: var(--sky-bg); color: var(--sky); }
.alert .a-k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.alert.urgent .a-k { color: var(--clay); }
.alert.warn .a-k { color: var(--amber); }
.alert .a-t { font-weight: 650; font-size: 14.5px; }
.alert .a-s { font-size: 12.5px; color: var(--ink-2); }

.hscroll { display: flex; gap: 12px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 6px; scroll-snap-type: x mandatory; scroll-padding: 0 20px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hcard { flex: none; width: 168px; height: 212px; border-radius: var(--r-lg); overflow: hidden; position: relative; scroll-snap-align: start; box-shadow: var(--shadow); background: var(--sage); }
.hcard img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.hcard:active img { transform: scale(1.03); }
.hcard .hc-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(16, 30, 22, .78) 100%); }
.hcard .hc-body { position: absolute; left: 14px; right: 14px; bottom: 12px; color: #fff; }
.hcard .hc-name { font-family: var(--serif); font-size: 23px; font-weight: 500; line-height: 1.1; }
.hcard .hc-meta { font-size: 12px; opacity: .88; }
.hcard .hc-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; }
.hcard.add { background: var(--sand-2); border: 1.5px dashed var(--sand); box-shadow: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--forest-3); font-weight: 600; font-size: 14px; width: 120px; }
.hcard.add .ic-wrap { width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; }

.progress-ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--forest-3) calc(var(--p) * 1%), var(--sage-2) 0); display: grid; place-items: center; flex: none; }
.progress-ring span { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--forest); }

/* ---------- Timeline ---------- */
.timeline { position: relative; }
.tl-item { display: grid; grid-template-columns: 44px 1fr; gap: 10px; position: relative; }
.tl-item + .tl-item { margin-top: 8px; }
.tl-time { font-size: 13px; font-weight: 650; color: var(--ink-2); padding-top: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.tl-card { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); text-align: left; width: 100%; position: relative; overflow: hidden; }
.tl-card::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3.5px; border-radius: 0 3px 3px 0; background: var(--c, var(--moss)); }
.tl-card .tl-ic { width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--c, var(--moss)) 14%, #fff); color: var(--c, var(--moss)); display: grid; place-items: center; flex: none; }
.tl-title { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.tl-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin-top: 3px; flex-wrap: wrap; }
.tl-item.done .tl-title { text-decoration: line-through; color: var(--muted); }
.tl-item.done .tl-card { background: var(--cream); }
.tl-item.done .tl-card::before { background: var(--sage); }
.tl-item.now .tl-time { color: var(--clay); }
.tl-item.urgent .tl-card { border-color: #EDC5B8; background: #FFF8F5; }
.now-line { display: flex; align-items: center; gap: 8px; margin: 10px 0 10px 54px; color: var(--clay); font-size: 11.5px; font-weight: 700; }
.now-line::after { content: ''; flex: 1; height: 1.5px; background: var(--clay); opacity: .5; }

.check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--sand); display: grid; place-items: center; color: transparent; flex: none; transition: all .2s; background: #fff; }
.check.on { background: var(--forest-3); border-color: var(--forest-3); color: #fff; animation: pop .3s ease; }
.check.locked { border-style: dashed; opacity: .7; }
@keyframes pop { 50% { transform: scale(1.18); } }

/* ---------- Listen ---------- */
.list { background: #fff; border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 14px; width: 100%; text-align: left; background: #fff; position: relative; }
.li + .li { border-top: 1px solid var(--line); }
button.li:active, a.li:active { background: var(--cream); }
.li .li-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--sage-2); color: var(--forest-3); }
.li .li-t { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.li .li-s { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.li .chev { color: #C2B9A6; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; font-size: 14px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv .k { color: var(--muted); flex: none; display: flex; align-items: center; gap: 6px; }
.kv .v { font-weight: 550; text-align: right; }

.msg { display: flex; gap: 10px; padding: 12px 14px; }
.msg + .msg { border-top: 1px solid var(--line); }
.msg .m-body { flex: 1; min-width: 0; }
.msg .m-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.msg .m-head strong { font-weight: 650; }
.msg .m-text { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--cream); }
.composer input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; background: #fff; outline: none; min-width: 0; }
.composer input:focus { border-color: var(--moss); }

/* ---------- Pferde ---------- */
.horse-card { display: block; border-radius: var(--r-xl); overflow: hidden; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line); }
.horse-card + .horse-card { margin-top: 16px; }
.horse-card .hc-img { height: 210px; position: relative; background: var(--sage); }
.horse-card .hc-img img { width: 100%; height: 100%; object-fit: cover; }
.horse-card .hc-img .hc-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(16, 30, 22, .7)); }
.horse-card .hc-img .hc-name { position: absolute; left: 18px; bottom: 14px; color: #fff; }
.horse-card .hc-img .hc-name h3 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 500; line-height: 1; }
.horse-card .hc-img .hc-name span { font-size: 13px; opacity: .9; }
.horse-card .hc-img .hc-tag { position: absolute; top: 14px; left: 14px; }
.horse-card .hc-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.horse-card .stat strong { display: block; font-size: 14.5px; }
.horse-card .stat span { font-size: 12px; color: var(--muted); }
.horse-card .hc-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: 13px; color: var(--ink-2); gap: 10px; }

.hero { position: relative; height: 330px; background: var(--sage); flex: none; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 20, 14, .38) 0%, rgba(10, 20, 14, 0) 28%, rgba(10, 20, 14, 0) 50%, rgba(14, 28, 20, .82) 100%); }
.hero .hero-top { position: absolute; top: 58px; left: 16px; right: 16px; display: flex; justify-content: space-between; gap: 8px; }
.device.mobile .hero .hero-top { top: calc(14px + env(safe-area-inset-top)); }
.hero .hero-body { position: absolute; left: 20px; right: 20px; bottom: 20px; color: #fff; }
.hero h1 { font-family: var(--serif); font-size: 42px; font-weight: 500; margin: 0; line-height: 1; letter-spacing: -.01em; }
.hero .hero-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 12px 20px; position: sticky; top: 0; z-index: 7; background: rgba(255, 253, 249, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { flex: none; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: var(--sand-2); display: inline-flex; align-items: center; gap: 6px; }
.tabs .active { background: var(--forest); color: #fff; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--sand-2); padding: 4px; border-radius: 14px; gap: 4px; }
.segmented a, .segmented button { text-align: center; padding: 9px 6px; border-radius: 11px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: flex; justify-content: center; align-items: center; gap: 6px; }
.segmented .active { background: #fff; color: var(--forest); box-shadow: 0 1px 3px rgba(31, 58, 46, .12); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.chip.active { background: var(--forest); color: #fff; border-color: var(--forest); }
.chip .count { font-size: 11px; background: var(--sand-2); color: var(--ink-2); border-radius: 8px; padding: 0 6px; }
.chip.active .count { background: rgba(255, 255, 255, .2); color: #fff; }

.quick-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qs { background: var(--sand-2); border-radius: var(--r-md); padding: 12px; }
.qs .qs-v { font-weight: 700; font-size: 16px; color: var(--forest); }
.qs .qs-k { font-size: 12px; color: var(--muted); }

.feed-block { display: grid; grid-template-columns: 62px 1fr; gap: 12px; padding: 14px 16px; }
.feed-block + .feed-block { border-top: 1px solid var(--line); }
.feed-time { font-weight: 700; color: var(--forest); font-size: 15px; }
.feed-time small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.feed-items { display: grid; gap: 4px; font-size: 14px; }
.feed-items div { display: flex; justify-content: space-between; gap: 8px; }
.feed-items span:last-child { font-weight: 600; color: var(--ink-2); white-space: nowrap; }

.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--amber-bg); color: #6E4C16; font-size: 13.5px; }
.note .ic { color: var(--amber); margin-top: 1px; }
.note.sage { background: var(--sage-2); color: var(--forest-2); }
.note.sage .ic { color: var(--forest-3); }
.note.sky { background: var(--sky-bg); color: #2F5363; }
.note.sky .ic { color: var(--sky); }

.dose { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--cream); }
.dose + .dose { margin-top: 8px; }
.dose.given { background: var(--ok-bg); }
.dose .d-time { font-weight: 700; width: 46px; font-variant-numeric: tabular-nums; }

.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; text-align: left; display: flex; flex-direction: column; }
.doc .doc-prev { height: 96px; background: var(--sand-2); display: grid; place-items: center; color: var(--forest-3); position: relative; }
.doc .doc-prev img { width: 100%; height: 100%; object-fit: cover; }
.doc .doc-prev .ext { position: absolute; bottom: 8px; left: 8px; font-size: 10.5px; font-weight: 700; background: #fff; padding: 2px 6px; border-radius: 6px; color: var(--ink-2); }
.doc .doc-prev .lock { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(31, 58, 46, .85); color: #fff; display: grid; place-items: center; }
.doc .doc-body { padding: 10px 12px 12px; }
.doc .doc-t { overflow-wrap: anywhere; hyphens: auto; font-weight: 600; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc .doc-s { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.paper-doc { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px 18px; box-shadow: 0 8px 24px rgba(0, 0, 0, .06); font-size: 12.5px; }
.paper-doc h4 { margin: 0 0 4px; font-family: var(--serif); font-size: 18px; font-weight: 500; color: var(--forest); }
.paper-doc table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.paper-doc th, .paper-doc td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.paper-doc th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.skel { height: 9px; border-radius: 5px; background: var(--sand-2); margin-top: 9px; }

.diary-day { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 8px; }
.entry { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.entry + .entry { margin-top: 10px; }
.entry .e-head { display: flex; align-items: center; gap: 10px; }
.entry .e-text { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.mood { display: inline-flex; gap: 2px; color: var(--amber); }

.lock-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--r-lg); background: var(--sand-2); color: var(--ink-2); }
.lock-card .ic { color: var(--forest-3); }
.lock-card strong { display: block; margin-bottom: 4px; color: var(--ink); }
.lock-card p { margin: 0; font-size: 13.5px; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 16px; color: var(--muted); font-size: 13.5px; }
.empty .ic { color: var(--sand); margin-bottom: 4px; }
.empty strong { color: var(--ink-2); font-size: 14.5px; }

/* ---------- Kalender ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.cal-head h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 22px; color: var(--forest); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 4px 0 6px; }
.cal-day { aspect-ratio: 1 / 1.05; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 7px; font-size: 14px; font-weight: 550; position: relative; }
.cal-day.out { color: #C9C2B4; }
.cal-day.today { color: var(--clay); font-weight: 750; }
.cal-day.sel { background: var(--forest); color: #fff; }
.cal-dots { display: flex; gap: 2.5px; margin-top: 4px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.cal-day.sel .cal-dots i { box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 14px; }
.week-strip button { padding: 8px 0; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff; border: 1px solid var(--line); }
.week-strip button small { font-size: 11px; color: var(--muted); font-weight: 600; }
.week-strip button b { font-size: 16px; font-weight: 650; }
.week-strip button.active { background: var(--forest); border-color: var(--forest); color: #fff; }
.week-strip button.active small { color: rgba(255, 255, 255, .7); }
.week-strip button.is-today b { color: var(--clay); }
.week-strip button.active.is-today b { color: #fff; }
.week-strip button i { width: 5px; height: 5px; border-radius: 50%; background: var(--moss); }
.week-strip button i.none { background: transparent; }

/* ---------- Aufgaben ---------- */
.task { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.task + .task { border-top: 1px solid var(--line); }
.task .t-body { flex: 1; min-width: 0; text-align: left; }
.task .t-title { font-weight: 600; font-size: 14.5px; }
.task .t-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.task.overdue .t-title { color: var(--clay); }
.comment { display: flex; gap: 10px; }
.comment + .comment { margin-top: 12px; }
.comment .c-bubble { background: var(--cream); border-radius: 4px 14px 14px 14px; padding: 9px 12px; font-size: 13.5px; flex: 1; }
.comment .c-bubble small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }

/* ---------- Personen & Rechte ---------- */
.person { display: flex; align-items: center; gap: 12px; padding: 14px; }
.person + .person { border-top: 1px solid var(--line); }
.perm-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.perm-row + .perm-row { border-top: 1px solid var(--line); }
.perm-row .p-ic { width: 34px; height: 34px; border-radius: 11px; background: var(--sage-2); color: var(--forest-3); display: grid; place-items: center; flex: none; }
.perm-row .p-t { font-weight: 600; font-size: 14px; }
.perm-row .p-s { font-size: 12px; color: var(--muted); }
.perm-row.disabled { opacity: .45; }
.matrix { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.matrix th, .matrix td { padding: 9px 4px; text-align: center; border-bottom: 1px solid var(--line); }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix th { font-size: 11px; color: var(--muted); font-weight: 600; }
.yes { color: var(--ok); }
.no { color: #CFC6B5; }

.toggle { position: relative; width: 48px; height: 28px; flex: none; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 2; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: #DCD3C2; transition: background .2s; }
.toggle span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.toggle input:checked + span { background: var(--forest-3); }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:disabled { cursor: not-allowed; }

/* ---------- Dienstleister ---------- */
.search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; color: var(--muted); }
.search input { flex: 1; border: 0; outline: none; padding: 12px 0; background: transparent; color: var(--ink); min-width: 0; }
.prov-ic { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--c); }
.prov-hero { text-align: center; padding: 8px 20px 6px; }
.prov-hero .prov-ic { width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 12px; }
.prov-hero h1 { font-family: var(--serif); font-weight: 500; font-size: 27px; margin: 0; color: var(--forest); }
.action-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.action-row a, .action-row button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: var(--r-md); background: var(--sand-2); color: var(--forest); font-size: 12px; font-weight: 600; }
.action-row .ic-c { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.stars { display: inline-flex; gap: 1px; color: var(--amber); }
.stars .off { color: #DDD3C0; }
.teaser { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 18px; background: linear-gradient(135deg, var(--forest) 0%, var(--forest-3) 100%); color: #F3EEE3; }
.teaser h4 { margin: 8px 0 4px; font-family: var(--serif); font-weight: 500; font-size: 20px; }
.teaser p { margin: 0; font-size: 13.5px; opacity: .85; }
.teaser .t-deco { position: absolute; right: -16px; bottom: -20px; opacity: .12; }

/* ---------- Profil ---------- */
.profile-card { display: flex; align-items: center; gap: 14px; padding: 18px; }
.profile-card h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 23px; }
.persona { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.persona button { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: var(--r-md); background: rgba(255, 255, 255, .08); border: 1.5px solid transparent; font-size: 12px; font-weight: 600; color: #EFE9DC; }
.persona button.active { background: rgba(255, 255, 255, .16); border-color: var(--sand); }
.persona button small { font-size: 9.5px; font-weight: 500; opacity: .75; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Benachrichtigungen ---------- */
.notif { display: flex; gap: 12px; padding: 14px; width: 100%; text-align: left; position: relative; }
.notif + .notif { border-top: 1px solid var(--line); }
.notif.unread { background: #FFFBF3; }
.notif .n-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); }
.notif .n-t { font-weight: 650; font-size: 14px; }
.notif .n-s { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.notif .n-time { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.notif .n-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--clay); position: absolute; right: 14px; top: 18px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 14px; font-weight: 650; font-size: 14.5px; transition: transform .12s, background .2s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--forest); color: #fff; }
.btn.secondary { background: var(--sage-2); color: var(--forest); }
.btn.ghost { background: var(--sand-2); color: var(--ink-2); }
.btn.outline { background: #fff; border: 1px solid var(--line); color: var(--forest); }
.btn.danger { background: var(--clay); color: #fff; }
.btn.danger-ghost { background: var(--clay-bg); color: var(--clay); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 11px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.fab { position: absolute; right: 18px; bottom: 104px; z-index: 25; height: 56px; padding: 0 20px 0 16px; border-radius: 20px; background: var(--forest); color: #fff; display: flex; align-items: center; gap: 8px; font-weight: 650; box-shadow: 0 10px 28px rgba(31, 58, 46, .35); }
.fab:active { transform: scale(.97); }

/* ---------- Sheet ---------- */
#sheet-root { position: absolute; inset: 0; z-index: 60; pointer-events: none; display: none; }
#sheet-root.open { display: block; pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(18, 28, 22, .42); opacity: 0; transition: opacity .25s; }
#sheet-root.show .sheet-backdrop { opacity: 1; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90%; background: var(--paper); border-radius: 28px 28px 0 0; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-lg); }
.sheet.tall { height: 90%; }
#sheet-root.show .sheet { transform: none; }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: #DCD3C2; margin: 9px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 4px 20px; flex: none; }
.sheet-head h3 { margin: 0; font-size: 18px; font-weight: 650; }
.sheet-body { padding: 8px 20px 20px; overflow-y: auto; flex: 1; scrollbar-width: none; }
.sheet-body::-webkit-scrollbar { display: none; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 20px 24px; border-top: 1px solid var(--line); flex: none; background: var(--paper); }
.sheet-foot .btn { flex: 1; }
.sheet-text { margin: 4px 0 8px; color: var(--ink-2); }

/* ---------- Formulare ---------- */
.field { display: grid; gap: 6px; margin-top: 14px; }
.field:first-child { margin-top: 4px; }
.field > label, .field > .lbl { font-size: 12.5px; font-weight: 650; color: var(--ink-2); letter-spacing: .01em; }
.input, .field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=date], .field input[type=time], .field input[type=number], .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 13px; padding: 12px 14px; outline: none; font-size: 15px; transition: border-color .2s, box-shadow .2s; appearance: none; -webkit-appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237D8279' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--moss); box-shadow: 0 0 0 3px rgba(124, 154, 126, .18); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row .field { margin-top: 14px; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice label { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > label > span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13.5px; font-weight: 550; cursor: pointer; transition: all .15s; }
.choice input:checked + span, .choice > label > input:checked + span { background: var(--forest); border-color: var(--forest); color: #fff; }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(124, 154, 126, .35); }
.choice.people > label > span { padding: 4px 12px 4px 4px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suggest button { padding: 6px 11px; border-radius: 999px; background: var(--sand-2); font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.upload-drop { border: 1.5px dashed var(--sand); border-radius: var(--r-md); background: var(--sand-2); padding: 20px; text-align: center; color: var(--forest-3); display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; position: relative; font-size: 13.5px; }
.upload-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-drop.has-file { border-style: solid; border-color: var(--moss); background: var(--sage-2); }

/* ---------- Toast ---------- */
#toast { position: absolute; left: 50%; bottom: 108px; transform: translate(-50%, 20px); background: var(--forest); color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 13.5px; font-weight: 550; display: flex; align-items: center; gap: 8px; z-index: 80; opacity: 0; pointer-events: none; transition: all .25s; max-width: calc(100% - 40px); box-shadow: var(--shadow-lg); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.divider { height: 1px; background: var(--line); margin: 16px 0; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.err-box { margin: 20px; padding: 14px; border-radius: 12px; background: var(--clay-bg); color: var(--clay); font-size: 12px; white-space: pre-wrap; }
