:root {
  --shell-max: 430px;
  --ink: #101010;
  --muted: #463d37;
  --paper: #dfcec0;
  --card: #e8d8ca;
  --line: #b89175;
  --brand-strong: #54150a;
  --brand-mid: #7c2212;
  --bg: #8f7e70;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 10% -20%, #d88a59 0%, transparent 55%),
    radial-gradient(900px 620px at 100% 0%, #9f4a33 0%, transparent 50%),
    var(--bg);
  padding: 14px;
}

.site-wrap {
  max-width: var(--shell-max);
  margin: 0 auto;
}

.phone-shell {
  min-height: calc(100vh - 28px);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 24px 60px rgba(21, 13, 10, 0.34);
  display: flex;
  flex-direction: column;
  position: relative;
}

.auth-gate {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(17, 10, 7, 0.88);
}

.auth-gate.hidden {
  display: none;
}

.auth-gate-card {
  width: 100%;
  max-width: 360px;
  border: 1px solid #905c46;
  border-radius: 16px;
  background: linear-gradient(135deg, #3d0f08, #6f1e10 60%, #a93a1f);
  color: #fff;
  padding: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.auth-gate-card h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.auth-gate-card p {
  margin: 0;
  color: #f4e9dc;
  font-size: 0.86rem;
}

.content {
  padding: 14px;
  padding-bottom: 84px;
  display: grid;
  gap: 10px;
}

.hero {
  background: linear-gradient(135deg, #3d0f08, #6f1e10 60%, #a93a1f);
  border-radius: 18px;
  padding: 14px;
  color: #fff;
}

.hero-pill {
  display: inline-block;
  background: #9d4028;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  margin-bottom: 8px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 1.3rem;
}

.hero p {
  margin: 0;
  font-size: 0.86rem;
  color: #f4e9dc;
}

.home-location-btn {
  margin-top: 10px;
  width: auto;
  max-width: 100%;
  padding: 0 12px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.78rem;
  text-align: left;
}

.home-location-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.search-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.search-row > * {
  min-width: 0;
}

input[type="text"] {
  flex: 1 1 0%;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e4d6c9;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}

.phone-shell button {
  border: 0;
  border-radius: 12px;
  background: var(--brand-strong);
  color: #fff;
  font-weight: 700;
  padding: 0 12px;
  height: 44px;
  cursor: pointer;
}

.phone-shell button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.phone-shell .search-row button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 2px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #dfcfc1;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
}

.section-title {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.feed {
  display: grid;
  gap: 10px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 12px;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.hidden {
  display: none;
}

.bottom-nav {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: #dbcabd;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.nav-btn {
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  height: 40px;
  font-size: 13px;
  font-weight: 700;
}

.nav-btn.active {
  background: var(--brand-strong);
  color: #fff;
}

.status {
  margin: 0;
  color: #6d1409;
  font-size: 0.82rem;
  font-weight: 700;
}

.modal-status {
  margin: 0;
  font-size: 0.84rem;
  color: #6d1409;
  font-weight: 700;
  min-height: 20px;
}

.form-note {
  font-size: 0.8rem;
  color: #463d37;
  background: #f1e8df;
  border: 1px solid #d0b8a4;
  border-radius: 10px;
  padding: 8px 10px;
}

.location-focus {
  border-width: 2px;
  border-color: #b85b32;
}

.location-focus.pulse {
  animation: locationPulse 1.6s ease-in-out infinite;
}

.place-summary {
  display: grid;
  gap: 2px;
}

.place-restaurant {
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: 0.5px;
  font-variant-caps: small-caps;
}

.place-locality {
  font-style: italic;
  font-size: 0.78rem;
  color: #5a4f46;
}

@keyframes locationPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(184, 91, 50, 0.35);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(184, 91, 50, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(184, 91, 50, 0);
  }
}

.autocomplete-wrap {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #b89175;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(17, 10, 7, 0.18);
  max-height: 180px;
  overflow-y: auto;
  z-index: 40;
  display: none;
}

.autocomplete-list.has-items {
  display: block;
}

.autocomplete-item {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #101010;
  text-align: left;
  font-size: 0.85rem;
  line-height: 1.2;
  padding: 9px 10px;
  height: auto;
}

.autocomplete-item + .autocomplete-item {
  border-top: 1px solid #eee2d8;
}

.autocomplete-item:hover {
  background: #f6ece3;
}

.autocomplete-meta {
  display: block;
  color: #6f6157;
  font-size: 0.75rem;
  margin-top: 2px;
}

.submission-btn {
  width: 100%;
  height: auto;
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 14px;
  font-size: 3.2rem;
  line-height: 1.1;
  white-space: normal;
  padding: 18px 14px;
  letter-spacing: 0.2px;
}

.auth-form {
  display: grid;
  gap: 8px;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.auth-actions button {
  width: 100%;
}

#view-submission:not(.hidden) {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
  min-height: 560px;
}

#view-submission:not(.hidden) .submission-actions {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
}

@media (max-width: 390px) {
  #view-submission .search-row {
    flex-direction: column;
  }

  #view-submission .search-row button {
    width: 100%;
  }
}
