:root {
	--pri: #1d4ed8; --pri-d: #1e40af; --acc: #f97316; --bg: #f4f6fb; --card: #fff; --txt: #1f2937; --mut: #6b7280;
	--line: #e5e7eb; --ok: #16a34a; --bad: #dc2626; --warn: #f59e0b; --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--txt); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--pri); }
.boot { display: grid; place-items: center; height: 100vh; font-size: 18px; color: var(--mut); }

/* Auth */
.auth { max-width: 460px; margin: 0 auto; padding: calc(32px + env(safe-area-inset-top)) 20px 32px; }
.auth .brand { text-align: center; margin-bottom: 24px; }
.auth .brand img { width: 64px; height: 64px; border-radius: 16px; }
.auth h1 { font-size: 22px; margin: 10px 0 4px; }
.auth p.sub { color: var(--mut); margin: 0; }
.card { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); border: 1px solid var(--line); }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field label small { font-weight: 400; color: var(--mut); }
.field input, .field select, .field textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.field input[type=file] { padding: 9px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--pri); border-color: transparent; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-weight: 600; cursor: pointer; margin: 0; }
.checks input { width: 18px; height: 18px; accent-color: var(--pri); }
.switch-link { text-align: center; margin-top: 16px; color: var(--mut); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 12px 16px; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--line); color: var(--txt); }
.btn.pri { background: var(--pri); color: #fff; }
.btn.pri:active { background: var(--pri-d); }
.btn.acc { background: var(--acc); color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--bad); padding: 8px; font-weight: 600; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.row { display: flex; gap: 8px; }
.row > .btn { flex: 1; }

/* Shell */
.top { position: sticky; top: 0; z-index: 10; background: var(--pri); color: #fff; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; display: flex; align-items: center; gap: 12px; }
.top .who { flex: 1; min-width: 0; }
.top .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .who small { opacity: .85; }
.toggle { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.15); padding: 6px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; cursor: pointer; border: 0; color: #fff; }
.toggle i { width: 36px; height: 20px; border-radius: 999px; background: rgba(255,255,255,.35); position: relative; transition: .2s; }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle.on i { background: #22c55e; }
.toggle.on i::after { left: 18px; }
main { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; border: 0; background: none; padding: 10px 4px 12px; font-size: 12px; font-weight: 600; color: var(--mut); cursor: pointer; position: relative; }
.tabs button span { display: block; font-size: 20px; line-height: 1.2; }
.tabs button.cur { color: var(--pri); }
.tabs .badge { position: absolute; top: 4px; left: 50%; margin-left: 8px; background: var(--acc); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; line-height: 18px; font-style: normal; }

/* Banners */
.banner { border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; font-weight: 600; }
.banner.warn { background: #fef3c7; color: #92400e; }
.banner.off { background: #e5e7eb; color: #374151; }
.banner.bad { background: #fee2e2; color: #991b1b; }

/* Lead cards */
.empty { text-align: center; color: var(--mut); padding: 48px 16px; }
.empty span { font-size: 40px; display: block; margin-bottom: 8px; }
.lead { margin-bottom: 12px; }
.lead.new { border: 2px solid var(--acc); }
.lead .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.lead .head b { font-size: 17px; }
.lead .earn { font-size: 16px; font-weight: 800; color: var(--ok); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--line); }
.chip.online { background: #dbeafe; color: #1e40af; }
.chip.home { background: #dcfce7; color: #166534; }
.prio-note { background: #fffbeb; border: 1px solid #f59e0b; color: #78350f; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.paid-note { background: #f0fdf4; border: 1px solid #86efac; color: #14532d; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; }
.link-note { color: var(--mut); font-size: 13px; margin-bottom: 10px; }
.chip.ai { background: #f3e8ff; color: #6b21a8; }
.chip.paid { background: #dcfce7; color: #166534; }
.chip.unpaid { background: #fef3c7; color: #92400e; }
.lead.ai-lead { border-color: #c084fc; }
.ai-note { background: #faf5ff; border: 1px dashed #c084fc; color: #581c87; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.chip.time { background: #ffedd5; color: #9a3412; }
.chip.st { background: color-mix(in srgb, var(--pri) 15%, transparent); color: var(--pri); }
.issue { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; white-space: pre-wrap; }
.cust { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.cust b { display: block; }
.cust .addr { color: var(--mut); font-size: 14px; }
.acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.acts.two-col { grid-template-columns: repeat(2, 1fr); }
.acts .btn { padding: 10px 6px; font-size: 13px; }
.meta { color: var(--mut); font-size: 13px; }
.center { text-align: center; }
.notes { font-size: 14px; white-space: pre-wrap; border-left: 3px solid var(--pri); padding-left: 10px; margin-top: 8px; }

/* Profile */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { text-align: center; padding: 12px 6px; }
.stat b { display: block; font-size: 20px; }
.stat small { color: var(--mut); }
#pfv-map { height: 240px; border-radius: 10px; margin-bottom: 8px; z-index: 0; }
h3.sec { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); margin: 18px 4px 8px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal .sheet { background: var(--card); width: 100%; max-width: 640px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; }
.modal h2 { margin: 0 0 12px; font-size: 18px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 50; max-width: 90vw; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: s .7s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }

/* =========================================================
   PetoFast light skin — matches the PetoFast website
   (always light; dark mode removed for a consistent look)
   ========================================================= */
:root { color-scheme: light; --bg: #fff8ee; --card: #fff; --txt: #2b2118; --mut: #7a6a5c; --line: #f0e2cf; --r: 18px; --ok: #16a34a; --bad: #dc2626; --warn: #f59e0b; }
body { font: 15px/1.5 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: radial-gradient(120% 50% at 50% 0%, #ffefdc 0%, var(--bg) 70%) fixed; color: var(--txt); }
h1, h2, .top .who b, .lead .head b, .order .head b, .stat b, .auth h1 { font-family: "Baloo 2", "Nunito", system-ui, sans-serif; letter-spacing: -.005em; }
.auth h1 { font-size: 26px; }
.auth .brand img { border-radius: 20px; box-shadow: 0 8px 20px rgba(255, 122, 26, .2); }
.card { border-radius: var(--r); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(120, 60, 0, .06); }
.field label { font-weight: 800; }
.field input, .field select, .field textarea { border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--pri); }
.btn { border-radius: 999px; font-weight: 800; }
.btn.ghost { background: #fff; border: 2px solid var(--line); color: var(--txt); }
.btn.pri, .btn.acc { box-shadow: 0 6px 16px color-mix(in srgb, var(--pri) 30%, transparent); }

/* Header: light bar */
.top { background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.3) blur(10px); -webkit-backdrop-filter: saturate(1.3) blur(10px); color: var(--txt); border-bottom: 1px solid var(--line); }
.top .who b { font-size: 19px; }
.top .who small { color: var(--mut); opacity: 1; font-weight: 700; }
.toggle { background: var(--bg); color: var(--txt); border: 2px solid var(--line); }
.toggle i { background: #e6d6c2; }
.toggle.on { background: #f0fdf4; border-color: #86efac; color: #166534; }
.toggle.on i { background: #22c55e; }

/* Bottom tabs */
.tabs { background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(120, 60, 0, .06); }
.tabs button { font-weight: 800; }
.tabs button.cur::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 4px 4px; background: var(--pri); }

/* Banners, chips, sections */
.banner { border-radius: 16px; }
.banner.warn { background: #fff4d6; color: #8a5a00; }
.banner.off { background: #f3ece3; color: #5c4b3b; }
.banner.bad { background: #ffe4e6; color: #9f1239; }
.chip { background: #f3ece3; color: var(--txt); }
.chip.time { background: #ffedd5; color: #9a3412; }
h3.sec { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 800; color: var(--mut); }
.stat b { font-size: 26px; color: var(--pri); }
.cust, .issue { background: var(--bg); border: 1px solid var(--line); }
.modal .sheet, .sheet { border-radius: 24px 24px 0 0; }
.toast { background: var(--txt); border-radius: 999px; }
.empty span { filter: saturate(1.2); }
@media (min-width: 600px) { .modal .sheet, .sheet { border-radius: 24px; } }

/* Vet panel accents: PetoFast teal (medical) with orange highlights */
:root { --pri: #0f8a7e; --pri-d: #0b6e65; --acc: #ff7a1a; }
.chip.online { background: #dff6f2; color: #0f766e; }
.chip.home { background: #fff1df; color: #c2410c; }
.lead.new { border-color: #ffb27a; box-shadow: 0 8px 22px rgba(255, 122, 26, .14); }
.prio-note { border-radius: 14px; }
.paid-note { border-radius: 14px; }

/* Mobile overflow fixes: nothing may be wider than the screen */
@supports (overflow: clip) { html, body { overflow-x: clip; } }
main { overflow-wrap: anywhere; }
img, iframe, svg, canvas { max-width: 100%; }
.row { flex-wrap: wrap; }
.row > .btn, .row > a.btn { min-width: 0; }
.acts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.acts.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.acts .btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat small { display: block; overflow-wrap: normal; }
.top { min-width: 0; }
.top .who { min-width: 0; }
.tabs { width: 100%; max-width: 100vw; left: 0; right: 0; }
.tabs button { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { min-width: 0; }
.chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field input, .field select, .field textarea { max-width: 100%; min-width: 0; }
.leaflet-container { max-width: 100%; }

/* Site logo (wide) on login / join screens */
img.site-logo, .auth .brand img.site-logo, .lp-hero img.lp-logo.site-logo { width: auto !important; height: 56px !important; max-width: 220px; object-fit: contain; border-radius: 0 !important; box-shadow: none !important; background: none !important; display: block; margin: 0 auto 12px; }
