/* Kenson Farms UX enhancements */
.kf-breadcrumbs { padding-top: .75rem; padding-bottom: 0; font-size: .82rem; }
.kf-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.kf-breadcrumbs li:not(:last-child)::after { content: "›"; margin-left: .35rem; opacity: .5; }
.kf-breadcrumbs a { color: var(--kf-harvest, #c9a227); text-decoration: none; }

.kf-toast-wrap { position: fixed; left: 50%; bottom: calc(5rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9999; display: grid; gap: .5rem; width: min(22rem, 92vw); pointer-events: none; }
.kf-toast { background: var(--kf-ink, #10241a); color: #fff; padding: .75rem 1rem; border-radius: .75rem; font-size: .88rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: kf-toast-in .25s ease; pointer-events: auto; }
.kf-toast.is-error { background: #b71c1c; }
.kf-toast.is-ok { background: #2d6a4f; }
@keyframes kf-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.kf-btn.is-loading { opacity: .75; pointer-events: none; position: relative; }
.kf-btn.is-loading::after { content: ""; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; margin-left: .5rem; vertical-align: middle; animation: kf-spin .6s linear infinite; }
@keyframes kf-spin { to { transform: rotate(360deg); } }

.kf-skeleton { background: linear-gradient(90deg, color-mix(in srgb, var(--kf-border) 40%, transparent), color-mix(in srgb, var(--kf-border) 70%, transparent), color-mix(in srgb, var(--kf-border) 40%, transparent)); background-size: 200% 100%; animation: kf-shimmer 1.2s infinite; border-radius: .5rem; min-height: 1rem; }
@keyframes kf-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.kf-how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.kf-how-step { text-align: center; padding: 1.15rem 1rem; border-radius: var(--kf-radius-lg, 1.2rem); background: color-mix(in srgb, var(--kf-panel) 90%, transparent); border: 1px solid var(--kf-border); transition: transform .2s var(--kf-ease, ease), border-color .2s ease; }
.kf-how-step:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--kf-harvest) 35%, var(--kf-border)); }
.kf-how-num { display: inline-flex; width: 2.25rem; height: 2.25rem; align-items: center; justify-content: center; border-radius: 999px; background: linear-gradient(165deg, var(--kf-harvest-soft, #e6c45a), var(--kf-harvest, #c99612)); color: #10241a; font-weight: 700; margin-bottom: .5rem; box-shadow: 0 8px 18px -10px rgba(201,150,18,.7); }

.kf-social-proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 1rem; padding: 1.35rem 1.25rem; margin-top: 1rem; text-align: center; border-radius: var(--kf-radius-xl, 1.45rem); background: linear-gradient(160deg, color-mix(in srgb, var(--kf-leaf, #2a684c) 8%, transparent), var(--kf-panel)); border: 1px solid var(--kf-border); }
.kf-social-stat strong { display: block; font-size: 1.2rem; font-family: Fraunces, Georgia, serif; color: var(--kf-leaf, #2a684c); }

.kf-path-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 1rem 0; }
.kf-path-card { display: grid; gap: .35rem; padding: 1.25rem; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.kf-path-card:hover { transform: translateY(-2px); box-shadow: var(--kf-shadow); }
.kf-path-icon { font-size: 1.75rem; }

.kf-status-stepper { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.kf-status-step { display: flex; align-items: center; gap: .35rem; font-size: .75rem; opacity: .45; }
.kf-status-step.is-done, .kf-status-step.is-current { opacity: 1; }
.kf-status-step.is-current .kf-status-dot { background: var(--kf-harvest); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kf-harvest) 30%, transparent); }
.kf-status-dot { width: .55rem; height: .55rem; border-radius: 999px; background: var(--kf-border); flex-shrink: 0; }
.kf-status-step.is-done .kf-status-dot { background: #2d6a4f; }

.kf-book-stepper { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.kf-book-step { flex: 1; text-align: center; padding: .5rem; border-radius: .5rem; font-size: .78rem; background: color-mix(in srgb, var(--kf-border) 30%, transparent); }
.kf-book-step.is-active { background: color-mix(in srgb, var(--kf-harvest) 20%, transparent); font-weight: 600; }
.kf-book-panel[hidden] { display: none !important; }

.kf-map-legend { display: flex; flex-wrap: wrap; gap: .75rem; padding: .5rem .85rem; font-size: .78rem; border-top: 1px solid var(--kf-border); }
.kf-map-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.kf-map-legend i { width: .65rem; height: .65rem; border-radius: 999px; display: inline-block; }
.kf-map-legend .pickup { background: #2d6a4f; }
.kf-map-legend .stop { background: #c9a227; }
.kf-map-legend .dest { background: #b71c1c; }

.kf-qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--kf-border); border-radius: .5rem; overflow: hidden; }
.kf-qty-stepper button { border: 0; background: transparent; padding: .45rem .65rem; cursor: pointer; font-size: 1.1rem; line-height: 1; min-width: var(--kf-touch, 2.75rem); }
.kf-qty-stepper input { width: 2.5rem; text-align: center; border: 0; border-left: 1px solid var(--kf-border); border-right: 1px solid var(--kf-border); padding: .35rem; background: transparent; }

.kf-sticky-checkout { position: fixed; left: 0; right: 0; bottom: calc(4.5rem + env(safe-area-inset-bottom)); z-index: 40; background: var(--kf-panel); border-top: 1px solid var(--kf-border); padding: .75rem 1rem; display: none; box-shadow: 0 -8px 24px rgba(0,0,0,.08); }
body.kf-logged-in-app-page .kf-sticky-checkout { bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
.kf-sticky-checkout.is-visible { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.kf-notify-wrap { position: relative; }
.kf-notify-badge { position: absolute; top: -2px; right: -2px; background: #b71c1c; color: #fff; font-size: .65rem; min-width: 1.1rem; height: 1.1rem; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.kf-notify-panel { position: absolute; right: 0; top: calc(100% + .5rem); width: min(18rem, 90vw); background: var(--kf-panel); border: 1px solid var(--kf-border); border-radius: .75rem; padding: .85rem; box-shadow: var(--kf-shadow); z-index: 50; }
.kf-notify-list { list-style: none; margin: 0; padding: 0; max-height: 14rem; overflow-y: auto; }
.kf-notify-item { padding: .55rem 0; border-bottom: 1px solid var(--kf-border); font-size: .82rem; }
.kf-notify-item.is-read { opacity: .55; }
.kf-notify-item a { color: inherit; text-decoration: none; display: grid; gap: .15rem; }

.kf-header-search { position: relative; max-width: 11rem; }
.kf-header-search input { width: 100%; padding: .4rem .65rem; border-radius: 999px; border: 1px solid var(--kf-border); font-size: .82rem; background: var(--kf-paper); }
.kf-search-results { position: absolute; top: 100%; left: 0; right: 0; background: var(--kf-panel); border: 1px solid var(--kf-border); border-radius: .75rem; margin-top: .25rem; list-style: none; padding: .25rem 0; z-index: 60; max-height: 12rem; overflow-y: auto; }
.kf-search-results a { display: block; padding: .45rem .75rem; font-size: .82rem; color: inherit; text-decoration: none; }
.kf-search-results a:hover { background: color-mix(in srgb, var(--kf-harvest) 12%, transparent); }
.kf-search-results .kf-search-empty { padding: .45rem .75rem; font-size: .82rem; color: var(--kf-muted); }

.kf-fleet-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.kf-fleet-table th, .kf-fleet-table td { padding: .65rem .75rem; text-align: left; border-bottom: 1px solid var(--kf-border); }
.kf-table-wrap { overflow-x: auto; margin-top: 1rem; }

.kf-vehicle-rec { background: color-mix(in srgb, #2d6a4f 12%, transparent); border: 1px solid color-mix(in srgb, #2d6a4f 35%, transparent); border-radius: .75rem; padding: .65rem .85rem; font-size: .85rem; margin: .75rem 0; }
.kf-vehicle-rec.is-warn { background: color-mix(in srgb, #b71c1c 10%, transparent); border-color: color-mix(in srgb, #b71c1c 30%, transparent); }

.kf-profile-meter { height: .4rem; background: var(--kf-border); border-radius: 999px; overflow: hidden; margin: .5rem 0; }
.kf-profile-meter span { display: block; height: 100%; background: var(--kf-harvest); transition: width .3s; }

.kf-empty-illus { text-align: center; padding: 2rem 1rem; }
.kf-empty-illus .kf-empty-icon { font-size: 2.5rem; margin-bottom: .5rem; opacity: .7; }

.kf-otp-reveal button { font: inherit; cursor: pointer; background: none; border: 0; color: var(--kf-harvest); font-weight: 600; }
.kf-otp-hidden { filter: blur(4px); user-select: none; }

.kf-control-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.kf-control-filters button { border: 1px solid var(--kf-border); background: transparent; border-radius: 999px; padding: .35rem .85rem; font-size: .82rem; cursor: pointer; }
.kf-control-filters button.is-active { background: var(--kf-harvest); border-color: var(--kf-harvest); color: #10241a; font-weight: 600; }

.kf-control-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
  margin: 1.1rem 0 1rem;
}
.kf-control-stat {
  background: var(--kf-panel, #fff);
  border: 1px solid var(--kf-border);
  border-radius: .85rem;
  padding: .75rem .85rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.kf-control-stat-n {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--kf-ink, #10241a);
}
.kf-control-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin-bottom: .85rem;
}
.kf-control-search-wrap { flex: 1 1 14rem; min-width: 12rem; }
.kf-control-riders {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0 0 1rem;
}
.kf-control-rider {
  border: 1px solid var(--kf-border);
  background: transparent;
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.kf-control-rider.is-active {
  background: color-mix(in srgb, var(--kf-forest, #2a684c) 12%, transparent);
  border-color: var(--kf-forest, #2a684c);
  font-weight: 600;
}
.kf-on-duty-bar label { width: 100%; }
.kf-control-badge {
  display: inline-flex;
  min-width: 1.15rem;
  justify-content: center;
  padding: 0 .3rem;
  border-radius: 999px;
  font-size: .72rem;
  background: color-mix(in srgb, var(--kf-harvest, #c99612) 30%, transparent);
}
.kf-control-head-chips { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.kf-live-chip.is-fresh { background: color-mix(in srgb, #2d6a4f 18%, transparent); }
.kf-live-chip.is-stale { background: color-mix(in srgb, #b71c1c 12%, transparent); }
.kf-control-create-dispatch summary { list-style: none; }
.kf-control-create-dispatch summary::-webkit-details-marker { display: none; }

@media (max-width: 640px) {
  .kf-control-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.kf-batch-card { margin-bottom: .75rem; }
.kf-batch-stops { padding: .5rem 0 0 1rem; font-size: .85rem; }
.kf-batch-stops li { margin: .25rem 0; }

.kf-sticky-book-bar { position: sticky; top: 0; z-index: 5; background: var(--kf-paper); padding: .5rem 0; margin-bottom: .75rem; border-bottom: 1px solid var(--kf-border); }

.kf-onboard-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(8,21,15,.75); display: flex; align-items: flex-end; justify-content: center; padding: 1rem; }
.kf-onboard-card { background: var(--kf-panel); border-radius: 1rem 1rem 0 0; padding: 1.5rem; width: min(24rem, 100%); max-height: 80svh; overflow-y: auto; }
.kf-onboard-dots { display: flex; gap: .35rem; justify-content: center; margin-top: 1rem; }
.kf-onboard-dots span { width: .45rem; height: .45rem; border-radius: 999px; background: var(--kf-border); }
.kf-onboard-dots span.is-active { background: var(--kf-harvest); }

.kf-reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.kf-reveal.is-visible { opacity: 1; transform: none; }

.kf-field-error { color: #b71c1c; font-size: .78rem; margin-top: .25rem; }
.kf-input.is-invalid { border-color: #b71c1c; }

.kf-saved-addr { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.kf-saved-addr button { border: 1px solid var(--kf-border); background: transparent; border-radius: 999px; padding: .35rem .75rem; font-size: .8rem; cursor: pointer; }

.kf-share-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }

body.kf-hide-site-wa .kf-site-wa { display: none !important; }
body.kf-hide-site-wa { padding-bottom: 0 !important; }
body.kf-logged-in-app-page { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)) !important; }

.kf-map-actions { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 .85rem .65rem; }
.kf-map-actions .kf-btn { font-size: .78rem; padding: .35rem .65rem; }

.kf-edu-card { display: grid; gap: .5rem; }
.kf-edu-card .kf-edu-meta { font-size: .78rem; display: flex; gap: .5rem; flex-wrap: wrap; }

@media (max-width: 640px) {
  .kf-site-header .kf-header-actions > .kf-header-search { display: none; }
  .kf-book-grid { display: flex; flex-direction: column; }
  .kf-book-grid .kf-delivery-map { order: -1; }
}

/* Riders */
.kf-rider-avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; background: #e8efe9; box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0,0,0,.12); }
.kf-rider-avatar-initials { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2d6a4f, #1b4332); color: #fff; font-weight: 700; letter-spacing: .02em; }
.kf-plate { display: inline-block; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .08em; font-size: .85rem; padding: .2rem .55rem; border-radius: .35rem; background: #fdf6dc; color: #111; border: 2px solid #111; }
.kf-riders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.kf-rider-public-card { text-align: center; display: flex; flex-direction: column; align-items: center; }
.kf-rider-public-photo { position: relative; display: inline-block; }
.kf-rider-online { position: absolute; bottom: -.35rem; left: 50%; transform: translateX(-50%); background: #2d6a4f; color: #fff; font-size: .7rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; white-space: nowrap; }
.kf-rider-admin-row > summary::-webkit-details-marker { display: none; }
.kf-rider-add > summary::-webkit-details-marker { display: none; }
.kf-rider-actions { border: 2px solid color-mix(in srgb, #2d6a4f 40%, transparent); }
.kf-btn-block { display: flex; width: 100%; justify-content: center; }
.kf-rider-next { font-size: 1.05rem; padding: .95rem 1rem; }
.kf-chip-warn { background: color-mix(in srgb, #c99612 20%, transparent); }
.kf-chip-danger { background: color-mix(in srgb, #b42318 15%, transparent); color: #b42318; font-weight: 600; }
html.kf-dark .kf-chip-danger { color: #ff8a80; }
.kf-live-status { margin: .6rem 0 0; font-size: .88rem; display: flex; align-items: center; gap: .45rem; }
.kf-live-status::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: #9aa5a0; flex: none; }
.kf-live-status.is-live::before { background: #2d9d5f; box-shadow: 0 0 0 0 rgba(45,157,95,.6); animation: kf-pulse 1.8s infinite; }
.kf-live-status.is-stale::before { background: #c99612; }
.kf-live-status.is-ended::before { background: #2d6a4f; }
@keyframes kf-pulse { 0% { box-shadow: 0 0 0 0 rgba(45,157,95,.55); } 70% { box-shadow: 0 0 0 .55rem rgba(45,157,95,0); } 100% { box-shadow: 0 0 0 0 rgba(45,157,95,0); } }
.kf-delivery-map-view .leaflet-container, .kf-delivery-map .leaflet-container { font: inherit; }
.leaflet-container { z-index: 0; }

@media (prefers-reduced-motion: reduce) {
  .kf-reveal, .kf-toast { animation: none; transition: none; }
  .kf-live-status.is-live::before { animation: none; }
}
