:root {
  --ink: #12221c;
  --paper: #eef2ef;
  --moss: #1a4d3e;
  --moss-deep: #0c2f26;
  --leaf: #2f7a5c;
  --warn: #8a3b12;
  --line: #c5d0ca;
  --flash: #d7e8df;
  --danger: #8b1e1e;
  --font: "Space Grotesk", sans-serif;
  --sans: "Figtree", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 55% at 0% 0%, #d5e6de 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 10%, #cfe0d8 0%, transparent 45%),
    linear-gradient(165deg, #eef2ef 0%, #dce6e1 100%);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--moss); }
h1, h2, .brand, .wordmark {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.62);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.45rem;
  text-decoration: none;
  color: var(--moss-deep);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.brand-mark {
  height: 1.85rem;
  width: 1.85rem;
  flex: 0 0 auto;
  aspect-ratio: 1 / 1;
  align-self: center;
  color: var(--moss-deep);
  display: block;
  overflow: visible;
}
.brand-mark--hero {
  height: clamp(2.85rem, 8vw, 3.5rem);
  width: clamp(2.85rem, 8vw, 3.5rem);
}
.brand-text {
  display: inline-block;
  line-height: 1.1;
}
.brand-beat {
  color: var(--leaf);
  letter-spacing: -0.02em;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 0.65rem;
  color: var(--moss-deep);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.top nav { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.top nav a { text-decoration: none; }
.inline { display: inline; margin: 0; }
.inline button, button, .btn {
  font: inherit;
  font-weight: 600;
  border: 0;
  background: var(--moss);
  color: #fff;
  padding: 0.55rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.inline button { background: transparent; color: var(--moss); padding: 0.25rem; font-weight: 500; }
button:disabled, .btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.danger { background: var(--danger); }
main { padding: 1rem; max-width: 960px; margin: 0 auto; }
.narrow { max-width: 28rem; }
/* Full-bleed hero: atmosphere continues from body — no boxed panel edge */
.hero {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 2.75rem max(1rem, calc(50vw - 30rem)) 3.25rem;
  background: transparent;
}
.hero .wordmark { font-size: clamp(2.75rem, 8vw, 3.75rem); }
.hero .brand-beat { color: var(--leaf); }
.lede { font-size: 1.12rem; max-width: 32rem; font-weight: 500; color: #3a4a43; }
.cta { display: flex; gap: 1rem; align-items: center; }
.stack { display: grid; gap: 0.75rem; }
label { display: grid; gap: 0.35rem; font-size: 0.92rem; }
textarea {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  resize: vertical;
  min-height: 4.5rem;
}
input[type=text], input[type=email], input[type=password], input:not([type]) {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.hint { color: #5c635e; font-size: 0.85rem; }
.error { color: var(--warn); }
.flash { background: var(--flash); padding: 0.6rem 0.8rem; border-radius: 4px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.round-list { list-style: none; padding: 0; margin: 1rem 0; }
.round-list li a {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.85rem 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.round-list span { color: #5c635e; font-size: 0.9rem; }
.map-page { max-width: none; padding: 0; }
.map-toolbar {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.75rem 1rem; max-width: 1100px; margin: 0 auto;
}
.map-toolbar h1 { margin: 0; font-size: 1.4rem; }
.meta { margin: 0.2rem 0 0; color: #5c635e; font-size: 0.9rem; }
.map-stage { position: relative; }
#map {
  height: min(62vh, 520px);
  width: 100%;
  border-block: 1px solid var(--line);
  background: #e8eeea;
}
#map.map-overview .rounds-tiles {
  filter: grayscale(0.25) contrast(0.92) brightness(1.08);
}
.map-legend {
  position: absolute;
  right: 0.75rem;
  bottom: 2.4rem;
  z-index: 500;
  max-width: 12.5rem;
  max-height: 40%;
  overflow: auto;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(20, 32, 27, 0.12);
  box-shadow: 0 8px 24px rgba(20, 32, 27, 0.12);
  font-size: 0.78rem;
  line-height: 1.3;
}
.legend-title {
  margin: 0 0 0.35rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: #5c635e;
}
.legend-note { margin: 0; color: #5c635e; }
.legend-side-note {
  margin: 0.45rem 0 0;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(20, 32, 27, 0.1);
  color: #5c635e;
  font-size: 0.72rem;
  line-height: 1.35;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.18rem 0;
}
.swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
}
.map-hint {
  margin: 0;
  padding: 0.4rem 1rem 0.55rem;
  font-size: 0.8rem;
  color: #5c635e;
  background: rgba(255,255,255,0.7);
}
.focus-badge {
  background: transparent !important;
  border: 0 !important;
}
.focus-badge span {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #0b3d2e;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 14px rgba(11, 61, 46, 0.35);
}
.mark-panel { max-width: 640px; margin: 0 auto; padding: 1rem; }
.stretch-list { list-style: none; padding: 0; }
.stretch-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}
.stretch-list li > div { display: flex; flex-direction: column; gap: 0.1rem; }
.stretch-list span { font-size: 0.85rem; color: #5c635e; }
.member {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.85rem;
  margin: 0.75rem 0;
  background: rgba(255,255,255,0.5);
}
.member header { display: flex; flex-direction: column; margin-bottom: 0.5rem; }
.role-actions { margin: 0.35rem 0 0.75rem; }
.hidden { display: none; }
.invite summary { cursor: pointer; color: var(--moss); }
.stats { list-style: none; padding: 0; font-size: 1.2rem; }
.stats li { padding: 0.4rem 0; }

.dash { max-width: 1100px; }
.dash-head { margin-bottom: 1.25rem; }
.dash-head h1 { margin: 0 0 0.25rem; color: var(--moss-deep); }
.dash-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  margin-bottom: 1.25rem;
}
.dash-grid-2 { grid-template-columns: 1fr; }
.dash-grid-3 { grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .dash-grid-2 { grid-template-columns: 1fr 1fr; }
  .dash-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.metric, .panel {
  background: rgba(255,255,255,0.62);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.85rem 1rem;
}
.metric {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.metric-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: #5c635e; }
.metric strong { font-size: 1.7rem; font-family: var(--font); color: var(--moss-deep); line-height: 1.1; }
.metric-sub { font-size: 0.8rem; color: #5c635e; }
.panel h2 { margin: 0 0 0.65rem; font-size: 1.05rem; color: var(--moss-deep); }
.kv { list-style: none; padding: 0; margin: 0; }
.kv li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.kv li:last-child { border-bottom: 0; }
.kv em { font-style: normal; color: #5c635e; font-size: 0.8rem; margin-left: 0.35rem; }
.kv .empty, .bars .empty, .audit .empty { color: #5c635e; font-style: italic; }
.bars { display: grid; gap: 0.35rem; }
.bar-row { display: grid; grid-template-columns: 5.5rem 1fr 2rem; gap: 0.5rem; align-items: center; font-size: 0.8rem; }
.bar-day { color: #5c635e; font-variant-numeric: tabular-nums; }
.bar-track {
  height: 0.55rem;
  background: #efe9dc;
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--leaf);
  border-radius: 3px;
  transition: width 0.35s ease;
}
.bar-n { text-align: right; font-variant-numeric: tabular-nums; }
.audit { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.audit th, .audit td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.audit th { color: #5c635e; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }
.select-stretches { display: grid; gap: 0.35rem; max-height: 10rem; overflow: auto; }
fieldset { border: 1px solid var(--line); border-radius: 4px; }
code { background: #efe9dc; padding: 0.1rem 0.3rem; border-radius: 3px; }
@media (min-width: 800px) {
  #map { height: 68vh; }
}
