:root {
  --bg: #0b0d12;
  --bg2: #141822;
  --card: #171c27;
  --line: #252b39;
  --fg: #eef1f7;
  --mut: #8b93a7;
  --date: #33d17a;
  --small: #4aa8ff;
  --absage: #ff9f43;
  --none: #7a8397;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  overscroll-behavior-y: contain;
}

body {
  min-height: 100dvh;
  padding-bottom: calc(72px + var(--safe-b));
}

/* -------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 12px;
  background: linear-gradient(var(--bg) 70%, transparent);
}

.topbar h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }

.geo {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--mut);
  white-space: nowrap;
  max-width: 55vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.geo .dot {
  width: 7px; height: 7px; flex: none;
  border-radius: 50%;
  background: var(--none);
}
.geo.ok .dot { background: var(--date); box-shadow: 0 0 8px var(--date); }
.geo.wait .dot { background: var(--absage); animation: pulse 1s infinite; }
.geo.err .dot { background: #ff5c5c; }
@keyframes pulse { 50% { opacity: .25; } }

main { padding: 0 16px; }

/* ----------------------------------------------------------- log */

.today { text-align: center; padding: 18px 0 6px; }
.today-num { font-size: 68px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.today-label { color: var(--mut); font-size: 14px; margin-top: 4px; }
.today-sub { color: var(--mut); font-size: 13px; margin-top: 10px; opacity: .8; }

.hint { color: var(--mut); font-size: 13px; text-align: center; margin: 18px 0 12px; }

.buttons { display: flex; flex-direction: column; gap: 12px; }

.ob {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--c, var(--none));
  border-radius: 16px;
  background: var(--card);
  color: var(--fg);
  font: inherit;
  text-align: left;
  transition: transform .12s, background .12s;
}
.ob:active { transform: scale(.975); background: var(--bg2); }
.ob[data-outcome="date"] { --c: var(--date); }
.ob[data-outcome="smalltalk"] { --c: var(--small); }
.ob[data-outcome="absage"] { --c: var(--absage); }
.ob[data-outcome="keine_reaktion"] { --c: var(--none); }

.ob-ico { font-size: 26px; flex: none; }
.ob-txt { flex: 1; display: flex; flex-direction: column; }
.ob-txt b { font-size: 18px; font-weight: 650; }
.ob-txt small { color: var(--mut); font-size: 12.5px; }

.ob-cnt {
  flex: none;
  min-width: 34px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 700;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border-radius: 9px;
  padding: 4px 8px;
}

.ob.saving { opacity: .55; pointer-events: none; }

.last {
  margin: 18px 0 4px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  font-size: 13px;
  color: var(--mut);
}
.last b { color: var(--fg); font-weight: 600; }
.last .undo {
  float: right;
  background: none;
  border: 0;
  color: var(--small);
  font: inherit;
  padding: 0 0 0 10px;
}

/* ------------------------------------------------------- verlauf */

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--mut);
  font: inherit;
  font-size: 13px;
}
.chip.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.daygroup { margin-bottom: 20px; }
.daygroup h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mut);
}

.item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--c, var(--none));
  border-radius: 13px;
}
.item[data-outcome="date"] { --c: var(--date); }
.item[data-outcome="smalltalk"] { --c: var(--small); }
.item[data-outcome="absage"] { --c: var(--absage); }
.item[data-outcome="keine_reaktion"] { --c: var(--none); }

.item .time { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 650; flex: none; width: 48px; }
.item .body { flex: 1; min-width: 0; }
.item .oc { font-size: 14px; font-weight: 600; color: var(--c); }
.item .loc { font-size: 13px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .note { font-size: 13px; color: var(--fg); opacity: .85; margin-top: 3px; white-space: pre-wrap; }
.item .acts { display: flex; gap: 14px; margin-top: 10px; }
.item .acts button, .item .acts a {
  background: none; border: 0; padding: 0;
  color: var(--mut); font: inherit; font-size: 13px; text-decoration: none;
}
.item .acts .del { color: #ff6b6b; }
.item .kebab { background: none; border: 0; color: var(--mut); font-size: 20px; line-height: 1; padding: 0 4px; }

.empty { text-align: center; color: var(--mut); padding: 48px 20px; font-size: 14px; }

/* --------------------------------------------------------- stats */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.card h2 { margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--mut); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; }
.kpi b { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.kpi span { font-size: 12px; color: var(--mut); }

.bar-row { margin-bottom: 12px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.bar-head span:last-child { color: var(--mut); font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--bg2); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--c); }

.hours { display: flex; align-items: flex-end; gap: 2px; height: 84px; }
.hours i { flex: 1; background: var(--small); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.hours-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--mut); margin-top: 6px; }

.days { display: flex; align-items: flex-end; gap: 5px; height: 90px; }
.dayCol { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; height: 100%; }
.dayCol i { display: block; border-radius: 2px; min-height: 0; }
.dayCol .lbl { font-size: 9px; color: var(--mut); text-align: center; margin-top: 4px; }

.place-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.place-row:last-child { border-bottom: 0; }
.place-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-row span:last-child { color: var(--mut); flex: none; font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------- tabbar */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  padding-bottom: var(--safe-b);
  background: rgba(11, 13, 18, .92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 0 12px;
  background: none;
  border: 0;
  color: var(--mut);
  font: inherit;
  font-size: 11px;
}
.tab span { font-size: 17px; line-height: 1; }
.tab.active { color: var(--fg); }

/* --------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 40;
  max-width: 88vw;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }
