:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #1c2230;
  --muted: #6b7280;
  --brand: #2f6fed;
  --brand-dark: #1f4fc2;
  --border: #e5e7eb;
  --green: #1a9e5c;
  --red: #d64545;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 700; text-decoration: none; color: var(--ink); font-size: 18px; }

.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar nav a { color: var(--brand); text-decoration: none; font-weight: 500; }
.topbar nav a:hover { text-decoration: underline; }
.who { color: var(--muted); font-size: 14px; }

.inline-form { display: inline; }
.linklike {
  background: none; border: none; padding: 0; color: var(--brand);
  font: inherit; font-weight: 500; cursor: pointer;
}
.linklike:hover { text-decoration: underline; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px;
}

.hero { text-align: center; padding: 60px 10px; }
.hero h1 { font-size: 32px; margin-bottom: 12px; }
.hero p { color: var(--muted); font-size: 17px; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; }

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.secondary:hover { background: #eef3ff; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.page-head h1 { margin: 0 0 4px; }

.meta { color: var(--muted); font-size: 14px; margin: 2px 0; }

.flash {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 14px;
}
.flash.info { background: #eaf3ff; color: var(--brand-dark); }
.flash.error { background: #fdeceb; color: var(--red); }

.contest-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.contest-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.contest-card a { color: var(--ink); text-decoration: none; font-size: 17px; }
.contest-card a:hover { color: var(--brand); }

.empty { color: var(--muted); }

.form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  display: grid;
  gap: 14px;
  max-width: 480px;
}
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 500; }
.form input, .form select {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  color: var(--ink);
  font-family: inherit;
}
.form.form-inline { max-width: none; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.form .checkbox { flex-direction: row; align-items: center; gap: 8px; }
.form .checkbox input { width: auto; }
.hint { color: var(--muted); font-size: 13px; }

.btn.small { padding: 6px 12px; font-size: 13px; }

.activities-field { display: flex; flex-direction: column; gap: 10px; }
.field-label { font-size: 14px; color: var(--muted); font-weight: 500; }
.activity-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.activity-row input { padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.activity-row input[name="activity_name"] { flex: 2; min-width: 140px; }
.activity-row input[name="activity_unit"] { flex: 1; min-width: 100px; }
.activity-row input[name="activity_target"] { flex: 1; min-width: 100px; }

.activity-entry-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.activity-entry-row:last-of-type { border-bottom: none; }
.activity-label { min-width: 220px; font-weight: 500; }
.activity-entry-row input[type="number"] { width: 120px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 22px;
}
.card h2 { margin-top: 0; font-size: 18px; }

table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td.me, th.me { background: #f0f5ff; }

.table-scroll { overflow-x: auto; }
.daily-table td, .daily-table th { text-align: center; }
.daily-table td.date-cell, .daily-table th:first-child { text-align: left; white-space: nowrap; }
.empty-cell { color: #c7cbd4; }
.fd { color: #b8860b; font-weight: 600; }

tr.me { background: #f0f5ff; }
code { background: #f1f3f8; padding: 2px 6px; border-radius: 4px; font-size: 13px; }

/* ---- icons & illustrations ----
   Icons are now real <img> clip-art (public domain, via Wikimedia Commons)
   rather than inline SVG, so `color`/`currentColor` no longer tint them —
   sizing and layout rules still apply the same way. */
.icon { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; vertical-align: -3px; }
.brand .icon { width: 20px; height: 20px; vertical-align: -4px; margin-right: 2px; }
.btn .icon { margin-right: 4px; vertical-align: -3px; }
h1 .icon, h2 .icon { width: 22px; height: 22px; margin-right: 8px; vertical-align: -4px; }

.hero-illustration {
  display: flex; align-items: flex-end; justify-content: center; gap: 28px;
  margin: 0 auto 8px;
}
.hero-illustration .hero-runner { width: 110px; height: auto; }
.hero-illustration .hero-trophy { width: 90px; height: auto; }

.form-head { display: flex; align-items: center; gap: 10px; }
.form-head .icon-circle {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: #eef3ff; flex-shrink: 0;
}
.form-head .icon-circle .icon { width: 20px; height: 20px; margin: 0; }

.empty-state { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty-state .icon { width: 40px; height: 40px; margin-bottom: 10px; }
.icon.muted-icon { opacity: 0.35; filter: grayscale(1); }
