/* Look: soft periwinkle background, big white rounded cards, black pill buttons,
   coloured tiles (lilac, yellow, blue, mint, peach). Fine-tuning later in Paper. */
:root {
  --bg: #e3e7fb;
  --surface: #ffffff;
  --surface-2: #f3f4fa;
  --ink: #111114;
  --muted: #6e7083;
  --line: #e7e8f2;
  --primary: #111114;
  --primary-ink: #ffffff;
  --lilac: #e4adf6;
  --blue: #b4bff9;
  --yellow: #f7cd62;
  --mint: #bde9d0;
  --peach: #f9bf98;
  --tile-ink: #111114;
  --danger: #c4372b;
  --radius: 14px;
  --radius-s: 9px;
  --radius-btn: 12px;
  --tabs-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151c;
    --surface: #1f2029;
    --surface-2: #2a2b36;
    --ink: #f3f3f7;
    --muted: #a2a4b6;
    --line: #2f303c;
    --primary: #f3f3f7;
    --primary-ink: #111114;
    --lilac: #c993dc;
    --blue: #98a4e6;
    --yellow: #e2b84f;
    --mint: #9fcfb3;
    --peach: #e2a37c;
    --danger: #ff8a7f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) 16px calc(var(--tabs-h) + env(safe-area-inset-bottom) + 32px);
}
h1 { font-size: 30px; line-height: 1.12; margin: 0 0 6px; letter-spacing: -0.02em; font-weight: 800; }
h2 { font-size: 18px; margin: 30px 0 12px; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
a { color: var(--ink); text-underline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { color: var(--muted); margin-bottom: 22px; }

/* Greeting row */
.greet { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.greet .hello { font-weight: 800; font-size: 17px; line-height: 1.2; }
.greet .sub { font-size: 13px; color: var(--muted); }

/* Tabs: tabs stay tabs. Active = dark text + dot. */
#tabs {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  width: calc(100% - 24px); max-width: 520px;
  display: flex; justify-content: space-around;
  background: var(--surface);
  border-radius: 13px;
  box-shadow: 0 8px 30px rgba(30, 34, 80, 0.12);
  z-index: 1000;
}
#tabs a {
  flex: 1;
  height: var(--tabs-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700;
}
#tabs a::after {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: transparent;
}
#tabs a.active { color: var(--ink); }
#tabs a.active::after { background: var(--ink); }

/* Buttons and inputs */
button, .button {
  font: inherit; font-weight: 700;
  border: 0; border-radius: var(--radius-btn);
  padding: 14px 22px; min-height: 48px;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.primary { background: var(--primary); color: var(--primary-ink); }
.primary.arrow::after {
  content: '→' / ''; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-ink); color: var(--primary); font-size: 16px; margin-right: -12px;
}
.secondary { background: var(--surface-2); color: var(--ink); }
.danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.link {
  background: none; color: var(--ink); padding: 4px 0; min-height: 0;
  border-radius: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}
.link.quiet { color: var(--muted); font-weight: 600; }
button:disabled { opacity: 0.45; cursor: default; }
.block { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gap-top { margin-top: 18px; }

label { display: block; font-weight: 700; margin: 18px 0 8px; font-size: 15px; }
input[type=text], textarea, select {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-s);
  padding: 13px 16px;
}
input[type=file] { font: inherit; font-size: 14px; color: var(--muted); }
textarea { resize: vertical; min-height: 72px; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2.5px solid var(--ink); outline-offset: 2px;
}
.counter { text-align: right; font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.who { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.who .name { font-weight: 800; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--blue); color: var(--tile-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; flex: none; object-fit: cover;
}
.avatar.big { width: 80px; height: 80px; font-size: 28px; }

/* Coloured place tile inside a check-in card */
.tile {
  border-radius: 11px; padding: 16px 18px; color: var(--tile-ink);
  background: var(--blue);
}
.tile.kind-cafe { background: var(--yellow); }
.tile.kind-kneipe { background: var(--lilac); }
.tile.kind-restaurant { background: var(--peach); }
.tile.kind-park { background: var(--mint); }
.tile.kind-laden { background: var(--blue); }
.tile .kind { font-size: 13px; font-weight: 700; opacity: 0.7; margin-bottom: 2px; }
.tile .place { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin: 0; line-height: 1.15; }
.tile .text { margin: 8px 0 0; }

.photo { width: 100%; border-radius: 11px; margin: 10px 0 0; display: block; }
.actions { display: flex; gap: 18px; align-items: center; margin-top: 14px; flex-wrap: wrap; padding: 0 4px; }
.liked { color: var(--ink); }
.comments { margin-top: 12px; padding: 12px 4px 0; border-top: 1px solid var(--line); }
.comment { font-size: 15px; margin-bottom: 6px; }
.comment b { margin-right: 6px; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form input { flex: 1; padding: 11px 16px; border-radius: var(--radius-s); }
.comment-form button { padding: 10px 18px; min-height: 44px; }

.notice { background: var(--lilac); color: var(--tile-ink); }
.notice .link { color: var(--tile-ink); }

/* Map */
#map {
  height: 240px; border-radius: var(--radius); margin-bottom: 16px; z-index: 0; overflow: hidden;
}
.leaflet-container { font: inherit; background: var(--surface-2); }

/* Place list */
.places { list-style: none; padding: 0; margin: 10px 0 0; }
.places li {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-s);
  background: var(--surface); margin-bottom: 8px; border: 2px solid transparent;
}
.places li.selected { border-color: var(--ink); }
.places li.group { border: 0; background: none; padding: 10px 4px 2px; font-size: 14px; font-weight: 700; color: var(--muted); }
.places label { flex: 1; margin: 0; font-weight: 700; display: flex; gap: 12px; align-items: center; cursor: pointer; font-size: 16px; }
.places input[type=radio] { accent-color: var(--ink); width: 20px; height: 20px; }
.places .meta { font-size: 13px; color: var(--muted); font-weight: 500; }

.share-box {
  background: var(--surface); border-radius: var(--radius-s);
  padding: 14px 16px; word-break: break-all; font-size: 14px; margin: 12px 0;
  border: 1.5px dashed var(--muted);
}

.empty { text-align: center; padding: 34px 18px; background: var(--blue); color: var(--tile-ink); border-radius: var(--radius); }
.empty p { color: var(--tile-ink); font-weight: 600; }

.member { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.member .info { flex: 1; min-width: 0; }
.member .name { font-weight: 800; }
.member .bio { font-size: 14px; color: var(--muted); }
.member button { padding: 10px 16px; min-height: 40px; }

/* Login / invite: coloured hero block with the big headline */
.hero { padding-top: 4vh; }
.hero-block {
  background: var(--lilac); color: var(--tile-ink);
  border-radius: 18px; padding: 36px 24px 28px; text-align: center; margin-bottom: 20px;
}
.illu { display: block; width: 100%; max-width: 230px; height: auto; margin: -8px auto 10px; }
.hero-block.blue { background: var(--blue); }
.hero-block.yellow { background: var(--yellow); padding: 20px 24px 4px; }
.empty .illu { max-width: 200px; margin: 0 auto 8px; }
.hero-block h1 { font-size: 38px; }
.hero-block .lead { color: var(--tile-ink); opacity: 0.8; margin: 0; }
.hero form, .hero > .primary { margin-top: 4px; }

.error { color: var(--danger); font-size: 15px; margin-top: 10px; font-weight: 600; }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 24px);
  background: var(--ink); color: var(--bg); font-weight: 700;
  padding: 12px 20px; border-radius: var(--radius-btn); font-size: 15px; z-index: 2000;
  max-width: calc(100% - 32px);
}

footer.page { margin-top: 32px; font-size: 13px; color: var(--muted); text-align: center; }
footer.page a { color: var(--muted); }

[hidden] { display: none !important; }
