/* ================================
   CSS VARIABLES
   ================================ */
:root {
  --bg: #f5f2e9;
  --app-bar-bg: #ffffff;
  --card-bg: #ffffff;
  --card-muted-bg: #faf7f1;
  --input-bg: #ffffff;
  --text: #1c1c1c;
  --text-muted: #6a6a6a;
  --label: #444444;
  --border: #e2ded6;
  --border-subtle: #e2ded6;
  --border-strong: #d3cec3;
  --brand-green: #2c6e4f;
  --brand-gold: #b68a40;

  /* Legacy aliases (mapped to new palette) */
  --jm-bg: var(--bg);
  --jm-card: var(--card-bg);
  --jm-border-subtle: var(--border);
  --jm-text-main: var(--text);
  --jm-text-muted: var(--text-muted);
  --jm-green: var(--brand-green);
  --jm-green-soft: rgba(44, 110, 79, 0.12);
  --jm-gold: var(--brand-gold);
  --jm-danger: #c0392b;
  --jm-success: #2e7d32;
  --jm-surface-1: var(--bg);
  --jm-surface-2: var(--card-bg);
  --jm-surface-3: var(--card-bg);
  --jm-shadow-1: 0 1px 4px rgba(0, 0, 0, 0.08);
  --jm-shadow-2: 0 4px 12px rgba(0, 0, 0, 0.10);
  --jm-shadow-3: 0 10px 24px rgba(0, 0, 0, 0.12);
  --bg-page: var(--bg);
  --bg-panel: var(--card-bg);
  --bg-soft-green: var(--jm-green-soft);
  --bg-soft-brown: #f6ead7;
  --accent-green: var(--brand-green);
  --accent-green-soft: var(--jm-green-soft);
  --accent-brown: var(--brand-gold);
  --accent-brown-soft: #f3e3c7;
  --text-main: var(--text);
  --text-muted: var(--text-muted);
  --border-soft: var(--border);
  --wood-brown: var(--brand-gold);
  --forest-green: var(--brand-green);
  --dark-gray: var(--text);
  --light-bg: var(--bg);
  --bluegrass-blue: var(--brand-green);
  --field-gold: var(--brand-gold);
  --barn-red: #7A2E1A;
}

/* ================================
   RESETS & BASE RULES
   ================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--jm-bg);
  color: var(--text-main);
  line-height: 1.55;
  font-size: 16px;
  animation: page-fade-in 0.45s ease-out;
}

a:focus-visible,
.button-primary:focus-visible,
.button-secondary:focus-visible {
  outline: 2px solid var(--jm-gold);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-green) 60%, transparent);
}

/* ================================
   TYPOGRAPHY
   ================================ */
h1 {
  font-size: clamp(2rem, 3vw + 1.2rem, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 650;
}

h2 {
  font-size: clamp(1.35rem, 2vw + 1rem, 1.7rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 620;
}

h3 {
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: -0.012em;
  font-weight: 600;
}

p {
  letter-spacing: -0.005em;
}

.page-header h1,
.page-title {
  font-size: clamp(1.7rem, 2vw + 1.2rem, 2rem);
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.section-heading {
  font-size: 1.15rem;
  font-weight: 650;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.section-subtitle {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.market-tagline {
  margin: 0;
  padding: 0;
  font-size: 0.75rem;
  opacity: 0.75;
}

.hero-tagline {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-brown);
}

.tagline {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.bluegrass-text {
  color: var(--accent-green);
}

.field-gold-text {
  color: var(--accent-brown);
}

.barn-red-text {
  color: var(--barn-red);
}

/* ================================
   LAYOUT
   ================================ */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--jm-surface-1);
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1;
  padding: 0 0 72px 0;
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background-color: var(--app-bar-bg);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--jm-shadow-1);
}

.app-bar-left {
  display: flex;
  flex-direction: column;
}

.app-bar-tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.app-bar-auth {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.app-bar-auth a {
  color: var(--jm-green);
  text-decoration: none;
  font-weight: 600;
}

.app-bar-auth a:hover {
  color: #24562c;
  text-decoration: underline;
}

.theme-toggle {
  border: 1px solid var(--border-soft);
  background: var(--card-muted-bg);
  color: var(--text-main);
  border-radius: 12px;
  padding: 0.35rem 0.55rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--jm-shadow-1);
}

.app-bar a:focus-visible,
.bottom-nav a:focus-visible {
  outline: 2px solid var(--field-gold);
  outline-offset: 2px;
}

.bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  background-color: var(--app-bar-bg);
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  margin: 6px;
  background-color: transparent;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.nav-item:hover {
  color: var(--jm-green);
  background-color: var(--jm-green-soft);
  border-color: rgba(47, 107, 53, 0.25);
}

.nav-item-active {
  background-color: var(--card-bg);
  color: var(--jm-green);
  font-weight: 700;
  border-color: var(--border-subtle);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.nav-label {
  line-height: 1.1;
}

@media (min-width: 700px) {
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: auto;
    height: 64px;
  }

  .nav-item {
    margin: 6px 8px;
    padding: 10px 8px;
    font-size: 0.88rem;
  }
}

.app-footer {
  padding: 0.75rem 1rem 1rem 1rem;
  font-size: 0.8rem;
  color: var(--text-main);
  background-color: var(--app-bar-bg);
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.85);
}

.footer-inner a {
  color: var(--bluegrass-blue);
  text-decoration: none;
}

.footer-inner a:hover {
  text-decoration: underline;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: block;
}

.page-shell {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 1.25rem 1rem 2.25rem;
  margin: 0;
  max-width: 100%;
}

.page-section {
  margin-bottom: 1.65rem;
}

.page-section + .page-section {
  margin-top: 2.1rem;
}

.hero,
.page-section {
  margin-left: 0.75rem;
  margin-right: 0.75rem;
}

.hero {
  max-width: 640px;
  margin: 0 auto 1.25rem;
  padding: 0.75rem 0;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hero-title {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.25;
}

.hero-subtitle {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0.9;
}

.page-header {
  margin-bottom: 1.4rem;
}

.section-divider {
  border-top: 1px solid var(--border-soft);
  margin: 2rem 0;
}

.section-card {
  border-radius: 0.9rem;
  border: 1px solid var(--border-subtle);
  background-color: var(--card-bg);
  padding: 1.2rem 1.35rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.layout-main-aside {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 1.5rem;
  align-items: flex-start;
}

.search-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: flex-start;
}

.search-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.search-main {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.search-summary {
  font-size: 0.95rem;
  opacity: 0.88;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: space-between;
  align-items: baseline;
}

.search-summary span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.search-summary strong {
  font-weight: 600;
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.cards-grid {
  display: grid;
  gap: 1rem;
}

/* ================================
   COMPONENTS
   ================================ */

/* Buttons */
.btn,
.button-primary,
.button-secondary,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease-out, color 0.2s ease-out, transform 0.2s ease-out, box-shadow 0.2s ease-out, border-color 0.2s ease-out;
}

.btn-primary,
.button-primary {
  padding: 0.82rem 1.1rem;
  border: none;
  background-color: var(--jm-green);
  color: #fff;
  box-shadow: var(--jm-shadow-2);
}

.btn-primary:hover,
.button-primary:hover {
  background-color: color-mix(in srgb, var(--jm-green) 85%, #000 15%);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.btn-secondary,
.button-secondary {
  padding: 0.82rem 1.1rem;
  border: 1px solid var(--border-subtle);
  background-color: var(--card-muted-bg);
  color: var(--text-main);
  box-shadow: var(--jm-shadow-1);
}

.btn-secondary:hover,
.button-secondary:hover {
  background-color: var(--bg-soft-brown);
  transform: translateY(-1px);
  box-shadow: var(--jm-shadow-2);
}

.btn-ghost,
.button-link {
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--jm-green);
  font-size: 0.9rem;
}

.btn-ghost:hover,
.button-link:hover {
  text-decoration: underline;
}

.btn-full {
  width: 100%;
}

/* Cards */
.card,
.card-compact {
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;
  will-change: transform;
}

.card:hover,
.card-compact:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.card-elevated {
  border-radius: 1rem;
  border: 1px solid var(--border-soft);
  background-color: var(--card-bg);
  box-shadow: var(--jm-shadow-2);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
  animation: card-fade-in 0.4s ease-out;
}

.card-elevated:hover {
  transform: translateY(-1px);
  box-shadow: var(--jm-shadow-3);
}

.hero-card {
  animation: fade-in-up 0.5s ease-out both;
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
}

.hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15);
}

.filters-card {
  border-radius: 0.9rem;
  border: 1px solid var(--border-subtle);
  background-color: var(--card-bg);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

/* Log Cards & Listings */
.results-grid .log-card,
.results-list .log-card,
.results-list > div {
  padding: 0.95rem 1rem;
}

.log-card,
.results-list > div {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.9rem;
  border-radius: 0.95rem;
  border: 1px solid var(--border-subtle);
  background-color: var(--card-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out, border-color 0.18s ease-out;
}

.results-list > div {
  flex-direction: column;
  align-items: flex-start;
}

.results-list > div > * + * {
  margin-top: 0.2rem;
}

.log-card:hover,
.results-list > div:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.11);
  border-color: rgba(0, 0, 0, 0.12);
}

.log-card > div:first-child {
  flex: 1;
  min-width: 0;
}

.log-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: space-between;
  align-items: baseline;
}

.log-card-title {
  font-weight: 700;
  font-size: 1.06rem;
}

.log-card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.log-card-location {
  font-size: 0.8rem;
  opacity: 0.85;
}

.log-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.8rem;
}

.log-card-price-specs {
  margin-top: 0.25rem;
}

.log-card-image-wrapper {
  margin-bottom: 0.45rem;
  border-radius: 0.6rem;
  overflow: hidden;
  background-color: #f3f4f6;
}

.log-card-image {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.log-price {
  font-weight: 700;
  font-size: 1rem;
  color: var(--forest-green);
}

.log-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.log-price-unit {
  font-size: 0.82rem;
  opacity: 0.8;
}

.log-specs-line {
  font-size: 0.8rem;
  opacity: 0.9;
}

.log-footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  opacity: 0.9;
}

.log-actions {
  display: flex;
  align-items: flex-end;
}

.log-actions .button-secondary {
  white-space: nowrap;
  font-size: 0.85rem;
}

/* Badges, Tags & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-soft {
  background-color: var(--jm-green-soft);
  color: var(--jm-green);
}

.badge-gold {
  background-color: rgba(194, 138, 46, 0.14);
  color: var(--jm-gold);
}

.badge-success {
  background-color: rgba(46, 125, 50, 0.12);
  color: var(--jm-success);
}

.badge-warning {
  background-color: rgba(194, 138, 46, 0.16);
  color: var(--jm-gold);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.14rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.status-pill.status-live {
  background-color: #ecfdf3;
  color: #166534;
  border-color: #16a34a33;
}

.status-pill.status-pending {
  background-color: #fffbeb;
  color: #92400e;
  border-color: #f59e0b33;
}

.status-pill.status-sold {
  background-color: #f3f4f6;
  color: #4b5563;
  border-color: #9ca3af44;
}

.product-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.16rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.product-chip.logs {
  background-color: rgba(14, 61, 27, 0.07);
  color: var(--forest-green);
}

.product-chip.lumber {
  background-color: rgba(160, 107, 61, 0.09);
  color: var(--wood-brown);
}

.product-chip.mill {
  background-color: rgba(44, 79, 158, 0.08);
  color: var(--bluegrass-blue);
}

.log-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.log-tag {
  background-color: #faf6ef;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  white-space: nowrap;
}

.log-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.75rem;
  opacity: 0.95;
  margin-bottom: 0.4rem;
}

.log-icon-pill {
  border-radius: 999px;
  background-color: #f3f4f6;
  padding: 0.18rem 0.55rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}

.listing-tags {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.listing-tag {
  background-color: #faf6ef;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  white-space: nowrap;
}

.preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.preset-pill {
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  background-color: #faf6ef;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s ease-out, border-color 0.16s ease-out, transform 0.16s ease-out;
}

.preset-pill:hover {
  background-color: #f4eee6;
  transform: translateY(-1px);
}

.preset-pill.is-active {
  background-color: var(--jm-green-soft);
  border-color: var(--jm-green);
  color: var(--jm-green);
}

.pill,
.preset-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid var(--jm-border-subtle);
  background-color: var(--jm-card);
  color: var(--jm-text-main);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pill-outline {
  border-color: var(--jm-border-subtle);
  background: transparent;
}

.pill-filled {
  background-color: var(--jm-green-soft);
  color: var(--jm-green);
  border-color: var(--jm-green);
}

.dimension-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.14rem 0.55rem;
  font-size: 0.75rem;
  background-color: #f9fafb;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.dimension-badge span.label {
  opacity: 0.75;
}

.byproduct-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.14rem 0.55rem;
  font-size: 0.75rem;
  background-color: var(--accent-brown-soft);
  border: 1px solid var(--border-soft);
  color: var(--accent-brown);
}

/* Early Access Banner */
.early-access-banner {
  position: sticky;
  top: 56px;
  z-index: 30;
  background: color-mix(in srgb, var(--brand-gold) 12%, transparent);
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 8px rgba(15,23,42,0.05);
  font-size: 0.9rem;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  text-align: center;
  animation: banner-slide-down 0.35s ease-out;
}

/* Sidebar */
.sidebar-section {
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-heading {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.sidebar-note {
  font-size: 0.8rem;
  opacity: 0.8;
}

.sidebar-actions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Forms */
.form-group {
  margin-bottom: 0.9rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--label);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="file"],
select,
textarea {
  padding: 0.65rem 0.8rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border-subtle);
  font-size: 0.95rem;
  font-family: inherit;
  background-color: var(--input-bg);
  color: var(--text-main);
  resize: vertical;
}

textarea {
  min-height: 120px;
}

.status-message {
  display: none;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.55rem;
  font-size: 0.92rem;
  min-height: 1.1rem;
  box-shadow: 0 2px 6px rgba(15,23,42,0.05);
  color: var(--text-main);
}

.status-message.is-visible {
  display: block;
}

.status-success {
  background-color: rgba(46, 125, 50, 0.12);
  border: 1px solid rgba(46, 125, 50, 0.4);
  color: var(--jm-success);
}

.status-error {
  background-color: rgba(192, 57, 43, 0.12);
  border: 1px solid rgba(192, 57, 43, 0.3);
  color: var(--jm-danger);
}

.status-info {
  background-color: rgba(44, 96, 171, 0.12);
  border: 1px solid rgba(44, 96, 171, 0.3);
  color: #2c60ab;
}

.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

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

.hint {
  display: block;
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 0.2rem;
}

/* Photo Gallery */
.photo-gallery {
  margin: 1.75rem 0 1.25rem 0;
}

.photo-gallery h2 {
  margin-bottom: 0.45rem;
  font-size: 1.15rem;
}

.photo-note {
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
  opacity: 0.9;
}

.photo-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.photo-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.photo-placeholder {
  min-height: 140px;
  border-radius: 0.5rem;
  border: 1px dashed rgba(0, 0, 0, 0.2);
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.6);
  text-align: center;
  padding: 0.5rem;
}

/* Dropdowns */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.4rem;
  min-width: 180px;
  background-color: var(--card-bg);
  border-radius: 0.6rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  padding: 0.4rem 0;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.dropdown-menu a {
  display: block;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  color: var(--dark-gray);
  text-decoration: none;
}

.dropdown-menu a:hover {
  background-color: #f4eee6;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Collapsible Panels */
.collapsible-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  transition: max-height 0.25s ease-out, opacity 0.25s ease-out, transform 0.25s ease-out;
}

.collapsible-panel.is-open {
  max-height: 600px;
  opacity: 1;
  transform: translateY(0);
}

.collapsible-toggle {
  cursor: pointer;
}

.advanced-filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

.advanced-filters-toggle span.icon {
  font-size: 0.9rem;
}

.advanced-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.advanced-filters-grid .form-group {
  margin-bottom: 0;
}

/* Hauler Cards */
.hauler-card {
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.88rem;
}

.hauler-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem;
}

.hauler-card-name {
  font-weight: 600;
}

.hauler-card-meta {
  font-size: 0.8rem;
  opacity: 0.9;
}

.hauler-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.hauler-tag {
  border-radius: 999px;
  padding: 0.16rem 0.55rem;
  font-size: 0.75rem;
  background-color: #f3f4f6;
  border: 1px solid rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}

/* Empty States */
.results-empty {
  border-radius: 0.85rem;
  border: 1px dashed rgba(0, 0, 0, 0.16);
  background-color: #f9fafb;
  padding: 1rem 1.1rem;
  font-size: 0.88rem;
}

.results-empty-title {
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.results-empty-actions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.reset-filters-link {
  font-size: 0.82rem;
  color: var(--bluegrass-blue);
  text-decoration: none;
  cursor: pointer;
}

.reset-filters-link:hover {
  text-decoration: underline;
}

.buyer-request-card {
  max-width: 540px;
  margin: 0 auto 1.5rem;
  padding: 1.25rem 1.35rem;
  border-radius: 0.9rem;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
}

#buyer-request-section .stack-sm {
  gap: 0.35rem;
}

#buyer-request-section #buyer-request-submit {
  width: 100%;
}

#buyer-request-section .field-hint {
  font-size: 0.82rem;
  color: var(--jm-text-muted);
}

.buyer-request-card .section-heading,
.buyer-request-card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.buyer-request-card .section-subtitle {
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}

.buyer-request-card .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.buyer-request-card .form-group + .form-group {
  margin-top: 0.6rem;
}

.buyer-request-card input,
.buyer-request-card select,
.buyer-request-card textarea {
  width: 100%;
  box-sizing: border-box;
}

.buyer-request-card .button-primary {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  margin-top: 0.8rem;
}

.buyer-request-card .form-footer,
.buyer-request-card small {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  opacity: 0.85;
}

#buyer-request-section input,
#buyer-request-section select {
  height: 44px;
}

#buyer-request-section input,
#buyer-request-section select,
#buyer-request-section textarea {
  font-size: 0.97rem;
  line-height: 1.4;
  padding: 0.55rem 0.85rem;
  border-radius: 0.55rem;
}

#buyer-request-section input::placeholder,
#buyer-request-section select::placeholder,
#buyer-request-section textarea::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

.link-tiles .button-secondary {
  font-size: 0.9rem;
  padding: 0.6rem 0.85rem;
}

#buyer-request-status {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

/* ================================
   UTILITIES & HELPERS
   ================================ */
.mini-steps {
  margin: 0.35rem 0 0.9rem 1.1rem;
  font-size: 0.85rem;
  padding-left: 0;
}

.mini-steps li {
  margin-bottom: 0.15rem;
}

.page-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.comfort-box {
  margin-top: 0.75rem;
  background: var(--card-muted-bg);
  border-radius: 0.75rem;
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 0.9rem;
  font-size: 0.85rem;
  color: var(--text-main);
}

.comfort-box strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.comfort-box ul {
  margin: 0.25rem 0 0 1.1rem;
  padding-left: 0;
}

.comfort-box li {
  margin-bottom: 0.15rem;
}

.stack-sm > * + * {
  margin-top: 0.35rem;
}

.stack-md > * + * {
  margin-top: 0.75rem;
}

.stack-lg > * + * {
  margin-top: 1.25rem;
}

.scroll-reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}

.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.highlight-pulse {
  animation: highlight-pulse 1.2s ease-out;
}

.fade-in-up {
  animation: fade-in-up 0.4s ease-out both;
}

/* ================================
   ANIMATIONS
   ================================ */
@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes highlight-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(44, 116, 179, 0.45);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(44, 116, 179, 0);
  }
}

@keyframes banner-slide-down {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cards-grid .card {
  animation: fade-in-up 0.45s ease-out both;
}

.cards-grid .card:nth-child(1) { animation-delay: 0.03s; }
.cards-grid .card:nth-child(2) { animation-delay: 0.08s; }
.cards-grid .card:nth-child(3) { animation-delay: 0.13s; }
.cards-grid .card:nth-child(4) { animation-delay: 0.18s; }
.cards-grid .card:nth-child(5) { animation-delay: 0.23s; }
.cards-grid .card:nth-child(6) { animation-delay: 0.28s; }

/* ================================
   MEDIA QUERIES
   ================================ */

/* Desktop & Tablet: min-width 720px */
@media (min-width: 720px) {
  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

/* Tablet: min-width 768px */
@media (min-width: 768px) {
  .app-shell {
    max-width: 720px;
  }

  .app-content {
    padding-top: 0.5rem;
  }
}

/* Mobile & Small Screens */
@media (max-width: 700px) {
  body {
    font-size: 15px;
  }

  .app-shell {
    max-width: 100%;
    margin: 0 auto;
    padding-top: 0.5rem;
  }

  .app-content {
    padding-bottom: 66px;
    margin-top: 0;
  }

  .app-bar {
    height: 52px;
    padding: 0 12px;
  }

  .app-bar-tagline {
    font-size: 0.62rem;
    margin-top: 0.05rem;
  }

  .early-access-banner {
    top: 52px;
    font-size: 0.82rem;
    padding: 0.5rem 0.85rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  .tagline {
    font-size: 0.65rem;
    letter-spacing: 0.05em;
  }

  .page-shell {
    margin: 0.9rem 0.55rem 1.6rem;
    padding: 0.85rem 0.85rem 1.5rem;
    border-radius: 0.8rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  }

  .page-header {
    margin-bottom: 1rem;
  }

  .page-header h1,
  .page-title {
    font-size: 1.32rem;
    line-height: 1.2;
  }

  .section-heading {
    font-size: 1.05rem;
  }

  .section-subtitle {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .hero,
  .page-section {
    margin-left: 0;
    margin-right: 0;
  }

  .card-elevated,
  .comfort-box,
  .plan-card,
  .contact-box,
  .note-box,
  .hero-card,
  .map-card,
  .spec-grid,
  .signup-section,
  .login-card {
    padding: 0.95rem 0.9rem;
    border-radius: 0.8rem;
  }

  #buyer-request-section {
    padding: 1rem 0.9rem;
  }

  #buyer-request-section .stack-sm {
    gap: 0.3rem;
  }

  #buyer-request-status {
    margin-top: 0.2rem;
    margin-bottom: 0.3rem;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="file"],
  select,
  textarea,
  #buyer-request-section input,
  #buyer-request-section select,
  #buyer-request-section textarea {
    font-size: 0.95rem;
    padding: 0.6rem 0.75rem;
  }

  textarea {
    min-height: 110px;
  }

  .stack-md > * + * {
    margin-top: 0.65rem;
  }

  .stack-sm > * + * {
    margin-top: 0.3rem;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .form-actions .button-primary,
  .form-actions .button-secondary {
    width: 100%;
  }

  .button-primary,
  .button-secondary {
    padding: 0.65rem 1rem;
  }

  .preset-pills {
    gap: 0.35rem;
  }

  .buyer-request-card {
    margin: 0.75rem auto 1.75rem;
    padding: 1.1rem 1rem 1.2rem;
    border-radius: 0.85rem;
  }

  .search-layout,
  .layout-main-aside {
    display: block;
  }

  .search-sidebar,
  .search-main,
  .filters-bar,
  .results-toolbar,
  .results-empty {
    width: 100%;
  }

  .bottom-nav {
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
  }

  .nav-item {
    padding: 9px 6px;
    margin: 5px;
    font-size: 0.8rem;
  }

  .early-access-banner {
    padding: 4px 10px;
    font-size: 0.75rem;
    line-height: 1.1;
  }

  .app-bar {
    padding: 6px 12px;
    min-height: 42px;
    padding-top: 0.45rem;
    padding-bottom: 0.35rem;
    box-shadow: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  }

  .app-bar-left {
    align-items: center;
    gap: 0.25rem;
  }

  .app-bar img {
    height: 22px;
  }

  .hero {
    margin-top: 0.4rem;
    margin-bottom: 0.9rem;
    padding-top: 0.35rem;
  }

  .buyer-request-card {
    margin-top: 0.5rem !important;
  }

  .page-content {
    padding-top: 0.5rem;
  }

  .early-access-banner {
    margin-top: 0.4rem;
    margin-bottom: 0.5rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    line-height: 1.25;
    border-radius: 0.75rem;
  }

  @supports (padding-top: env(safe-area-inset-top)) {
    .app-shell {
      padding-top: calc(env(safe-area-inset-top) + 0.25rem);
    }
  }

  /* Override top spacing to respect safe area and keep content visible */
  .app-shell {
    padding-top: calc(env(safe-area-inset-top, 0px) + 0.9rem);
  }

  .app-bar {
    padding: 0.45rem 1rem 0.3rem;
    min-height: 44px;
  }

  .market-tagline {
    margin-top: 0.15rem;
    margin-bottom: 0;
    font-size: 0.72rem;
    line-height: 1.2;
    opacity: 0.8;
  }

  .app-content,
  .page-content {
    margin-top: 0;
    padding-top: 0.5rem;
  }

  .hero-title {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .hero-subtitle {
    font-size: 0.85rem;
    line-height: 1.35;
  }

}

/* Desktop & Large Tablets: max-width 900px */
@media (max-width: 900px) {
  .search-layout,
  .layout-main-aside {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
