:root {
  color-scheme: light;
  --paper: #f4ede1;
  --surface: #fbf7ee;
  --surface-strong: #fffaf2;
  --ink: #1a1a1a;
  --muted: #6b7a74;
  --quiet: #8b918d;
  --line: #ded4c5;
  --green: #1f3d34;
  --green-soft: #dce8e2;
  --blue: #6b7a74;
  --blue-soft: #e4ebe7;
  --mist: #bfd6cc;
  --mist-soft: #edf4f0;
  --terra: #c86f4d;
  --terra-soft: #f4dfd5;
  --stone: #6b7a74;
  --sand: #f4ede1;
  --shadow: 0 18px 50px rgba(31, 61, 52, 0.10);
  --radius: 8px;
  --bottom-nav: 74px;
  font-family: Satoshi, "IBM Plex Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(244, 237, 225, 0.96), rgba(244, 237, 225, 1)),
    radial-gradient(circle at top left, rgba(191, 214, 204, 0.38), transparent 34%);
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
}

.screen {
  min-height: 100vh;
  padding: 18px 16px calc(var(--bottom-nav) + 18px);
}

.screen.no-nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 24px;
}

.welcome-screen {
  justify-content: flex-start;
  gap: 22px;
  padding-top: max(24px, env(safe-area-inset-top));
}

.welcome-hero {
  padding-top: 14px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 34px;
  color: var(--green);
  font-weight: 900;
}

.brand-lockup .mark {
  width: 30px;
  height: 30px;
  font-size: 14px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--terra);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.welcome-hero h1,
.success-card h1 {
  max-width: 10ch;
  margin: 0;
  font-size: 48px;
  line-height: 0.98;
  letter-spacing: 0;
}

.invite-hero h1 {
  max-width: 12ch;
  font-size: 40px;
}

.lede,
.success-card > p:not(.eyebrow) {
  max-width: 33ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.travel-card {
  position: relative;
  display: grid;
  gap: 0;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid rgba(226, 221, 210, 0.92);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 22px 70px rgba(32, 33, 31, 0.10);
}

.travel-card::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 42px;
  bottom: 118px;
  width: 2px;
  background: linear-gradient(var(--green-soft), var(--terra-soft));
}

.travel-line {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 78px;
  padding: 8px 8px 8px 4px;
}

.travel-line + .travel-line {
  border-top: 1px solid rgba(226, 221, 210, 0.62);
}

.travel-dot {
  z-index: 1;
  width: 18px;
  height: 18px;
  display: grid;
  place-self: center;
  border: 4px solid var(--surface-strong);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1px var(--line);
}

.travel-dot.name {
  background: var(--blue);
}

.travel-dot.next {
  background: var(--terra);
}

.travel-line label {
  display: grid;
  gap: 3px;
}

.travel-line label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.travel-line input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
  font-size: 21px;
  font-weight: 850;
  letter-spacing: 0;
}

.travel-line input::placeholder {
  color: #b7b0a4;
  font-weight: 750;
}

.travel-card .btn {
  margin-top: 10px;
}

.privacy-note {
  margin: 12px 8px 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.success-card {
  display: grid;
  gap: 14px;
  padding-top: 20px;
}

.connect-card {
  display: grid;
  gap: 14px;
  padding-top: 20px;
}

.connect-card h1 {
  max-width: 12ch;
  margin: 0;
  font-size: 42px;
  line-height: 1;
}

.connect-card > p:not(.eyebrow) {
  max-width: 32ch;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.connect-summary {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.78);
}

.connect-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  border-bottom: 1px solid rgba(222, 212, 197, 0.68);
}

.connect-summary div:last-child {
  border-bottom: 0;
}

.connect-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.connect-summary strong {
  min-width: 0;
  text-align: right;
}

.checklist-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.78);
}

.checklist-card strong {
  margin-bottom: 2px;
}

.checklist-card span {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
}

.checklist-card span::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--terra);
}

.success-ring {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.success-ring .mark {
  width: 40px;
  height: 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -18px -16px 18px;
  padding: 14px 16px 12px;
  background: rgba(244, 237, 225, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(222, 212, 197, 0.62);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mark {
  width: 44px;
  height: 44px;
  display: block;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(31, 61, 52, 0.08);
}

.mark-path {
  fill: none;
  stroke-linecap: round;
  stroke-width: 5;
}

.mark-path.forest,
.mark-dot.forest {
  stroke: var(--green);
  fill: var(--green);
}

.mark-path.clay,
.mark-dot.clay {
  stroke: var(--terra);
  fill: var(--terra);
}

.brand h1,
.top-title h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.brand p,
.top-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.hero {
  padding-top: 28px;
}

.hero h1 {
  max-width: 9ch;
  margin: 0;
  font-size: 46px;
  line-height: 0.96;
  letter-spacing: 0;
}

.hero p {
  max-width: 31ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.path-card {
  margin: 34px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.path-row {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  align-items: start;
}

.path-row + .path-row {
  margin-top: 16px;
}

.pin {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border: 3px solid var(--green);
  border-radius: 50%;
}

.pin.next {
  border-color: var(--terra);
}

.path-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.path-row strong {
  display: block;
  margin-top: 2px;
}

.panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stack {
  display: grid;
  gap: 12px;
}

.section {
  margin: 22px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section h2,
.section-head h2 {
  margin: 0;
  font-size: 16px;
}

.section-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.journey-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 250, 242, 0.88), rgba(237, 244, 240, 0.54)),
    var(--surface-strong);
  box-shadow: 0 16px 34px rgba(31, 61, 52, 0.08);
}

.journey-step span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.journey-step strong {
  display: block;
  margin-top: 3px;
  font-size: 24px;
  line-height: 1.08;
}

.journey-line {
  display: grid;
  grid-template-columns: 10px 1fr 10px;
  align-items: center;
  gap: 8px;
  width: min(210px, 70%);
  color: var(--green);
}

.journey-line span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

.journey-line span:last-child {
  background: var(--terra);
}

.journey-line i {
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), var(--terra));
}

.journey-note {
  width: max-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--mist-soft);
  color: var(--stone);
  font-size: 12px;
  font-weight: 720;
}

.stat {
  min-height: 98px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.2;
}

.card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.82);
  box-shadow: 0 10px 24px rgba(31, 61, 52, 0.045);
}

.person-card,
.crossing-card,
.route-card,
.log-item {
  display: grid;
  gap: 10px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--mist-soft);
  color: var(--green);
  font-weight: 800;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity strong,
.route-card strong,
.crossing-card strong {
  display: block;
  line-height: 1.2;
}

.meta,
.small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 740;
  white-space: nowrap;
}

.chip.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.chip.terra {
  background: var(--terra-soft);
  color: var(--terra);
}

.chip.line {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.empty {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.72);
  color: var(--muted);
  text-align: left;
}

.empty strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 15px;
}

.empty span {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.empty.compact {
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  background: transparent;
}

.empty.compact::before {
  content: "";
  width: 28px;
  height: 28px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--green-soft), var(--terra-soft)) border-box;
}

.empty.compact strong,
.empty.compact span {
  grid-column: 2;
}

.empty.compact strong {
  margin-bottom: 0;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.08)),
    var(--green);
  color: var(--surface);
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(31, 61, 52, 0.18);
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  box-shadow: 0 12px 26px rgba(31, 61, 52, 0.22);
  transform: translateY(-1px);
}

.btn:active {
  box-shadow: 0 6px 14px rgba(31, 61, 52, 0.16);
  transform: translateY(1px);
}

.btn:focus-visible,
.fab:focus-visible,
.nav-button:focus-visible,
.segment:focus-visible {
  outline: 3px solid rgba(200, 111, 77, 0.30);
  outline-offset: 3px;
}

.btn.secondary {
  background: rgba(251, 247, 238, 0.72);
  color: var(--green);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn.secondary:hover {
  border-color: rgba(31, 61, 52, 0.42);
  background: var(--surface-strong);
  box-shadow: 0 8px 18px rgba(31, 61, 52, 0.08);
}

.btn.ghost {
  min-height: 34px;
  padding: 0 4px;
  background: transparent;
  color: var(--green);
  border-color: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 760;
}

.btn.ghost:hover {
  background: transparent;
  box-shadow: none;
  color: var(--terra);
  transform: none;
}

.btn.ghost:active {
  box-shadow: none;
  transform: none;
}

.btn.danger {
  background: #7b3a2e;
  box-shadow: 0 10px 22px rgba(123, 58, 46, 0.16);
}

.btn.row {
  width: 100%;
}

.button-row {
  display: flex;
  gap: 10px;
}

.button-row .btn {
  flex: 1;
}

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.field span {
  color: var(--muted);
  font-size: 12px;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

.textarea {
  min-height: 92px;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(55, 98, 87, 0.12);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.segment {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}

.segment.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 8;
  width: min(100%, 520px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 12px max(9px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(222, 212, 197, 0.82);
  background: rgba(251, 247, 238, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 -14px 34px rgba(31, 61, 52, 0.08);
}

.nav-button {
  min-height: 56px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.nav-button span {
  line-height: 1;
}

.nav-button:hover {
  color: var(--green);
  background: rgba(220, 232, 226, 0.38);
}

.nav-button.active {
  border-color: rgba(31, 61, 52, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)),
    var(--green-soft);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(31, 61, 52, 0.03);
}

.nav-button:active {
  transform: translateY(1px);
}

.fab {
  position: fixed;
  right: calc(50% - min(50vw, 260px) + 18px);
  bottom: calc(var(--bottom-nav) + 14px);
  z-index: 9;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(244, 237, 225, 0.52);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.18), transparent 34%),
    var(--green);
  color: var(--surface);
  box-shadow: 0 18px 34px rgba(31, 61, 52, 0.28);
  cursor: pointer;
  font-size: 0;
  line-height: 1;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.fab::before,
.fab::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 3px;
  border-radius: 99px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.fab::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.fab:hover {
  box-shadow: 0 20px 38px rgba(31, 61, 52, 0.32);
  transform: translateY(-1px);
}

.fab:active {
  box-shadow: 0 12px 24px rgba(31, 61, 52, 0.24);
  transform: translateY(1px);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: end;
  background: rgba(32, 33, 31, 0.28);
}

.sheet {
  width: min(100%, 520px);
  max-height: 86vh;
  margin: 0 auto;
  padding: 12px 14px max(16px, env(safe-area-inset-bottom));
  overflow: auto;
  border-radius: 14px 14px 0 0;
  background: var(--paper);
  box-shadow: 0 -20px 60px rgba(32, 33, 31, 0.18);
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 2px auto 14px;
  border-radius: 99px;
  background: #d3cbbd;
}

.qr-wrap {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.qr {
  width: min(62vw, 220px);
  height: min(62vw, 220px);
  image-rendering: pixelated;
}

.invite-link {
  width: 100%;
  padding: 10px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
}

.timeline {
  display: grid;
  gap: 8px;
}

.log-item {
  grid-template-columns: 14px 1fr;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.log-item:last-child {
  border-bottom: 0;
}

.dot {
  width: 10px;
  height: 10px;
  margin: 5px 0 0 2px;
  border-radius: 50%;
  background: var(--green);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav) + 22px);
  z-index: 30;
  max-width: min(92vw, 440px);
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hidden {
  display: none !important;
}

@media (min-width: 720px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    min-height: calc(100vh - 48px);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
  }

  .screen {
    min-height: calc(100vh - 48px);
  }

  .bottom-nav {
    bottom: 24px;
    border: 1px solid var(--line);
    border-radius: 0 0 18px 18px;
  }

  .fab {
    bottom: calc(var(--bottom-nav) + 38px);
  }
}
