:root {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #eef1f8; --text: #172033; --muted: #5d6880; --line: #d9deea;
  --brand: #009688; --brand-ink: #ffffff; --brand-soft: #dff2ef; --accent: #4caf50; --title: #f44336;
  --ok: #2e7d32; --ok-soft: #e3f4e4; --warn: #a35a00; --warn-soft: #fff0d6; --bad: #c0262d; --bad-soft: #fde3e4;
  --in: #009688; --out: #00796b;
  --radius: 12px; --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 4px 16px rgba(20, 30, 60, .06);
  color-scheme: light;
}
/* white background everywhere (owner, 24 Nov 2026): no dark mode */

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 "IBM Plex Sans Thai", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); padding: .55em 1em; border-radius: 10px; font: inherit; cursor: pointer; text-decoration: none; min-height: 40px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.big { width: 100%; min-height: 56px; font-size: 1.1rem; font-weight: 600; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { min-height: 32px; padding: .3em .7em; font-size: .875rem; }

input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .55em .75em; width: 100%; min-height: 42px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
input[type="checkbox"] { width: auto; min-height: 0; }
label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: .25em; }
.field { margin-bottom: .9rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: .5em; color: var(--text); font-size: 1rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.pill { display: inline-block; padding: .1em .6em; border-radius: 999px; font-size: .8rem; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.in { background: var(--ok-soft); color: var(--in); } .pill.out { background: var(--warn-soft); color: var(--out); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
tr:hover td { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }

.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: .7em 1.1em; border-radius: 10px; z-index: 50; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); color: #fff; }

.modal-back { position: fixed; inset: 0; background: rgba(10, 15, 30, .5); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; z-index: 40; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; width: 100%; max-width: 640px; box-shadow: var(--shadow); }
.modal .actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }

.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; cursor: zoom-in; background: var(--surface-2); border: 1px solid var(--line); }
.photo-big { width: 100%; border-radius: var(--radius); }
.alert { padding: .75rem 1rem; border-radius: 10px; background: var(--warn-soft); color: var(--warn); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.center-page .card { width: 100%; max-width: 420px; }
.brand-mark { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.2rem; }
.brand-mark svg { width: 28px; height: 28px; }

/* maps */
.map { height: 260px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); z-index: 0; }
.map.tall { height: 42vh; min-height: 260px; }
.map-pin span { display: block; width: 26px; height: 26px; margin: 2px; background: #e0482f; border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.leaflet-container { font: inherit; }
.photo-pick { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .3rem; aspect-ratio: 4 / 3; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); cursor: pointer; overflow: hidden; background: var(--surface-2); }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; }

/* teal header bar + red section titles (TimeMint-like colours) */
.section-title { color: var(--title); font-weight: 600; font-size: .95rem; margin: 1rem 0 .5rem; }
