:root {
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f7f9;
  --card: #ffffff;
  --warn: #f59e0b;
  --warn-bg: #fffbeb;
  --danger: #b91c1c;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 16px 40px;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

/* ---------------------------------------------------------------- Kopfzeile */

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 0 12px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}

.topbar .title { flex: 1; text-align: center; }
.topbar h1 { margin: 0; font-size: 22px; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 28px;
  line-height: 1;
}
.nav.ghost { background: none; border: none; }
.nav:active { background: var(--line); }

.hint {
  max-width: 1100px;
  margin: 0 auto 12px;
  padding: 10px 14px;
  background: var(--warn-bg);
  border: 1px solid var(--warn);
  border-radius: 10px;
  font-size: 15px;
}

.empty { text-align: center; color: var(--muted); padding: 48px 0; }

.uploadbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto 14px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.uploadbar input[type="file"] { flex: 1 1 220px; min-width: 0; font-size: 14px; }

/* ------------------------------------------------------------------- Liste */

.list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 760px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.row:first-child { border-top: none; }
.row.review {
  background: var(--warn-bg);
  box-shadow: inset 4px 0 0 var(--warn);
}

.row .line {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.row .date {
  font-size: 19px;
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.row .date:hover { border-bottom-color: var(--ink); }
.row .sub { font-size: 13px; color: var(--muted); }
.row .badge {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--warn);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.row .actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}
.row .actions input[type="date"] {
  width: 150px;
  padding: 8px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.row .actions button { padding: 8px 12px; font-size: 14px; }

button, .btn {
  font: inherit;
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.del {
  background: none;
  color: var(--danger);
  border-color: transparent;
}
button:disabled { opacity: .5; cursor: default; }

/* -------------------------------------------------------------------- Login */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  width: 100%;
  max-width: 420px;
}
.card h1 { margin: 0 0 16px; font-size: 24px; }
.login label { display: block; margin-bottom: 16px; font-size: 14px; color: var(--muted); }
.login input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 13px;
  font-size: 17px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.login button { width: 100%; padding: 14px; font-size: 17px; }
.error { color: var(--danger); margin: 0 0 12px; }

.result .results { list-style: none; margin: 0 0 20px; padding: 0; }
.result .results li {
  padding: 10px 12px;
  border-radius: 9px;
  margin-bottom: 8px;
  background: #f3f4f6;
}
.result .results li.ok { background: #ecfdf5; }
.result .results li.dup { background: #f3f4f6; }
.result .results li.err { background: #fef2f2; color: var(--danger); }
.result .results strong { display: block; }
.result .results span { font-size: 13px; color: var(--muted); word-break: break-all; }
.result .results em { font-size: 13px; color: #92400e; }

.footend { text-align: center; padding: 28px 0 0; }
.footend a { color: var(--muted); font-size: 14px; }

/* -------------------------------------------------------- Mama: groß & ruhig */

body.share { font-size: 19px; padding-bottom: 200px; }
body.share .topbar h1 { font-size: 27px; }
body.share .topbar p { font-size: 17px; }
body.share .nav { width: 64px; height: 64px; font-size: 34px; }
body.share .list { max-width: 640px; }

.row.pick { padding: 0; }
.row.pick .grab {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 18px;
  cursor: pointer;
  min-width: 0;
}
.row.pick input[type="checkbox"] {
  width: 30px;
  height: 30px;
  flex: none;
  accent-color: #1f2937;
}
.row.pick .date { font-size: 23px; border: none; }
.row.pick .sub { font-size: 15px; margin-left: auto; }
.row.pick.picked { background: #eef2f7; box-shadow: inset 4px 0 0 var(--ink); }
.row.pick .open {
  padding: 18px 18px 18px 8px;
  font-size: 16px;
  color: var(--muted);
}

.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .06);
}
.bottombar .count { margin: 0; font-size: 17px; color: var(--muted); }
button.big {
  width: 100%;
  max-width: 520px;
  padding: 18px;
  font-size: 20px;
  font-weight: 600;
  border-radius: 12px;
}
button.secondary { background: #fff; color: var(--ink); }
.status { margin: 0; font-size: 15px; color: var(--muted); min-height: 1.2em; }

@media (min-width: 700px) {
  .bottombar { flex-direction: row; justify-content: center; }
  .bottombar .count { margin-right: 12px; }
  button.big { width: auto; }
  .status { margin-left: 12px; }
}
