body { background: #f7faf7; color: #1f2a24; }
.around-agromath { margin: 1.25rem 0; padding: 1rem; border-block: 1px solid #86c9c3; border-left: 5px solid #0f766e; background: #effbf8; color: #164e48; }
.around-agromath h2 { color: #115e59; font-weight: 700; }
.buyer-demand { margin: 1rem 0; padding: 1rem; border-block: 1px solid #e7bd57; border-left: 5px solid #a76400; background: #fff8df; color: #543b09; }
.buyer-demand a { color: #704400; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.buyer-demand-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; padding-top: .8rem; margin-top: .8rem; border-top: 1px solid #e7cf8f; }
.buyer-demand-row > div { min-width: 0; overflow-wrap: anywhere; }
.request-count { display: inline-block; background: #ffd666; color: #463000; border-radius: 4px; padding: .15em .45em; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.around-agromath p { margin-bottom: .5rem; }
.around-agromath-listings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.around-agromath-product { display: flex; align-items: center; gap: .65rem; min-width: 0; min-height: 64px; text-decoration: none; }
.around-agromath-product span { overflow-wrap: anywhere; }
.around-agromath-product img { width: 64px; height: 64px; flex: 0 0 64px; object-fit: contain; background: #eef3ee; }
.around-agromath-help { display: inline-flex; align-items: center; min-height: 44px; margin-top: .4rem; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 1rem; letter-spacing: 0; }
h2, h3 { letter-spacing: 0; }
a { color: #146c43; }
.app-shell { max-width: 1180px; }
.navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 0 rgba(5, 61, 55, .32);
}
.navbar.bg-success { background-color: #0f766e !important; }
.navbar-dark .navbar-nav .nav-link { color: rgba(255, 255, 255, .86); }
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus { color: #fff; }
.navbar .container { max-width: 1180px; }
.navbar-brand { display: inline-flex; align-items: center; gap: .45rem; }
.navbar-brand-mark { width: 28px; height: 28px; border-radius: 7px; flex: 0 0 auto; }
.navbar-nav { flex-wrap: wrap; }
.navbar .nav-link { white-space: nowrap; }
.mobile-header-request-link { display: none; }
.narrow-panel, .panel, .section-panel { background: #fff; border: 1px solid #dfe8df; border-radius: 8px; padding: 1rem; }
.narrow-panel { max-width: 640px; }
.section-panel { margin-bottom: 1rem; }
.panel { max-width: none; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #fff; border: 1px solid #e1e8e1; border-radius: 8px; padding: .85rem 1rem; margin-bottom: .6rem; }
.list-row-main { min-width: 0; }
.list-row-main strong, .text-wrap-balance { overflow-wrap: anywhere; }
.muted { color: #66736b; }
.emoji-cue { display: inline-block; font-size: .95em; line-height: 1; margin-right: .35rem; vertical-align: -0.05em; }
.pilot-note, .info-note { background: #eef7fb; border: 1px solid #bfdde8; border-radius: 8px; color: #244653; padding: .75rem; }
.caution-note { background: #fff8e1; border: 1px solid #e4bd58; border-left: 4px solid #d59b16; border-radius: 8px; color: #59440f; padding: .75rem; }
.user-note { color: #46564d; font-size: .92rem; }
.user-note strong { color: #27362e; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat { background: #fff; border: 1px solid #dfe8df; border-radius: 8px; padding: 1rem; }
.stat span { display: block; font-size: 1.6rem; font-weight: 700; color: #1d6b3a; }
.badge { font-weight: 600; }
.card { border-color: #dfe8df; border-radius: 8px; overflow: hidden; }
.product-card { height: 100%; }
.product-card .card-body { display: flex; flex-direction: column; gap: .4rem; }
.product-card .btn { margin-top: auto; align-self: flex-start; }
.product-image-wrap { position: relative; background: #eef3ee; }
.product-image-wrap .badge { position: absolute; top: .55rem; left: .55rem; box-shadow: 0 1px 4px rgba(15, 49, 39, .15); }
.product-card-heading { display: flex; align-items: flex-start; gap: .6rem; min-width: 0; }
.product-card-heading h3 { min-width: 0; overflow-wrap: anywhere; }
.product-card-thumb { width: 68px; height: 68px; object-fit: contain; border-radius: 8px; background: #eef3ee; border: 1px solid #dfe8df; padding: .25rem; flex: 0 0 68px; }
.product-title { font-size: 1.05rem; line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
.product-thumb { width: 100%; height: 165px; object-fit: contain; border-top-left-radius: 8px; border-top-right-radius: 8px; background: #eef3ee; padding: .45rem; }
.product-image { width: 100%; max-height: 340px; object-fit: contain; border-radius: 8px; background: #eef3ee; padding: .75rem; }
.current-product-image { display: block; width: 100%; max-width: 220px; max-height: 150px; object-fit: contain; border-radius: 8px; background: #eef3ee; border: 1px solid #dfe8df; padding: .4rem; }
.cart-thumb { width: 72px; height: 72px; object-fit: contain; border-radius: 8px; background: #eef3ee; padding: .25rem; flex: 0 0 auto; }
.timeline { background: #fff; border: 1px solid #dfe8df; border-radius: 8px; padding: 1rem 1rem 1rem 2rem; }
.timeline .active { font-weight: 700; color: #198754; }
.chat-line { background: #fff; border: 1px solid #dfe8df; border-radius: 8px; padding: .75rem; margin-bottom: .5rem; }
.unread { border-color: #198754; box-shadow: inset 4px 0 0 #198754; }
.mobile-order-card { display: none; }
.form-section { border-top: 1px solid #e4ebe4; padding-top: 1rem; margin-top: 1rem; }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-section-title { font-size: 1rem; font-weight: 700; margin-bottom: .75rem; }

.action-section-heading { justify-content: flex-start; }
.action-emphasis-section { border: 3px solid #d59b16; border-radius: 8px; padding: 1rem; background: #fffdf7; }
.action-emphasis-section.waiting-section { border: 2px solid #a8b7ad; background: #fbfdfb; }
.action-card-overflow > summary { display: inline-block; list-style: none; cursor: pointer; }
.action-card-overflow > summary::-webkit-details-marker { display: none; }
.dashboard-preview-list > .panel:last-child,
.dashboard-preview-list > .list-row:last-child { margin-bottom: 0 !important; }
.action-emphasis { border: 3px solid #d59b16 !important; }
.product-management-card { border-width: 2px; }
.action-count { min-width: 1.45rem; text-align: center; }
.action-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; margin-bottom: .45rem; }
.action-card-title { min-width: 0; overflow-wrap: anywhere; }
.action-status { max-width: 48%; white-space: normal; text-align: left; }
.action-toolbar { align-items: center; }
.current-action-panel { border-left: 4px solid #198754; }
.current-action-panel h2 { margin-bottom: .6rem; }
.order-sticky-identity {
  position: sticky;
  top: 56px;
  z-index: 1020;
  background: #f7faf7;
  border-bottom: 1px solid #dfe8df;
  padding: .45rem 0;
  margin: -.25rem 0 .75rem;
}
.order-sticky-identity h1 { font-size: clamp(1.25rem, 2.5vw, 1.65rem); }
.order-next-action {
  background: #f0f7f2;
  border: 1px solid #cfe5d6;
  border-left: 5px solid #198754;
  border-radius: 8px;
  padding: 1rem;
  margin-top: .75rem;
  box-shadow: 0 6px 18px rgba(25, 135, 84, .08);
}
.order-action-section { border: 3px solid #198754; }
.fulfilment-section { border: 3px solid #3f6f58; border-radius: 8px; padding: 1rem; background: #f9fcfa; }
.fulfilment-groups-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.fulfilment-groups-grid .fulfilment-panel { margin-bottom: 0 !important; }
@media (max-width: 991.98px) { .fulfilment-groups-grid { grid-template-columns: 1fr; } }
.fulfilment-panel { border-width: 2px; }
.order-next-action-label {
  color: #146c43;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-bottom: .2rem;
}
.order-next-action p { font-size: 1.05rem; }
.order-next-action-cta { min-width: min(100%, 14rem); }
.community-stats {
  display: grid;
  gap: .35rem;
  margin-bottom: 1rem;
}
.community-stats-line {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.primary-action-form { margin: 0; }
.history-panel, .escrow-order { display: block; }
.history-panel summary, .escrow-order summary { cursor: pointer; }
.history-panel summary { padding: .65rem .75rem; background: #fff; border: 1px solid #dfe8df; border-radius: 8px; }
.history-panel[open] summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.history-panel .list-row:first-of-type { margin-top: .6rem; }
.escrow-order summary { margin-bottom: .75rem; }
.order-status-stack .badge { white-space: normal; text-align: left; }
.stock-update-input { max-width: 11rem; }
.delivery-row-actions { min-width: 0; }
.payment-review-actions form { margin: 0; }
.payment-review-actions .btn { white-space: nowrap; }
.help-card { color: inherit; }
.help-card:hover, .help-nav a:hover { border-color: #198754; }
.help-nav a { padding: .25rem 0; }
.location-search-box { position: relative; }
.location-search-results {
  position: absolute;
  top: calc(100% + .25rem);
  left: 0;
  right: 0;
  z-index: 1020;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #dfe8df;
  border-radius: 8px;
  box-shadow: 0 0.5rem 1rem rgba(20, 65, 38, .12);
}
.location-search-option {
  display: block;
  width: 100%;
  padding: .6rem .75rem;
  border: 0;
  border-bottom: 1px solid #edf2ed;
  background: #fff;
  color: inherit;
  text-align: left;
}
.location-search-option:last-child { border-bottom: 0; }
.location-search-option:hover,
.location-search-option:focus,
.location-search-option.is-active {
  background: #eef8f2;
  outline: 0;
}
.location-search-primary { font-weight: 700; line-height: 1.25; }
.location-search-secondary { margin-top: .15rem; color: #6c757d; font-size: .85rem; line-height: 1.25; }
.location-map { min-height: 320px; border: 1px solid #dfe8df; border-radius: 8px; overflow: hidden; background: #eef3ee; }
.location-form .form-check { margin-bottom: 0; }
.market-categories {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .15rem 0 .45rem;
  scrollbar-width: thin;
}
.market-category {
  flex: 0 0 auto;
  padding: .45rem .7rem;
  border: 1px solid #198754;
  border-radius: 6px;
  color: #146c43;
  background: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.market-category:hover,
.market-category:focus,
.market-category.active {
  color: #fff;
  background: #198754;
}
.market-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
}
.market-filter-details > summary {
  display: inline-flex;
  cursor: pointer;
  list-style: none;
}
.market-filter-details > summary::-webkit-details-marker { display: none; }
.mobile-bottom-nav { display: none; }

@media (max-width: 767px) {
  .around-agromath-listings { grid-template-columns: minmax(0, 1fr); }
  :root {
    --mobile-bottom-nav-clearance: calc(10rem + env(safe-area-inset-bottom));
    --mobile-form-action-clearance: calc(3rem + env(safe-area-inset-bottom));
  }
  html { scroll-padding-bottom: var(--mobile-bottom-nav-clearance); }
  body { font-size: .96rem; }
  h1 { font-size: 1.55rem; margin-bottom: .75rem; }
  h2.h4 { font-size: 1.25rem; margin-top: .5rem; margin-bottom: .65rem; }
  .app-shell { padding: 1rem; padding-bottom: var(--mobile-bottom-nav-clearance); }
  .app-shell::after {
    content: "";
    display: block;
    height: var(--mobile-bottom-nav-clearance);
  }
  .product-order-panel,
  .checkout-panel { margin-bottom: var(--mobile-form-action-clearance); }
  .navbar { padding-top: .45rem; padding-bottom: .45rem; }
  .navbar-brand { font-size: 1.2rem; gap: .4rem; }
  .navbar-brand-mark { width: 24px; height: 24px; border-radius: 6px; }
  .mobile-header-request-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    margin-left: auto;
    padding: .35rem .65rem;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 6px;
    color: #fff;
    font-size: .86rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
  }
  .mobile-header-request-link:hover,
  .mobile-header-request-link:focus {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, .12);
  }
  .navbar-toggler { display: none; }
  .navbar-collapse { display: none !important; }
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1045;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .15rem;
    padding: .25rem .4rem calc(.25rem + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #dfe8df;
    box-shadow: 0 -6px 16px rgba(15, 49, 39, .08);
  }
  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    color: #146c43;
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
  }
  .mobile-bottom-nav span {
    margin-top: .12rem;
    padding: .08rem .28rem;
    border-radius: 999px;
    background: #e7f5ec;
    color: #0f5132;
    font-size: .68rem;
    font-weight: 700;
  }
  .section-panel, .panel, .stat { padding: .75rem; }
  .section-panel { margin-bottom: .65rem; }
  .list-row { align-items: flex-start; flex-direction: column; gap: .45rem; padding: .7rem .8rem; margin-bottom: .55rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .stat span { font-size: 1.25rem; }
  .badge { font-size: .78rem; line-height: 1.1; }
  .btn { padding: .42rem .7rem; }
  .btn-sm { padding: .3rem .55rem; }
  .action-toolbar, .payment-review-actions { align-items: stretch !important; }
  .action-toolbar .btn, .action-toolbar form, .primary-action-form .btn, .current-action-panel .btn { width: 100%; }
  .current-action-panel { padding: .85rem; }
  .order-sticky-identity {
    top: 52px;
    padding: .4rem 0;
    margin: -.2rem 0 .65rem;
  }
  .order-sticky-identity h1 { font-size: 1.2rem; }
  .order-sticky-identity .small { font-size: .82rem; }
  .order-next-action { padding: .8rem; }
  .order-next-action p { font-size: 1rem; }
  .order-next-action-cta { width: 100%; }
  .community-stats { gap: .25rem; }
  .history-panel summary { padding: .6rem .7rem; }
  .form-control, .form-select { padding: .45rem .65rem; min-height: 2.55rem; }
  .card-body { padding: .8rem; }
  .market-search-row { grid-template-columns: 1fr; }
  .table.orders-table { display: none; }
  .mobile-order-card { display: block; }
  .mobile-order-card .section-panel { padding: .75rem; }
  .mobile-order-card .btn { margin-top: .65rem !important; }
  .product-thumb { height: 125px; padding: .35rem; }
  .product-image { max-height: 260px; padding: .5rem; }
  .cart-thumb { width: 58px; height: 58px; }
  .product-card .card-body { gap: .25rem; }
  .action-card .badge { max-width: 100%; white-space: normal; text-align: left; }
  .action-card-heading { flex-direction: column; gap: .35rem; }
  .stock-update-input { max-width: none; flex: 1 1 7rem; }
  .delivery-row-actions { justify-content: flex-start !important; }
  .order-status-stack { justify-content: flex-start !important; }
  .pilot-note { padding: .65rem; }
  .product-title { font-size: 1rem; line-height: 1.2; }
  .form-section { padding-top: .75rem; margin-top: .75rem; }
  .form-section-title { margin-bottom: .55rem; }
  .form-label { margin-bottom: .3rem; }
  .row.g-3 { --bs-gutter-y: .75rem; }
  .row.g-4 { --bs-gutter-y: 1rem; }
  .timeline { padding: .75rem .75rem .75rem 1.5rem; }
  .location-map { min-height: 260px; }
}
.fulfilment-preference__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.fulfilment-preference__option {
  display: flex;
  gap: 0.65rem;
  min-height: 5rem;
  padding: 0.85rem;
  border: 1px solid var(--border, #d7e0da);
  border-radius: 6px;
  cursor: pointer;
}

.fulfilment-preference__option:has(input:checked) {
  border-color: #168a52;
  box-shadow: 0 0 0 2px rgba(22, 138, 82, 0.15);
}

.fulfilment-preference__option small {
  display: block;
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .fulfilment-preference__grid {
    grid-template-columns: 1fr;
  }
}
.fulfilment-preference-select {
  width: min(100%, 22rem);
}
