/* Rep Route — same look as the Hustle Van business portal (account.hustlevan.com): white paper, dark green, gold, brand red. */
:root {
  color-scheme: light;
  --ink: #17191c;
  --muted: #626970;
  --line: #d9dde1;
  --soft: #f4f6f7;
  --paper: #ffffff;
  --red: #ba1d2c;
  --red-dark: #8f1420;
  --forest: #163d2a;
  --forest-2: #1f6b4f;
  --green-soft: #eaf4ef;
  --gold: #e8c55a;
  --gold-soft: #fbf3d6;
  --amber: #8a5a00;
  --amber-soft: #fff5dc;
  --danger-soft: #fff0f1;
  --blue: #1b5fa8;
  --shadow: 0 12px 30px rgba(25, 28, 31, 0.09);
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  padding-bottom: env(safe-area-inset-bottom);
}
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: -1px; padding: 0; border: 0; white-space: nowrap; }

/* header */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { height: 28px; width: auto; }
.brand span { font-weight: 800; font-size: 0.95rem; color: var(--forest); white-space: nowrap; }
.who { color: var(--muted); font-size: 0.85rem; text-align: right; }
.link-btn { border: 0; background: none; color: var(--forest-2); font-weight: 700; padding: 6px 0; cursor: pointer; }

main { max-width: 640px; margin: 0 auto; padding: 14px 16px 120px; }

/* cards & buttons */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
h1 { font-size: 1.35rem; margin: 4px 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
.sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 800; font-size: 1rem; cursor: pointer; text-decoration: none; touch-action: manipulation;
}
.btn.primary { background: var(--forest); color: #fff; }
.btn.primary:active { background: #0f2c1e; }
.btn.gold { background: var(--gold); color: #1b291f; }
.btn.red { background: var(--red); color: #fff; }
.btn.ghost { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn.small { min-height: 42px; padding: 0 12px; font-size: 0.92rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: wait; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* forms */
label.field { display: grid; gap: 6px; margin-bottom: 12px; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
input[type=text], input[type=password], input[type=tel], input[type=date], input[type=number], textarea, select {
  width: 100%; min-height: 50px; padding: 10px 12px; border: 1px solid #cfd5d1; border-radius: 10px; background: #fff; font-size: 1rem; color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(232, 197, 90, 0.55); border-color: var(--forest-2); }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 12px; }
.seg button { min-height: 42px; border: 0; background: transparent; font-weight: 800; color: #48504a; border-radius: 7px; cursor: pointer; }
.seg button.active { background: var(--forest); color: #fff; }

/* login */
.login { max-width: 420px; margin: 8vh auto 0; }
.login .logo { display: block; width: 240px; max-width: 78%; margin: 6px auto 14px; }
/* V1.2.72 Hustlaz HQ: "CRM can be down at the bottom" */
.login .crm-mark { margin: 18px 0 0; text-align: center; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.3em; color: #5B6B60; }
.login h1 { text-align: center; }
.login .sub { text-align: center; }
.error { color: var(--red-dark); background: var(--danger-soft); border: 1px solid #f1c9cd; padding: 10px 12px; border-radius: 8px; font-size: 0.92rem; margin-bottom: 12px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.stat span { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.stat strong { display: block; font-size: 1.35rem; margin-top: 2px; }
.stat.gold { background: var(--gold-soft); border-color: #ecd99a; }

.route-sum { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); font-size: 0.9rem; margin: 2px 0 12px; }
.route-sum b { color: var(--ink); }
.progress { height: 8px; background: #e7ebe8; border-radius: 99px; overflow: hidden; margin: 6px 0 2px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--forest-2), var(--gold)); border-radius: 99px; }

/* stops */
.stop { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 12px 58px; margin-bottom: 10px; }
.stop .num { position: absolute; left: 14px; top: 14px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); border: 1px solid var(--line); font-weight: 800; font-size: 0.9rem; }
.stop.next { border: 2px solid var(--forest); box-shadow: var(--shadow); }
.stop.next .num { background: var(--forest); color: #fff; border-color: var(--forest); }
.stop.done { background: #fbfcfb; opacity: 0.8; padding-bottom: 12px; }
.stop.done .num { background: var(--green-soft); color: var(--forest-2); border-color: #bfdccc; }
.stop h3 { margin: 0 0 2px; font-size: 1.05rem; line-height: 1.25; }
.stop .addr { color: var(--muted); font-size: 0.9rem; }
.stop .meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.stop .actions { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; }
.stop.done .actions { display: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: 0.76rem; font-weight: 800; background: var(--soft); color: #48504a; border: 1px solid var(--line); }
.badge.checkup { background: var(--gold-soft); border-color: #ecd99a; color: #6b5200; }
.badge.new { background: #eef4fb; border-color: #cddcf0; color: var(--blue); }
.badge.follow { background: var(--green-soft); border-color: #bfdccc; color: var(--forest-2); }
.badge.open { background: var(--green-soft); border-color: #bfdccc; color: var(--forest-2); }
.badge.closed { background: var(--danger-soft); border-color: #f1c9cd; color: var(--red-dark); }
.badge.done { background: var(--forest); border-color: var(--forest); color: #fff; }
.due { font-size: 0.85rem; color: #6b5200; margin-top: 6px; }

/* bottom bar */
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--paper); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.bottombar .inner { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.bottombar .inner .btn { padding-left: 6px; padding-right: 6px; font-size: 0.9rem; }
/* R4.10 all stores by city / borough / county */
.areas details { border-bottom: 1px solid var(--line); }
.areas summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 2px; font-weight: 800; cursor: pointer; }
.areas summary::-webkit-details-marker { display: none; }
.areas summary::after { content: "›"; font-size: 1.3rem; color: var(--muted); transition: transform .15s; }
.areas details[open] summary::after { transform: rotate(90deg); }
.areas summary .n { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 0.88rem; }
.areas .place { padding: 10px 2px; grid-template-columns: 1fr; gap: 6px; }
.areas .place .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.areas .place .acts a { text-decoration: none; }

/* week */
.week { display: grid; gap: 6px; }
.week .day { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 0.92rem; }
.week .day b { white-space: nowrap; }
.week .day small { color: var(--muted); display: block; }

/* sheet (visit / find) */
.sheet-back { position: fixed; inset: 0; background: rgba(20, 24, 22, 0.45); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 94vh; overflow-y: auto; background: var(--paper); border-radius: 16px 16px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,0.2); }
.sheet .grab { width: 44px; height: 5px; border-radius: 99px; background: #d5dad7; margin: 6px auto 10px; }
.sheet .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sheet .close { border: 0; background: var(--soft); width: 40px; height: 40px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; flex: 0 0 auto; }
.here { padding: 10px 12px; border-radius: 8px; font-size: 0.92rem; margin: 10px 0; }
.here.ok { background: var(--green-soft); color: var(--forest-2); border: 1px solid #bfdccc; }
.here.warn { background: var(--amber-soft); color: var(--amber); border: 1px solid #ecd99a; }
.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 12px; }
.outcomes button { min-height: 56px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 800; font-size: 0.95rem; padding: 6px 8px; cursor: pointer; }
.outcomes button.active { background: var(--forest); color: #fff; border-color: var(--forest); }
.outcomes button.good { border-color: #bfdccc; }
.photo-box { display: grid; place-items: center; min-height: 120px; border: 2px dashed #cfd5d1; border-radius: 10px; background: var(--soft); margin-bottom: 12px; overflow: hidden; cursor: pointer; text-align: center; color: var(--muted); font-weight: 700; }
.photo-box img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.photo-grid:empty { display: none; }
.photo-grid .ph { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--soft); }
.photo-grid .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid .ph-x { position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; line-height: 26px; padding: 0; }
.section-label { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 14px 0 6px; }

.products { display: grid; gap: 8px; max-height: 46vh; overflow-y: auto; margin-bottom: 10px; }
.prod { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.prod.picked { border-color: var(--forest-2); background: var(--green-soft); }
.prod .pname { font-weight: 700; font-size: 0.92rem; }
.prod .pprice { color: var(--muted); font-size: 0.8rem; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 1.2rem; font-weight: 800; cursor: pointer; }
.qty span { min-width: 22px; text-align: center; font-weight: 800; }
.pkg { display: flex; gap: 6px; grid-column: 1 / -1; }
.pkg button { flex: 1; min-height: 34px; border-radius: 7px; border: 1px solid var(--line); background: #fff; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.pkg button.active { background: var(--forest); border-color: var(--forest); color: #fff; }

.place { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.place:last-child { border-bottom: 0; }
.place b { display: block; }
.place small { color: var(--muted); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; }
.chips button { flex: 0 0 auto; min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-weight: 700; cursor: pointer; }
.chips button.active { background: var(--forest); color: #fff; border-color: var(--forest); }

.toast { position: fixed; left: 50%; top: calc(70px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; font-weight: 700; font-size: 0.92rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.toast.show { opacity: 1; }
.queue-note { background: var(--amber-soft); color: var(--amber); border: 1px solid #ecd99a; border-radius: 8px; padding: 8px 12px; font-size: 0.88rem; margin-bottom: 10px; }
.empty { text-align: center; color: var(--muted); padding: 20px 8px; }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* admin */
.admin main { max-width: 1100px; }
.admin table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin th, .admin td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.admin .flag { display: inline-block; margin: 0 4px 4px 0; padding: 2px 8px; border-radius: 99px; background: var(--danger-soft); color: var(--red-dark); border: 1px solid #f1c9cd; font-size: 0.75rem; font-weight: 800; }
.admin .ok { color: var(--forest-2); font-weight: 800; font-size: 0.8rem; }
.admin img.thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; }
.admin .table-wrap { overflow-x: auto; }
.admin .rep-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: baseline; }
.admin .kpis { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.admin .kpis span { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 0.85rem; }
.admin .kpis span.bad { background: var(--danger-soft); border-color: #f1c9cd; color: var(--red-dark); font-weight: 800; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: grid; place-items: center; z-index: 80; }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 8px; }
@media (max-width: 380px) { .stop .actions { grid-template-columns: 1fr 1fr; } .stop .actions .btn.primary { grid-column: 1 / -1; } }

/* Melissa */
#melissaPanel { margin-bottom: 12px; position: sticky; top: 0; z-index: 30; }
.mel { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: linear-gradient(135deg, #163d2a, #1f6b4f); color: #fff; box-shadow: var(--shadow); }
.mel-orb { position: relative; flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; border: 0; background: radial-gradient(circle at 35% 30%, #f6dc8a, #e8c55a 55%, #b8932b); cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,0.25); touch-action: manipulation; }
.mel-orb .mel-dot { position: absolute; inset: 18px; border-radius: 50%; background: #163d2a; opacity: 0.9; }
.mel-orb .mel-ring { position: absolute; inset: -6px; border-radius: 50%; border: 3px solid rgba(232, 197, 90, 0.0); }
.mel.on .mel-orb .mel-dot { inset: 20px; border-radius: 4px; }
.mel.on .mel-orb .mel-ring { border-color: rgba(232, 197, 90, 0.7); animation: melpulse 1.8s ease-out infinite; }
.mel.thinking .mel-orb .mel-ring { animation-duration: 0.8s; }
.mel.listen { background: linear-gradient(135deg, #3a2f0b, #6b5200); }
.mel.listen .mel-orb { background: radial-gradient(circle at 35% 30%, #fff, #e9eef0 60%, #b9c3c7); }
@keyframes melpulse { 0% { transform: scale(0.95); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
.mel-text { flex: 1; min-width: 0; }
.mel-name { font-weight: 800; font-size: 1.1rem; display: flex; gap: 8px; align-items: center; }
.mel-status { font-size: 0.9rem; opacity: 0.9; margin-top: 2px; }
.mel-caption { margin-top: 6px; font-size: 0.92rem; background: rgba(255,255,255,0.12); border-radius: 8px; padding: 6px 9px; max-height: 4.4em; overflow: hidden; }
.mel-caption.rep { opacity: 0.8; font-style: italic; }
.mel .btn.ghost { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.3); }
.mel-hint { color: var(--muted); font-size: 0.85rem; margin: 8px 4px 0; }
.mel-card { margin-top: 10px; border-color: #bfdccc; }
.mel-card.order { border: 2px solid var(--gold); }
.mel-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.mel-card .close { border: 0; background: var(--soft); width: 34px; height: 34px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; }
.mel-items { list-style: none; margin: 0 0 8px; padding: 0; }
.mel-items li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.mel-items small { color: var(--muted); }
.mel-total { display: flex; justify-content: space-between; font-size: 1rem; padding: 6px 0; }
.mel-pre { white-space: pre-wrap; font-family: inherit; font-size: 0.92rem; background: var(--soft); border-radius: 8px; padding: 10px; margin: 0 0 10px; max-height: 40vh; overflow: auto; }

/* order card: typed email / name / phone */
.mel-total.sub-line { font-size: 0.9rem; padding: 2px 0; color: var(--muted); }
.mel-field { display: block; font-size: 0.8rem; color: var(--muted); margin: 8px 0 0; }
.mel-field input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card, #fff); color: inherit; box-sizing: border-box; }
.mel-field input.bad { border-color: #c0392b; box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.15); }
.mel-field-row { display: flex; gap: 8px; }
.mel-field-row .mel-field { flex: 1; min-width: 0; }
.ost { list-style: none; margin: 4px 0 10px; padding: 0; }
.ost li { display: flex; gap: 8px; padding: 5px 0; font-size: 0.92rem; line-height: 1.35; }
.ost li span { width: 18px; flex: none; font-weight: 700; text-align: center; }
.ost li.ok span { color: #1f7a3f; }
.ost li.bad span { color: #c0392b; }
.ost li.wait span { color: var(--muted); }
.convo { padding: 8px 10px; border-left: 3px solid var(--line); margin: 6px 0; font-size: 0.92rem; }
.convo.flag { border-left-color: #c98a00; background: rgba(201, 138, 0, 0.07); }
.convo.intel { border-left-color: #1f7a3f; }
.convo summary { cursor: pointer; }

/* R4.14 bottom tabs: Map · Accounts · Route · Calendar · Settings */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--paper); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
.tabbar.hidden { display: none; }
.tabbar button { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font: inherit; font-size: 0.72rem; font-weight: 700; color: var(--muted); cursor: pointer; border-radius: 10px; }
.tabbar button .ti { font-size: 1.25rem; line-height: 1; }
.tabbar button.active { color: var(--forest); background: rgba(29,107,58,0.08); }
main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: 0.72rem; font-weight: 800; color: var(--muted); padding: 4px 0; }
.cal button { aspect-ratio: 1 / 1; border: 1px solid var(--line); background: #fff; border-radius: 10px; font: inherit; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 0; }
.cal button.out { visibility: hidden; }
.cal button.today { border-color: var(--forest); border-width: 2px; }
.cal button.sel { background: var(--forest); color: #fff; }
.cal .dots { display: flex; gap: 2px; height: 6px; }
.cal .dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.acct-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.acct-row small { color: var(--muted); display: block; }
.hv-pin { background: none; border: 0; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
/* V1.2.48 today's stops on the map: numbered navy; done = yellow with a check */
.hv-stop { background: none; border: 0; }
/* V1.2.54 the "make a route" bar on the map after a circle or a drawing */
.pick-bar { position: absolute; left: 8px; right: 8px; bottom: 10px; z-index: 1000; display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; padding: 6px; border-radius: 12px; background: rgba(255,255,255,.95); box-shadow: 0 2px 10px rgba(0,0,0,.25); color: #1b1b1b; }
.pick-bar .btn { margin: 0; }
.move-handle { background: none; border: 0; }
.move-handle span { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #1d6b3a; color: #fff; font-size: 20px; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); touch-action: none; }
.hv-stop span { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #12305a; color: #fff; font: 800 13px/1 system-ui, sans-serif; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.hv-stop span.done { background: #f5c400; color: #1b1b1b; }
/* R4.15 color tags */
.tag { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 0.74rem; font-weight: 800; margin: 3px 4px 0 0; line-height: 1.5; }
.t-cust { background: #efe5fa; color: #5b2a92; } .t-due { background: #fde3e1; color: #a3231c; } .t-samp { background: #fbf1cf; color: #7a5d00; }
.t-never { background: #eceff2; color: #4c5662; } .t-fresh { background: #dff3e6; color: #17693a; } .t-mid { background: #e9f5e3; color: #3f7d34; }
.t-old { background: #fcefd9; color: #8a5a0e; } .t-cold { background: #f9e1dc; color: #8f3324; } .t-route { background: #1d3b2a; color: #fff; }
.t-contact, .t-sells, .t-price, .t-comp, .t-buys, .t-next { background: #eef3ef; color: #1d3b2a; }
/* V1.2 drop-offs */
.badge.drop { background: #eaf2ff; border-color: #bcd3f5; color: #1f4f99; }
.badge.owed { background: #fdeeee; border-color: #f2c4c0; color: #9b2c22; }
.drop-card { border-left: 5px solid #1f4f99; }
.drop-card .place { gap: 8px; }

/* V1.2: Melissa is always one tap away — a compact bar up top (talk) + type to her */
.mel-type { flex: 0 0 auto; }
.mc-log { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 0 10px; }
.mc-msg { max-width: 86%; padding: 9px 12px; border-radius: 14px; font-size: .95rem; white-space: pre-wrap; }
.mc-msg.rep { align-self: flex-end; background: #163d2a; color: #fff; border-bottom-right-radius: 4px; }
.mc-msg.melissa { align-self: flex-start; background: var(--soft, #eef3ef); border-bottom-left-radius: 4px; }
.mc-form { display: flex; gap: 8px; align-items: flex-end; }
.mc-form textarea { flex: 1; padding: 10px; border-radius: 12px; border: 1px solid var(--line, #d9e2dc); font: inherit; resize: none; }

/* ===== V1.2 look (Gizzy 2026-10-04: "bright and fun looking, energy… people remember little buttons, little sections based on
   color"): every section has its own color — Map green, Accounts purple, Route orange, Calendar blue, Settings pink. ===== */
:root { --c-map: #00a86b; --c-acct: #7b3fe4; --c-route: #ff6b00; --c-cal: #1e88e5; --c-set: #e5397a; --accent: var(--c-map); --accent-soft: #e6f7f0; }
body[data-tab="map"] { --accent: var(--c-map); --accent-soft: #e6f7f0; }
body[data-tab="accounts"] { --accent: var(--c-acct); --accent-soft: #f1eafd; }
body[data-tab="route"] { --accent: var(--c-route); --accent-soft: #fff1e6; }
body[data-tab="calendar"] { --accent: var(--c-cal); --accent-soft: #e8f2fd; }
body[data-tab="settings"] { --accent: var(--c-set); --accent-soft: #fdeaf1; }
body { background: linear-gradient(180deg, var(--accent-soft) 0, var(--soft) 220px) no-repeat, var(--soft); }
#app h1 { display: inline-block; position: relative; padding-bottom: 4px; }
#app h1::after { content: ""; position: absolute; left: 0; right: 30%; bottom: 0; height: 4px; border-radius: 4px; background: var(--accent); }
#app h1.sr-only::after { content: none; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.primary:active { background: var(--accent); filter: brightness(.9); }
.seg button.active, .chips button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.card { border-radius: 14px; }
.card h2 { color: var(--ink); }
.stop { border-radius: 14px; }
.stop.next { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
.stop .num { background: var(--accent); color: #fff; border-color: var(--accent); }
.stop.done .num { background: #9aa5b1; border-color: #9aa5b1; }
.tabbar { box-shadow: 0 -6px 18px rgba(0,0,0,.06); }
.tabbar button[data-tab="map"] { --t: var(--c-map); }
.tabbar button[data-tab="accounts"] { --t: var(--c-acct); }
.tabbar button[data-tab="route"] { --t: var(--c-route); }
.tabbar button[data-tab="calendar"] { --t: var(--c-cal); }
.tabbar button[data-tab="settings"] { --t: var(--c-set); }
.tabbar button .ti { width: 38px; height: 30px; display: grid; place-items: center; border-radius: 99px; transition: background .15s; }
.tabbar button.active { color: var(--t); background: none; }
.tabbar button.active .ti { background: var(--t); box-shadow: 0 4px 10px color-mix(in srgb, var(--t) 35%, transparent); }
.drop-card { border-left-color: var(--c-cal); }
/* Melissa: the bar on the home tab; a small pill elsewhere while she's on */
#melissaPanel { position: static; }
#melissaPanel.mini { position: fixed; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 40; margin: 0; max-width: calc(100% - 24px); }
#melissaPanel.mini .mel { padding: 6px 10px 6px 6px; gap: 8px; border-radius: 99px; box-shadow: 0 8px 22px rgba(0,0,0,.25); }
#melissaPanel.mini .mel-orb { width: 40px; height: 40px; }
#melissaPanel.mini .mel-orb .mel-dot { inset: 14px; }
#melissaPanel.mini .mel-caption, #melissaPanel.mini .mel-type, #melissaPanel.mini .mel-name .badge { display: none; }
#melissaPanel.mini .mel-status { font-size: .78rem; max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#melissaPanel.mini .mel-name { font-size: .9rem; }
#melissaPanel.mini #melCards { position: fixed; left: 12px; right: 12px; bottom: calc(136px + env(safe-area-inset-bottom)); max-height: 50vh; overflow-y: auto; }
.drop-card .place { display: flex; flex-direction: column; align-items: stretch; }
.drop-card .place > div:last-child { justify-content: flex-start !important; margin-top: 6px; }
.drop-card .place > div:first-child b { display: block; }
/* V1.2 fix: the map never sits on top of the tab bar (Leaflet's layers stay inside the map) */
.leaflet-container { isolation: isolate; z-index: 0; }
.tabbar { z-index: 1000; }
#melissaPanel.mini { z-index: 1001; }
.toast { z-index: 1100; }
.sheet-back, .sheet { z-index: 1050; }
.lightbox { z-index: 1200; }
/* V1.2.3 sales */
.tag.t-top { background: #fff1e6; color: #b34700; border-color: #ffc89e; }
.tag.t-buy { background: #e6f7f0; color: #0b7a4f; border-color: #a9e2c9; }
.tag.t-slow { background: #fff5dc; color: #8a5a00; border-color: #f0d79a; }
.sales-card { border-left: 5px solid #00a86b; }
.sale-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 4px; }
.sale-tile { background: var(--accent-soft, #eef3ef); border-radius: 12px; padding: 10px; }
.sale-tile small { display: block; color: var(--muted); font-weight: 700; font-size: .75rem; }
.sale-tile b { font-size: 1.25rem; }
/* V1.2.3 order screen */
.order-bar { position: sticky; bottom: 0; background: linear-gradient(to top, var(--paper) 75%, transparent); padding: 12px 0 4px; margin-top: 8px; }
.say-this { background: #fff1e6; border: 1px solid #ffc89e; border-radius: 12px; padding: 10px 12px; font-size: 1rem; }
#melissaPanel.mini { top: auto; }
body:has(#sheetRoot .sheet) #melissaPanel.mini { display: none; }
.pkg button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
/* V1.2.6 walking pairs toggle */
.walk-toggle { display: flex; gap: 10px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; cursor: pointer; }
.walk-toggle input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); flex: 0 0 auto; }
.walk-toggle small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.newday-card { border-left: 5px solid #ff6b00; }
/* V1.2.10 follow-ups, route name, new route */
:root { --c-fu: #e5397a; }
body[data-tab="followups"] { --accent: var(--c-fu); --accent-soft: #fdeaf1; }
body[data-tab="settings"] { --accent: #4b5563; --accent-soft: #eef0f3; }
.tabbar button[data-tab="followups"] { --t: var(--c-fu); position: relative; }
.tab-count { position: absolute; top: 2px; right: 18%; background: #e5397a; color: #fff; border-radius: 99px; font-size: .62rem; padding: 1px 6px; font-weight: 800; }
.tab-count[hidden] { display: none; }
.fu-row { background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--c-fu); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.fu-row small { color: var(--muted); margin-top: 2px; }
.fu-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.fu-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.fu-acts .btn { text-decoration: none; }
.route-name { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; font-weight: 800; font-size: 1.05rem; }
.newroute .chips { flex-wrap: wrap; }
/* V1.2.12 orders & shipping, incomplete routes */
.ship-card{border-left:4px solid #2f6fd6}
.ship-card .place small a{font-weight:700}
.incomplete-card{border-left:4px solid #c0503a;padding:10px;margin:0 0 10px}
.fu-proof.ok{color:#1d8a4b;font-weight:700}.fu-proof.warn{color:#8a5a00}

/* V1.2.33 go-now stores: red, impossible to miss, on every screen */
#hotBar { padding: 8px 12px 0; }
#hotBar.hidden { display: none; }
.hot-card { background: linear-gradient(135deg, #b3121f, #e0312d); color: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; box-shadow: 0 0 0 0 rgba(224, 49, 45, 0.7); animation: hotpulse 1.8s ease-out infinite; }
.hot-title { font-weight: 800; font-size: 1.05rem; letter-spacing: 0.01em; }
.hot-why { margin-top: 2px; font-weight: 600; }
.hot-addr { margin-top: 2px; opacity: 0.92; font-size: 0.92rem; }
.hot-btns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.hot-go { background: #fff; color: #b3121f; border: 0; border-radius: 10px; padding: 9px 12px; font-weight: 800; font: inherit; font-weight: 800; }
.hot-dir { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,0.7); border-radius: 10px; padding: 8px 12px; font-weight: 700; }
.hot-on { background: rgba(255,255,255,0.18); border-radius: 10px; padding: 8px 12px; font-weight: 700; }
.hot-foot { margin-top: 6px; font-size: 0.78rem; opacity: 0.85; }
.badge.hot { background: #e0312d; color: #fff; }
@keyframes hotpulse { 0% { box-shadow: 0 0 0 0 rgba(224, 49, 45, 0.6); } 70% { box-shadow: 0 0 0 12px rgba(224, 49, 45, 0); } 100% { box-shadow: 0 0 0 0 rgba(224, 49, 45, 0); } }
@media (prefers-reduced-motion: reduce) { .hot-card { animation: none; } }

/* V1.2.34 website stores (shelf checks), per-brand shelf buttons, suggested route */
.badge.shelf { background: #fff3cd; border-color: #f0c36d; color: #6b4a00; }
.brands { display: grid; gap: 6px; margin: 4px 0 10px; }
.brand-row { display: grid; grid-template-columns: 92px 1fr 1fr 1fr; gap: 6px; align-items: center; }
.brand-row span { font-weight: 800; font-size: 0.86rem; }
.brand-row button { padding: 9px 4px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 0.8rem; color: var(--ink); }
.brand-row button.active[data-status="on_shelf"] { background: var(--green-soft); border-color: #3c9a62; color: var(--forest-2); }
.brand-row button.active[data-status="out"] { background: #fff3cd; border-color: #e0a100; color: #6b4a00; }
.brand-row button.active[data-status="none"] { background: #fde8e7; border-color: #d9534f; color: #8a1f1b; }
.suggest { border: 2px solid #f0c36d; background: #fffaf0; }
.suggest h2 { margin: 0 0 4px; }
.suggest ol { margin: 8px 0 12px 18px; padding: 0; }
.suggest li { margin: 3px 0; }
.suggest li small { color: #6b6f6c; }
.prio { border: 2px solid #f0c36d; background: #fffaf0; }
.prio label { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
@media (max-width: 380px) { .brand-row { grid-template-columns: 1fr 1fr 1fr; } .brand-row span { grid-column: 1 / -1; } }
.shelf-items { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; padding: 8px; margin: -2px 0 6px; border: 1px solid #bfdccc; border-radius: 10px; background: var(--green-soft); }
.shelf-items .sub { grid-column: 1 / -1; }
.shelf-item { display: flex; gap: 6px; align-items: flex-start; font-size: 0.8rem; line-height: 1.2; }
.shelf-item input { margin-top: 1px; }
.shelf-items[hidden] { display: none; }
/* V1.2.36 recommended routes */
.rec-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px 12px; margin: 8px 0; }
.rec-card.rec-office { border-color: #e0312d; }
.rec-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.rec-preview { font-size: 0.8rem; color: #555; margin: 0 0 8px; }

/* V1.2.61 back-to-my-location button on the map */
.leaflet-bar a.hv-me-btn { font: 700 20px/30px system-ui, sans-serif; color: #2a6df4; text-align: center; }
.leaflet-bar a.hv-me-btn.busy { opacity: .5; }

/* V1.2.80 inventory screen */
.inv-card{margin:0 0 10px}
.inv-table{width:100%;border-collapse:collapse;margin-top:6px}
.inv-table td{padding:7px 2px;border-top:1px solid rgba(127,127,127,.18);font-size:15px}
.inv-table .inv-qty{text-align:right;white-space:nowrap;font-weight:600}
.inv-low td{color:#9a6700}
.inv-neg td{color:#b42318}
