/* The sales agents' app: one column, made for a phone at 360 px, readable on a desktop. No inline style anywhere (the
   CSP forbids it). */
:root { --bg: #0a0f17; --card: #121a26; --line: #223047; --text: #e8edf5; --dim: #9aa8bd; --accent: #3fa0ff; --ok: #2fbf71; --bad: #ff6b6b; --warn: #f2b84b; }
/* Khmer script (served from here: the CSP allows fonts from this origin only; fetched only when Khmer text is on the page) */
@font-face { font-family: "Noto Sans Khmer"; font-weight: 400; font-display: swap; src: url(/assets/fonts/NotoSansKhmer-400.woff2) format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C; }
@font-face { font-family: "Noto Sans Khmer"; font-weight: 700; font-display: swap; src: url(/assets/fonts/NotoSansKhmer-700.woff2) format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 "Noto Sans Khmer", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; overflow-x: hidden; }
a { color: var(--accent); }
.booting .boot { padding: 40vh 16px 0; text-align: center; color: var(--dim); }
.top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.top img { width: 28px; height: 28px; }
.top .t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.top .t b { font-size: 15px; }
.top .t small { color: var(--dim); font-size: 12px; }
.top .grow { flex: 1; }
.main { max-width: 720px; margin: 0 auto; padding: 16px 16px 96px; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 18px; margin: 18px 0 8px; }
p { margin: 8px 0; }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 12px 0; }
form { display: flex; flex-direction: column; gap: 12px; }
label.field { display: flex; flex-direction: column; gap: 4px; }
label.field span { font-size: 14px; color: var(--dim); }
label.field small { font-size: 12px; color: var(--dim); }
input, textarea, select { width: 100%; font: inherit; color: var(--text); background: #0d141f; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; }
textarea { min-height: 88px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line); background: #17212f; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04111f; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .6; cursor: default; }
.msg { min-height: 1.2em; font-size: 14px; }
.msg.bad { color: var(--bad); }
.msg.ok { color: var(--ok); }
.links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
.list { display: flex; flex-direction: column; }
.list a.row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.list a.row:last-child { border-bottom: 0; }
.list a.row .d { color: var(--dim); font-size: 13px; white-space: nowrap; }
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--dim); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom a { flex: 1; text-align: center; padding: 12px 4px; color: var(--dim); text-decoration: none; font-size: 14px; }
.bottom a.on { color: var(--text); font-weight: 600; }
.status { border-left: 4px solid var(--warn); }
.status.bad { border-left-color: var(--bad); }
/* the wiki's rendered Markdown (md.js): only these tags occur */
.doc { overflow-wrap: anywhere; }
.doc h2 { font-size: 19px; } .doc h3 { font-size: 17px; } .doc h4, .doc h5, .doc h6 { font-size: 15px; }
.doc table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; font-size: 14px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; text-align: left; }
.doc pre { background: #0d141f; border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto; font-size: 13px; }
.doc code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; }
.doc blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid var(--line); color: var(--dim); }
.doc ul, .doc ol { padding-left: 22px; }
.doc .md-img { color: var(--dim); font-style: italic; }
.doc mark.todo { background: #5a4310; color: #ffe3a6; border-radius: 3px; padding: 0 2px; }
@media (min-width: 900px) { .main { padding-top: 24px; } }

/* ---- stage 2: the list, a business, the map ---- */
.filters { gap: 10px; }
.filters .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filters .btn.on { background: #12304d; border-color: var(--accent); }
input[type=search] { -webkit-appearance: none; appearance: none; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.bizlist { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
a.biz { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--text); text-decoration: none; min-height: 44px; }
a.biz .l1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
a.biz .l1 b { overflow-wrap: anywhere; }
a.biz .l2 { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
a.biz .l2 .d { white-space: nowrap; color: var(--text); }
a.biz .l3 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.filters .msg:empty { display: none; }
a.biz .pill, .sheet .pill { flex: none; white-space: nowrap; }
.pill.p1 { border-color: #ff8a5c; color: #ffb08f; font-weight: 700; }
.pill.p2 { border-color: #f2b84b; color: #f2cf8a; }
.pill.p3 { border-color: var(--line); color: var(--dim); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.btnrow .btn { flex: 1 1 140px; }
.note .pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.mapmode .main { max-width: none; padding: 0; }
.mapwrap { position: relative; height: calc(100vh - 100px - env(safe-area-inset-bottom)); height: calc(100dvh - 100px - env(safe-area-inset-bottom)); min-height: 280px; }
.mapbox { position: absolute; inset: 0; background: #0d141f; }
.mapinfo { position: absolute; left: 58px; right: 60px; top: 8px; z-index: 500; background: rgba(10, 15, 23, .88); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; pointer-events: none; }
.locate { position: absolute; right: 8px; top: 8px; z-index: 500; width: 44px; padding: 0; font-size: 22px; }
.sheet { position: absolute; left: 8px; right: 8px; bottom: 30px; z-index: 600; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.sheet .l1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.sheet .btnrow { margin: 10px 0 0; }
.hide { display: none; }
.leaflet-container { background: #0d141f; font: inherit; }
.leaflet-container a { color: #0b5cad; }
.pinwrap { background: none; border: 0; }
.pin { box-sizing: border-box; width: 100%; height: 100%; border-radius: 50%; border: 2px solid #fff; color: #fff; font: 700 15px/28px system-ui, sans-serif; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.pin.p1 { background: #e5532a; }
.pin.p2 { background: #d99a1d; }
.pin.p3 { background: #6b7a90; }
.pin.sel { outline: 3px solid var(--accent); outline-offset: 2px; }
