:root {
  --navy: #14365d; --blue: #2563a8; --bg: #f4f6f9; --card: #fff; --line: #dde3ea;
  --text: #1c2733; --muted: #64707d; --red: #c0392b; --amber: #b9770e; --green: #1e8449;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
a { color: var(--blue); text-decoration: none; }
h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 20px 0 8px; }
.top { background: var(--navy); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 5; }
.top h1 { flex: 1; }
.top .sync { font-size: .75rem; opacity: .85; }
.top button { background: transparent; color: #fff; border: 1px solid #ffffff55; }
main { max-width: 900px; margin: 0 auto; padding: 12px 16px; }
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
nav.tabs a { flex: 1; text-align: center; padding: 10px 0; font-size: .75rem; color: var(--muted); }
nav.tabs a.on { color: var(--navy); font-weight: 700; border-top: 3px solid var(--navy); margin-top: -1px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 8px 0; display: block; color: inherit; }
a.card:active { background: #eef3f9; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: .85rem; }
.title { font-weight: 600; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; background: #e6edf5; color: var(--navy); margin: 2px 4px 2px 0; white-space: nowrap; }
.chip.red { background: #fbe4e1; color: var(--red); } .chip.amber { background: #fdf0d5; color: var(--amber); }
.chip.green { background: #dff3e6; color: var(--green); } .chip.cds { background: #efe3f7; color: #6c2d91; }
button, .btn { font: inherit; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
button.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
button.danger { color: var(--red); }
button.small { padding: 5px 10px; font-size: .85rem; }
input, select, textarea { font: inherit; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
textarea { min-height: 80px; }
label { display: block; font-size: .8rem; color: var(--muted); margin: 10px 0 3px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 1rem; margin: 10px 0; }
label.check input { width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.search { margin: 4px 0 8px; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.filters button { white-space: nowrap; border-radius: 999px; padding: 5px 12px; font-size: .85rem; }
.filters button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.stage-head { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 4px; display: flex; justify-content: space-between; }
.fab { position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); border-radius: 999px; width: 56px; height: 56px; font-size: 1.8rem; line-height: 1;
  background: var(--navy); color: #fff; border: 0; box-shadow: 0 3px 10px #0004; z-index: 6; padding: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.stat b { font-size: 1.3rem; display: block; }
.timeline .card { margin: 6px 0; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); background: #222; color: #fff;
  padding: 8px 14px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; }
#toast.show { opacity: .95; }
.login { max-width: 380px; margin: 12vh auto; padding: 0 16px; }
.err { color: var(--red); margin: 8px 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl td, .tbl th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
@media (min-width: 800px) { nav.tabs { position: sticky; top: 52px; bottom: auto; border: 0; border-bottom: 1px solid var(--line); } body { padding-bottom: 20px; }
  nav.tabs a { padding: 12px 0; } .fab { bottom: 24px; } }

gmp-place-autocomplete { display: block; width: 100%; color-scheme: light; }
