/* מה קורה בקבוצה — the pilot group's dashboard.
   Mobile-first and Hebrew-first: this is opened from a WhatsApp link, on a phone, by people
   who are not looking for an app. Nothing here is clever; the whole design job is making a
   list of subjects read like something a person wrote. */

:root {
  color-scheme: dark;
  --bg: #14171c;
  --panel: #1b1f26;
  --panel-2: #222833;
  --line: #2b323d;
  --ink: #e9edf3;
  --ink-dim: #a3adbb;
  --ink-faint: #717d8d;
  --accent: #7fb4ff;
  --open: #ffcf70;
  --settled: #86dba1;
  --info: #9aa7b8;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Rubik, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.skip {
  position: absolute;
  inset-inline-start: -9999px;
}
.skip:focus {
  inset-inline-start: 8px;
  top: 8px;
  z-index: 10;
  background: var(--accent);
  color: #0b0e12;
  padding: 8px 12px;
  border-radius: 8px;
}

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 3;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { font-size: 26px; line-height: 1; }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; color: var(--ink-faint); font-size: 12.5px; }

main { padding: 14px 16px 90px; max-width: 720px; margin: 0 auto; }
.pane { margin-bottom: 16px; }

.status {
  margin: 0;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-dim);
}
.status.err { border-color: #5a3238; color: #ffb3b8; }

/* ── the numbers row ─────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: center;
}
.stat b { display: block; font-size: 20px; }
.stat span { display: block; font-size: 12px; color: var(--ink-faint); }

/* ── filters ─────────────────────────────────────────────────────────────────── */
/* On a phone the search gets its own row and the two dates share the next one — a
   three-row stagger (which is what plain flex-wrap produced at 430px) reads as broken. */
.filter { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.filter label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter label.grow { grid-column: 1 / -1; }
.filter input[type="date"] { min-width: 0; }
.filter .lbl { font-size: 12px; color: var(--ink-faint); }
.filter input {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  font-size: 15px;
  min-height: 42px;
}
.filter input:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 9px 14px;
  min-height: 42px;
  cursor: pointer;
}
.ghost { background: var(--panel-2); color: var(--ink-dim); }
.ghost:hover { color: var(--ink); }

/* ── the topic cards — the whole point of the page ───────────────────────────── */
.day { margin: 18px 0 8px; color: var(--ink-faint); font-size: 13px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.card > summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.card > summary::-webkit-details-marker { display: none; }
.card h2 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.card .body { padding: 0 14px 14px; color: var(--ink-dim); }
.card .body p { margin: 0 0 10px; }

.tag {
  flex: none;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
  margin-top: 2px;
}
.tag.open { color: var(--open); }
.tag.settled { color: var(--settled); }
.tag.info { color: var(--info); }

.media { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.media img {
  width: 96px; height: 96px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2);
}
.media .missing {
  width: 96px; height: 96px; display: grid; place-items: center; text-align: center;
  border-radius: 10px; border: 1px dashed var(--line);
  color: var(--ink-faint); font-size: 11px; padding: 6px;
}

/* ── the empty state, which is a first-class screen here ─────────────────────── */
/* 🔴 Measured before this was built: most days in this group carry no real subject at all.
   An empty answer is therefore the COMMON case, not an error, and it has to read like a
   calm sentence rather than a failure. */
.empty {
  text-align: center;
  padding: 34px 18px;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-dim);
}
.empty .big { font-size: 30px; display: block; margin-bottom: 8px; }
.empty small { display: block; color: var(--ink-faint); margin-top: 6px; }

.foot {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-faint);
}
.foot a { color: var(--ink-faint); }
.admin-slot { display: flex; align-items: center; gap: 8px; }

@media (min-width: 620px) {
  .card h2 { font-size: 17px; }
}
@media (prefers-reduced-motion: no-preference) {
  .card { transition: border-color .15s ease; }
  .card[open] { border-color: #3a4453; }
}
