:root {
  --bg: #102418;
  --bg2: #163322;
  --card: #1c3d2a;
  --ink: #f3f7f2;
  --muted: #9bb59f;
  --accent: #d4b56a;
  --mint: #7dbe8a;
  --leaf: #3f7d4a;
  --danger: #e07a6a;
  --pending: #e0a84a;
  --ok: #7dbe8a;
  --blue: #7eb0d4;
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 480px at 8% -8%, #2a5a38 0%, transparent 50%),
    radial-gradient(800px 400px at 110% 10%, #1a4030 0%, var(--bg) 55%);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: .12;
  background-image: url("../img/leaf.svg");
  background-size: 72px 54px;
  background-repeat: repeat;
  mix-blend-mode: screen;
}
.hidden { display: none !important; }
#app {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(12px + var(--safe-top)) 14px calc(28px + var(--safe-bottom));
}
.top { display: grid; gap: 10px; margin-bottom: 14px; }
.brand {
  display: flex; gap: 12px; align-items: center;
  text-decoration: none; color: var(--ink);
}
.brand-mark {
  width: 56px; height: 42px;
  flex-shrink: 0;
}
.brand h1 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.who-line { color: var(--muted); font-size: .85rem; margin: 0; }
.score-hero {
  width: 100%;
  border-radius: 20px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: linear-gradient(160deg, #244f35, #163224);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 30px rgba(0,0,0,.25);
}
.score-pill {
  border: 0; border-radius: 14px; background: rgba(0,0,0,.22);
  padding: 10px 12px; color: inherit; cursor: pointer; text-align: left;
}
.score-pill .label { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.score-pill .value { font-size: 1.55rem; font-weight: 700; color: var(--accent); }
.score-pill .max { color: var(--muted); font-size: .9rem; }
.hint { color: var(--muted); font-size: .88rem; margin: 0 0 12px; line-height: 1.35; }
.exhibit {
  --cat: var(--mint);
  background: rgba(0,0,0,.18);
  border: 1px solid color-mix(in srgb, var(--cat) 45%, transparent);
  border-left: 5px solid var(--cat);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 10px;
}
.exhibit.cat-leaf { --cat: #5dbe6a; }
.exhibit.cat-root { --cat: #9aa3ad; }
.exhibit.cat-stem { --cat: #b8875a; }
.exhibit.cat-flower { --cat: #5aa8e0; }
.exhibit.cat-fruit { --cat: #d84a4a; }
.exhibit.cat-seed { --cat: #e0c04a; }
.exhibit.cat-seed-dispersal { --cat: #e07aa8; }
.exhibit > summary {
  background: color-mix(in srgb, var(--cat) 18%, transparent);
}
.exhibit .exhibit-title { color: var(--cat); }
.exhibit .chevron {
  border-right-color: var(--cat);
  border-bottom-color: var(--cat);
}
.exhibit > summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 8px; align-items: center;
  padding: 12px 14px; min-height: 48px;
}
.exhibit > summary::-webkit-details-marker { display: none; }
.exhibit-title { font-weight: 700; font-size: .92rem; }
.exhibit-meta { font-size: .78rem; color: var(--muted); }
.chevron {
  width: 10px; height: 10px;
  border-right: 2px solid var(--mint);
  border-bottom: 2px solid var(--mint);
  transform: rotate(45deg);
}
.exhibit[open] > summary .chevron { transform: rotate(-135deg); }
.exhibit .mission-grid {
  padding: 0 10px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 10px;
}
.mission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mission-card {
  appearance: none; border: 1px solid rgba(255,255,255,.08);
  background: var(--card); color: inherit;
  border-radius: 12px; padding: 8px 10px; text-align: left;
  cursor: pointer; min-height: 72px;
}
.mission-card h3 { margin: 4px 0 0; font-size: .82rem; line-height: 1.2; }
.idrow { display: flex; justify-content: space-between; align-items: center; font-size: .68rem; color: var(--muted); }
.checks { display: flex; gap: 4px; }
.check { font-size: .95rem; line-height: 1; opacity: .25; }
.check.on.blue { opacity: 1; color: var(--blue); }
.check.on.green { opacity: 1; color: var(--ok); }
.optional-strip .exhibit { opacity: .92; border-style: dashed; }
.back { border: 0; background: none; color: var(--mint); font-size: 1rem; padding: 4px 0 8px; cursor: pointer; }
.mission-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
}
.mission-nav button {
  appearance: none;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.22);
  color: inherit;
  border-radius: 12px;
  padding: 8px 10px;
  min-height: 48px;
  cursor: pointer;
}
.mission-nav button.prev { text-align: left; }
.mission-nav button.next { text-align: right; }
.mission-nav button:disabled { opacity: .35; cursor: default; }
.mission-nav .dir {
  display: block;
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.mission-nav .name {
  display: block;
  font-weight: 700;
  font-size: .82rem;
  line-height: 1.25;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mission-detail {
  background: var(--card);
  border-radius: 20px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.06);
}
.mission-detail h2 { margin: 0 0 12px; font-size: 1.25rem; }
.plate { width: 100%; border-radius: 12px; background: #0c1a12; margin-bottom: 12px; }
.block > strong {
  display: block; font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 4px;
}
.mission-detail p { margin: 0 0 10px; line-height: 1.45; }
label.field { display: block; margin: 10px 0; font-size: .85rem; color: var(--muted); }
label.field input, label.field select, label.field textarea {
  width: 100%; margin-top: 4px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12);
  background: #0f2418; color: var(--ink); padding: 10px; font-size: 1rem;
}
.upload-bar {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 14px;
  position: sticky; bottom: calc(10px + var(--safe-bottom));
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px; border: 0; min-height: 48px; padding: 12px 14px;
  font-weight: 700; font-size: 1rem; cursor: pointer;
}
.btn.primary { background: var(--mint); color: #06240f; }
.btn.secondary { background: #2a4f38; color: var(--ink); }
.btn.block { width: 100%; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 32px; }
.upload-status { min-height: 1.2em; color: var(--muted); font-size: .9rem; }
.submission-panel {
  margin-top: 8px; display: grid; grid-template-columns: 96px 1fr; gap: 12px;
  padding: 12px; border-radius: 16px; background: rgba(0,0,0,.22);
}
.submission-panel.pending { border: 1px solid rgba(224,168,74,.45); }
.submission-panel.approved { border: 1px solid rgba(125,190,138,.5); }
.submission-panel.rejected {
  border: 1px solid var(--danger);
  background: rgba(224, 122, 106, .16);
}
.status-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.2;
}
.status-label.dismiss { color: #ffb0a4; }
.status-icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }
.status-next { margin: 6px 0 0; color: var(--ink); }
.reject-reason { margin: 8px 0 0; color: var(--ink); }
.plant-name { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.submission-thumb { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; }
.submission-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: 100px; object-fit: cover; border-radius: 10px; }
.gallery figcaption { font-size: .72rem; color: var(--muted); }
.gate { padding: 48px 16px; text-align: center; }
.bar { height: 10px; border-radius: 999px; background: rgba(0,0,0,.3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, #2f7a48, var(--mint)); }
.linkish { color: var(--mint); background: none; border: 0; text-decoration: underline; cursor: pointer; font-size: .9rem; }
.linkish.danger { color: var(--danger); }
.path-overall { font-size: 1.05rem; margin: 0 0 16px; }
.year-path {
  list-style: none;
  margin: 0;
  padding: 0 0 8px 18px;
  border-left: 3px solid rgba(125,190,138,.35);
}
.path-step {
  position: relative;
  margin: 0 0 14px;
  padding-left: 18px;
}
.path-dot {
  position: absolute;
  left: -28px;
  top: 18px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--muted);
}
.path-card {
  background: var(--card);
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.06);
}
.path-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.path-card h3 { margin: 0; font-size: 1.02rem; }
.path-badge {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.25);
  color: var(--muted);
  white-space: nowrap;
}
.path-here {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.path-meta { font-size: .82rem; color: var(--muted); margin: 8px 0 0; }
.path-step.is-current .path-card { box-shadow: 0 0 0 2px rgba(212,181,106,.45); }
.path-step.pace-met .path-dot, .path-step.pace-ahead .path-dot {
  background: var(--ok);
  box-shadow: 0 0 0 2px var(--ok);
}
.path-step.pace-on_time .path-dot {
  background: var(--blue);
  box-shadow: 0 0 0 2px var(--blue);
}
.path-step.pace-behind .path-dot {
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--danger);
}
.path-step.pace-met .path-badge { color: var(--ok); }
.path-step.pace-ahead .path-badge { color: var(--accent); }
.path-step.pace-on_time .path-badge { color: var(--blue); }
.path-step.pace-behind .path-badge { color: var(--danger); }
.path-step.pace-met .bar > span { background: var(--ok); }
.path-step.pace-ahead .bar > span { background: var(--accent); }
.path-step.pace-behind .bar > span { background: var(--danger); }
.path-step.pace-on_time .bar > span { background: var(--blue); }
.path-card .bar { margin-top: 8px; }
@media (min-width: 520px) {
  .mission-grid { grid-template-columns: 1fr 1fr 1fr; }
}
