:root {
  --bg: #eef2f1;
  --surface: #ffffff;
  --surface-soft: #f6f8f6;
  --ink: #16201c;
  --muted: #61706a;
  --line: #dce4df;
  --primary: #087f5b;
  --primary-dark: #056346;
  --primary-soft: #def4eb;
  --food: #f0a202;
  --food-soft: #fff2cc;
  --quest: #6d5dfc;
  --quest-soft: #eceaff;
  --info: #dfeaf7;
  --danger: #b64242;
  --shadow: 0 16px 40px rgba(18, 31, 27, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(240, 162, 2, 0.14), transparent 26%),
    linear-gradient(135deg, #f5f7f4 0%, #e5ece8 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.prototype-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.phone-shell {
  width: min(100%, 420px);
  height: min(860px, calc(100vh - 48px));
  min-height: 680px;
  background: var(--surface);
  border: 1px solid rgba(22, 32, 28, 0.1);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.app {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--bg);
}

.screen {
  overflow-y: auto;
  padding: 22px 18px 18px;
}

.screen.with-nav {
  padding-bottom: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.topbar h1,
.hero h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.12;
}

.hero p,
.subtle {
  color: var(--muted);
}

.hero p {
  margin: 8px 0 0;
  font-size: 16px;
}

.back-btn,
.icon-btn {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

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

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(27, 38, 34, 0.06);
}

.action-card {
  display: grid;
  gap: 8px;
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  color: var(--ink);
  min-height: 98px;
}

.action-card strong,
.card-title {
  font-size: 16px;
}

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

.budget-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--primary-soft);
  border-color: #b9e5d3;
}

.stat {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-dark);
}

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

.btn {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  background: var(--surface);
  color: var(--ink);
}

.btn.primary {
  background: var(--primary);
  color: white;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.secondary {
  border-color: var(--line);
}

.btn.warning {
  background: var(--food);
  color: #211800;
}

.btn.full {
  width: 100%;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chip {
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.search {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
}

.map {
  position: relative;
  min-height: 360px;
  border: 1px solid #cbd8d1;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(8, 127, 91, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(8, 127, 91, 0.1) 1px, transparent 1px),
    linear-gradient(135deg, #edf6ef, #f9f3df);
  background-size: 42px 42px, 42px 42px, auto;
}

.map::before,
.map::after {
  content: "";
  position: absolute;
  background: rgba(97, 112, 106, 0.18);
  border-radius: 999px;
}

.map::before {
  width: 140%;
  height: 28px;
  left: -20%;
  top: 42%;
  transform: rotate(-14deg);
}

.map::after {
  width: 28px;
  height: 130%;
  left: 48%;
  top: -15%;
  transform: rotate(18deg);
}

.marker {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  padding: 0;
}

.marker-inner {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.pin {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 8px;
  transform: rotate(-45deg);
  color: white;
  font-weight: 900;
  border: 2px solid white;
  box-shadow: 0 5px 14px rgba(22, 32, 28, 0.22);
}

.pin span {
  transform: rotate(45deg);
  font-size: 13px;
}

.marker-label {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.marker.user .pin {
  background: #1b7ced;
}

.marker.friend .pin {
  background: var(--primary);
}

.marker.food .pin {
  background: var(--food);
}

.marker.quest .pin {
  background: var(--quest);
}

.marker.current .pin {
  background: #202b27;
}

.marker.highlight .pin {
  outline: 4px solid rgba(8, 127, 91, 0.22);
}

.floating-card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
}

.sheet {
  margin-top: -82px;
  position: relative;
  z-index: 4;
}

.avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 900;
  border: 2px solid white;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.pill.food {
  background: var(--food-soft);
  color: #6b4600;
}

.pill.quest {
  background: var(--quest-soft);
  color: #41359c;
}

.status-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--primary-soft);
  border: 1px solid #aee0cc;
  border-radius: 8px;
  padding: 13px;
  color: var(--primary-dark);
  font-weight: 800;
}

.info-note {
  background: var(--info);
  border-color: #c2d7ed;
}

.venue-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.venue-card h3,
.card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.venue-hero,
.photo-placeholder {
  min-height: 150px;
  border: 1px dashed #aebbb5;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--food-soft), #f7faf8);
  color: #6b4600;
  font-weight: 900;
  text-align: center;
  padding: 14px;
}

.mini-map {
  min-height: 160px;
}

.chat-list {
  display: grid;
  gap: 10px;
}

.bubble {
  max-width: 86%;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  line-height: 1.35;
}

.bubble.me {
  justify-self: end;
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.bubble.system {
  max-width: 100%;
  background: var(--info);
  color: #27425c;
}

.checklist {
  list-style: none;
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 0;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 900;
}

.check.done {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px 8px 10px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.nav-btn {
  min-height: 52px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.nav-btn .nav-icon {
  font-size: 18px;
  line-height: 1;
}

.nav-btn.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.link-row {
  display: flex;
  gap: 14px;
}

.text-link {
  color: var(--danger);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 520px) {
  .prototype-wrap {
    padding: 0;
    display: block;
  }

  .phone-shell {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .screen {
    padding: 18px 14px 16px;
  }
}
