:root {
  --rf-ink: #172033;
  --rf-muted: #667085;
  --rf-line: #e4e7ec;
  --rf-brand: #0f766e;
  --rf-accent: #f97316;
}

body {
  color: var(--rf-ink);
  background: #f7f8fb;
  min-height: 100vh;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: rgba(15, 118, 110, .16);
}

a,
button,
.btn,
.form-control,
.form-select {
  touch-action: manipulation;
}

.btn,
.form-control,
.form-select {
  min-height: 44px;
}

.navbar-brand {
  font-weight: 800;
  letter-spacing: 0;
}

.mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px max(10px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
  border-top: 1px solid var(--rf-line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}

.mobile-tabbar a {
  display: grid;
  gap: 2px;
  justify-items: center;
  color: var(--rf-muted);
  text-decoration: none;
  font-size: .72rem;
}

.mobile-tabbar span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f2f4f7;
  color: var(--rf-ink);
  font-size: 1rem;
}

.mobile-tabbar strong {
  font-weight: 700;
}

.section-kicker {
  color: var(--rf-brand);
  font-weight: 800;
  font-size: .86rem;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f2f4f7;
  color: var(--rf-muted);
  font-size: .82rem;
}

.rf-hero {
  background: linear-gradient(120deg, rgba(15, 118, 110, .94), rgba(23, 32, 51, .92)), url("https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?auto=format&fit=crop&w=1600&q=80") center/cover;
  min-height: 360px;
}

.rf-card {
  border: 1px solid var(--rf-line);
  border-radius: 8px;
  background: #fff;
}

.rf-badge {
  background: #ecfdf5;
  color: var(--rf-brand);
}

.product-thumb {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eef2f7;
}

.chat-box {
  height: 420px;
  overflow-y: auto;
  background: #fff;
}

.chat-message {
  max-width: 72%;
  border-radius: 8px;
}

.chat-message.mine {
  margin-left: auto;
  background: #d1fae5;
}

.chat-message.theirs {
  background: #f2f4f7;
}

.offline-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f7f8fb;
}

.offline-panel {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid var(--rf-line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.offline-panel h1 {
  margin: 18px 0 10px;
  font-size: 1.35rem;
}

.offline-panel p {
  color: var(--rf-muted);
}

.offline-panel a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--rf-brand);
  color: #fff;
  text-decoration: none;
}

@media (max-width: 575.98px) {
  .navbar .container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .rf-hero {
    min-height: 420px;
  }

  .rf-hero .display-5 {
    font-size: 2rem;
    line-height: 1.18;
  }

  .rf-hero .lead {
    font-size: 1rem;
  }

  .container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .table-responsive {
    border-radius: 8px;
  }

  .chat-box {
    height: min(58vh, 460px);
  }

  .chat-message {
    max-width: 88%;
  }
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }

  .mobile-tabbar {
    display: none;
  }
}
