:root {
  --bg: #0f1419;
  --surface: #1a212b;
  --surface-2: #232c38;
  --text: #e7edf3;
  --muted: #8a97a6;
  --accent: #4cc2ff;
  --accent-ink: #06212e;
  --danger: #ff6b6b;
  --ok: #5dd39e;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body { padding: 0 0 env(safe-area-inset-bottom); }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px calc(14px + env(safe-area-inset-top));
  padding-top: max(14px, env(safe-area-inset-top));
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 18px; margin: 0; letter-spacing: 0.5px; }

main { max-width: 640px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }

h2 { font-size: 17px; margin: 0 0 8px; }

.card {
  background: var(--surface);
  border: 1px solid #2a3543;
  border-radius: var(--radius);
  padding: 16px;
}

.muted { color: var(--muted); font-size: 14px; margin: 4px 0; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.item-head { display: flex; align-items: center; gap: 10px; }
.item-pos {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2); border-radius: 50%;
  font-size: 13px; color: var(--muted);
}
.item-name { font-weight: 600; flex: 1; }

.sets { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.sets li {
  font-variant-numeric: tabular-nums;
  background: var(--surface-2);
  padding: 4px 10px; border-radius: 8px; font-size: 14px;
}

.rest {
  margin-top: 10px; padding: 8px 12px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 10px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rest.done { background: var(--ok); }

.log-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.log-row input {
  width: 72px; flex: 1 1 64px; min-width: 56px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid #2f3b4a; border-radius: 10px;
  padding: 10px; font-size: 16px; text-align: center;
}

button {
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 10px; padding: 10px 16px;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: default; }
button.secondary { background: var(--surface-2); color: var(--text); }

.actions { display: flex; gap: 10px; margin-top: 4px; }
.actions button { flex: 1; }

#picker-form { display: flex; gap: 8px; margin-top: 10px; }
#picker-form input {
  flex: 1; background: var(--surface-2); color: var(--text);
  border: 1px solid #2f3b4a; border-radius: 10px; padding: 10px; font-size: 15px;
}

.pill {
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); text-transform: lowercase;
}
.pill[data-status="active"] { background: #173a4d; color: var(--accent); }
.pill[data-status="completed"] { background: #143728; color: var(--ok); }
.pill[data-status="skipped"] { background: #3a2330; color: #d98aa6; }

.error {
  color: var(--danger); background: #2a1518;
  border: 1px solid #4a2429; border-radius: 10px; padding: 12px;
  font-size: 14px;
}

/* Pull-to-refresh hint (toggled by app.js when dragging down from the top). */
body.pulling::before {
  content: "↻ Loslassen zum Aktualisieren";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.85rem;
  background: #1b2430;
  color: #cfe3ff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
