@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #f2f6f4;
  --surface: #ffffff;
  --surface-alt: #f7fbf9;
  --surface-strong: #edf6f8;
  --text: #10212b;
  --text-soft: #496272;
  --primary: #0f8b8d;
  --primary-strong: #0b6f71;
  --accent: #f97316;
  --success: #197943;
  --warning: #b45309;
  --danger: #b42318;
  --border: #d5e4e7;
  --ring: rgba(15, 139, 141, 0.24);
  --shadow-sm: 0 8px 22px rgba(11, 35, 45, 0.08);
  --shadow: 0 18px 42px rgba(11, 35, 45, 0.12);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", Segoe UI, Tahoma, sans-serif;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 12%, rgba(15, 139, 141, 0.14), transparent 32%),
    radial-gradient(circle at 92% 8%, rgba(249, 115, 22, 0.1), transparent 28%),
    linear-gradient(130deg, rgba(15, 139, 141, 0.03), rgba(249, 115, 22, 0.03)),
    repeating-linear-gradient(45deg, rgba(16, 33, 43, 0.015), rgba(16, 33, 43, 0.015) 1px, transparent 1px, transparent 10px),
    var(--bg);
  min-height: 100vh;
}

.app-shell {
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
h3,
h4 {
  font-family: Outfit, "IBM Plex Sans", sans-serif;
  letter-spacing: -0.01em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.page {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: var(--space-4) var(--space-3) calc(var(--space-5) + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(242, 246, 244, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(11, 35, 45, 0.06);
}

.topbar-inner {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--space-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), #13b38d 64%, var(--accent));
  box-shadow: var(--shadow);
}

.brand-subtitle {
  font-size: 12px;
}

.inline-nav {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  overflow-x: auto;
  gap: var(--space-1);
  padding: 2px 2px 4px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.inline-nav::-webkit-scrollbar {
  display: none;
}

.nav-chip {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, var(--surface-strong));
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  scroll-snap-align: start;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.nav-chip:hover {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--border));
  transform: translateY(-1px);
}

.nav-chip.active {
  background: linear-gradient(135deg, var(--primary), #119ba0);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 10px 22px rgba(15, 139, 141, 0.26);
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfefe 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  animation: card-in 260ms ease both;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(15, 139, 141, 0.05), transparent 42%);
}

.card-pad {
  padding: var(--space-3);
}

.section-title {
  margin: 0 0 10px;
  font-size: clamp(1.2rem, 4.8vw, 1.56rem);
  line-height: 1.2;
}

.muted {
  color: var(--text-soft);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.btn {
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: var(--radius-md);
  padding: 11px 14px;
  min-height: 44px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, box-shadow 120ms ease, background 180ms ease, border-color 180ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #109aa0 65%);
  border-color: rgba(9, 77, 79, 0.2);
  color: #fff;
  box-shadow: 0 10px 20px rgba(15, 139, 141, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-strong), #0f8b8d 64%);
}

.btn-secondary {
  background: linear-gradient(180deg, #ffffff, var(--surface-alt));
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
}

.btn-danger {
  background: #fff5f5;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.btn[disabled] {
  opacity: 0.58;
  cursor: not-allowed;
  box-shadow: none;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  font-family: inherit;
  font-size: 16px;
  background: color-mix(in srgb, #ffffff 92%, var(--surface-strong));
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: color-mix(in srgb, var(--primary) 56%, white);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}

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

.password-field {
  position: relative;
}

.password-field .input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.password-toggle:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}

.password-toggle.is-animating {
  animation: eye-pop 180ms ease;
}

.eye-icon {
  position: relative;
  width: 18px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.eye-shape {
  position: absolute;
  inset: 0;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.eye-pupil {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  transition: transform 140ms ease;
}

.eye-slash {
  position: absolute;
  width: 2px;
  height: 16px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-40deg) scaleY(0);
  opacity: 0;
  transition: transform 140ms ease, opacity 140ms ease;
}

.password-toggle.is-visible .eye-pupil {
  transform: scale(0);
}

.password-toggle.is-visible .eye-slash {
  transform: rotate(-40deg) scaleY(1);
  opacity: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.mini-map {
  min-height: 260px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: linear-gradient(180deg, #ecf8fb, #f8fcfd);
}

.zone-detected {
  min-height: 34px;
  display: flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(15, 139, 141, 0.26);
  background: color-mix(in srgb, var(--surface) 78%, rgba(15, 139, 141, 0.15));
  padding: 6px 12px;
}

.map-provider-note {
  font-size: 12px;
}

.range-input {
  padding: 0;
}

@keyframes eye-pop {
  0% {
    transform: translateY(-50%) scale(1);
  }

  50% {
    transform: translateY(-50%) scale(1.08);
  }

  100% {
    transform: translateY(-50%) scale(1);
  }
}

.search-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.chip {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, var(--surface-alt));
  border-radius: var(--radius-pill);
  padding: 7px 12px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 120ms ease, border-color 120ms ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 36%, var(--border));
}

.chip.active {
  background: color-mix(in srgb, var(--surface) 72%, rgba(15, 139, 141, 0.18));
  border-color: rgba(15, 139, 141, 0.36);
  color: var(--primary-strong);
}

.listing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.listing-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.listing-media {
  height: 190px;
  position: relative;
  background-size: cover;
  background-position: center;
}

.listing-media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 48%;
  background: linear-gradient(180deg, transparent, rgba(5, 18, 26, 0.44));
  pointer-events: none;
}

.badge {
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
}

.badge.primary {
  background: #dff8f7;
  color: var(--primary-strong);
}

.badge.success {
  background: #e9f8ef;
  color: var(--success);
}

.badge.warning {
  background: #fff7ed;
  color: var(--warning);
}

.badge.danger {
  background: #fef2f2;
  color: var(--danger);
}

.price {
  font-size: clamp(1.15rem, 5vw, 1.4rem);
  font-weight: 800;
}

.price small {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 600;
}

.map-shell {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, #ddf5f3, #ecf8fb 35%, #f6fcfc),
    repeating-linear-gradient(90deg, rgba(15, 23, 32, 0.05), rgba(15, 23, 32, 0.05) 1px, transparent 1px, transparent 28px),
    repeating-linear-gradient(0deg, rgba(15, 23, 32, 0.04), rgba(15, 23, 32, 0.04) 1px, transparent 1px, transparent 28px);
  min-height: 320px;
  position: relative;
  overflow: hidden;
}

.map-split {
  align-items: start;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-canvas {
  min-height: 460px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  background: linear-gradient(180deg, #ecf8fb, #f8fcfd);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.map-list {
  display: grid;
  gap: 12px;
  max-height: 560px;
  overflow: auto;
  padding-right: 2px;
}

.map-result-card {
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.map-result-card.active {
  border-color: rgba(15, 139, 141, 0.42);
  box-shadow: 0 14px 26px rgba(15, 139, 141, 0.18);
  transform: translateY(-1px);
}

.map-result-meta {
  margin: 4px 0 0;
  font-size: 13px;
}

.map-price {
  font-size: 20px;
}

.map-popup {
  display: grid;
  gap: 4px;
  min-width: 220px;
}

.map-popup p {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

.map-popup-actions {
  margin-top: 4px;
}

.map-popup-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary), #109ba2 65%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
}

.leaflet-container {
  font-family: "IBM Plex Sans", Segoe UI, Tahoma, sans-serif;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #fff;
}

.leaflet-price-badge-wrap {
  background: transparent;
  border: 0;
}

.leaflet-price-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 74px;
  border-radius: 999px;
  border: 1px solid rgba(15, 139, 141, 0.34);
  background: #ffffff;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 9px 18px rgba(11, 35, 45, 0.18);
}

.leaflet-price-badge.active {
  background: linear-gradient(135deg, var(--primary), #109ba2 65%);
  color: #fff;
  border-color: rgba(9, 77, 79, 0.28);
}

.marker {
  position: absolute;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  max-width: min(240px, 78vw);
  overflow: hidden;
  text-overflow: ellipsis;
}

.marker.active {
  background: linear-gradient(135deg, var(--primary), #109ca2);
  color: #fff;
  border-color: var(--primary);
}

.timeline {
  display: grid;
  gap: var(--space-2);
}

.timeline-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
}

.timeline-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-top: 4px;
}

.timeline-dot.done {
  background: var(--success);
}

.timeline-dot.active {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 139, 141, 0.24);
}

.timeline-dot.pending {
  border: 2px solid #b8c8d6;
  background: #fff;
}

.chat-stream {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  background: linear-gradient(180deg, #fafdff, #f6fcfa);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.chat-msg {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
}

.chat-msg.me {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary), #109ca2);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg.them {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-msg.system {
  align-self: center;
  background: #eef5fa;
  color: var(--text-soft);
  border-radius: 999px;
  font-size: 12px;
}

.stock-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e5edf3;
  overflow: hidden;
}

.stock-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #16a7ad);
}

.stock-fill.warning {
  background: var(--warning);
}

.stock-fill.empty {
  background: #9ca3af;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  height: 156px;
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.bar-track {
  width: 100%;
  height: 118px;
  border-radius: 8px;
  background: #edf3f7;
  display: flex;
  align-items: end;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #0f8b8d, #197943);
}

.amount-positive {
  color: var(--success);
}

.amount-negative {
  color: var(--danger);
}

.profile-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: var(--shadow);
}

.profile-avatar-text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #11a2a8, var(--accent));
}

.notice {
  border: 1px solid rgba(15, 139, 141, 0.28);
  background: linear-gradient(180deg, #f3fffd, #eefdff);
  color: #0f5967;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
  box-shadow: 0 6px 14px rgba(11, 35, 45, 0.06);
}

.inline-form {
  display: inline;
  margin: 0;
}

.page-narrow {
  max-width: 560px;
  margin-inline: auto;
}

.lead {
  margin-top: 0;
  margin-bottom: 0;
}

.section-head {
  margin-bottom: 10px;
}

.row-top {
  align-items: flex-start;
}

.stack-sm {
  display: grid;
  gap: 10px;
}

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

.mt-sm {
  margin-top: 10px;
}

.mt-md {
  margin-top: 12px;
}

.mb-0 {
  margin-bottom: 0;
}

.text-xs {
  font-size: 12px;
}

.text-sm {
  font-size: 13px;
}

.cursor-pointer {
  cursor: pointer;
}

.btn-pill {
  border-radius: 999px;
}

.btn-compact {
  padding: 6px 10px;
  min-height: 34px;
}

.listing-favorite-form {
  position: absolute;
  top: 10px;
  right: 10px;
}

.listing-verified {
  position: absolute;
  left: 10px;
  bottom: 10px;
}

.card-quiet {
  border-style: dashed;
}

.inset-card {
  padding: 12px;
}

.inventory-item {
  padding: 12px;
}

.inventory-thumb {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 12px;
}

.centered-marker {
  top: 50%;
  left: 50%;
}

.control-label {
  font-size: 13px;
  margin-bottom: 4px;
}

.card-inset {
  margin-top: 12px;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .listing-card,
  .btn,
  .chip,
  .nav-chip {
    animation: none;
    transition: none;
  }
}

.footer-links {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.footer-links > a,
.footer-links > form,
.footer-links > button {
  width: 100%;
}

.footer-links form {
  display: block;
}

.footer-links form .btn {
  width: 100%;
}

@media (min-width: 720px) {
  .page {
    width: min(100%, 780px);
    padding: 18px 16px;
  }

  .topbar-inner {
    width: min(100%, 780px);
  }

  .search-row {
    grid-template-columns: 1fr auto;
  }

  .footer-links > a,
  .footer-links > form,
  .footer-links > button {
    width: auto;
  }

  .footer-links form .btn {
    width: auto;
  }

  .map-shell {
    min-height: 390px;
  }

  .map-canvas {
    min-height: 500px;
  }

  .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .page {
    width: min(100%, 1280px);
    padding: 20px;
  }

  .topbar-inner {
    width: min(100%, 1280px);
    padding: 14px 16px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .inline-nav {
    width: auto;
    overflow-x: visible;
  }

  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-split {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  }

  .map-list {
    max-height: 620px;
  }

  .listing-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}
