:root {
  --navy: #0b1633; --navy2: #13244d; --sky: #22b5e6; --gold: #f5b82e; --ok: #1f9d55; --bad: #d93c3c;
  --bg: #f3f6fb; --card: #ffffff; --ink: #0e1a3a; --muted: #5a6a82; --line: #dfe6f1;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--navy); color: #fff; }
.brand { font-weight: 800; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.brand small { font-weight: 500; opacity: .7; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 4px rgba(34,181,230,.25); }
button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid var(--line); padding: 10px 14px; background: #fff; color: var(--ink); }
button.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
button.ghost { background: transparent; color: inherit; border-color: rgba(255,255,255,.35); }
.panel button.ghost { color: var(--ink); border-color: var(--line); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
input, select { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
label { display: block; margin: 10px 0; font-weight: 600; font-size: 14px; }
label input, label select { margin-top: 4px; font-weight: 400; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 12px 0; }
.narrow { max-width: 420px; margin: 32px auto; }
.muted { color: var(--muted); } .small { font-size: 14px; } .err { color: var(--bad); min-height: 1.2em; }
h1 { margin: 0 0 6px; font-size: 26px; } h3 { margin: 6px 0 10px; } h4 { margin: 18px 0 8px; }
#map { height: 46vh; min-height: 280px; transition: height .25s ease; }
/* Big map: the map fills the screen, only the tab bar stays below it (tap the button again for the lists) */
#main.bigmap #map { height: calc(100svh - 150px); }
.mapsize a { font-size: 18px; line-height: 30px; font-weight: 700; text-decoration: none; color: #0b1633; }
.plan { padding: 8px 16px; font-size: 14px; background: #fff7e0; border-bottom: 1px solid #f1dfa6; }
.plan.ok { background: #e9f7ef; border-color: #bfe6cf; }
.plan.end { background: #fdecec; border-color: #f3c1c1; }
.tabs { display: flex; overflow-x: auto; gap: 4px; padding: 8px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 500; }
.tabs button { border: 0; background: transparent; white-space: nowrap; color: var(--muted); }
.tabs button.on { background: var(--navy); color: #fff; }
.badge { background: var(--bad); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.panel { padding: 8px 16px 40px; max-width: 760px; margin: 0 auto; }
.kid { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.kid .name { font-weight: 800; font-size: 18px; }
.kid .meta { color: var(--muted); font-size: 14px; }
.pill { display: inline-block; border-radius: 99px; padding: 2px 10px; font-size: 13px; font-weight: 600; background: #eef2f8; }
.pill.ok { background: #e3f5ea; color: #136c3a; } .pill.warn { background: #fff3d6; color: #8a5a00; } .pill.bad { background: #fde3e3; color: #a12121; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 8px 0; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.list li.sos { border-color: var(--bad); background: #fff3f3; }
.list .when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; } .inline input { flex: 1 1 160px; } .inline select { flex: 0 0 110px; }
.code { font: 800 40px/1 ui-monospace, Consolas, monospace; letter-spacing: 8px; text-align: center; padding: 14px; background: var(--bg); border-radius: 12px; }
.qr { display: flex; justify-content: center; padding: 12px; }
.limit { display: grid; grid-template-columns: 1fr 96px 44px; gap: 8px; margin: 6px 0 14px; }
.limit .l-label, .sched .s-label { grid-column: 1 / -1; font-weight: 600; }
.limit button, .sched button { padding: 8px 0; }
.sched { display: grid; grid-template-columns: 1fr 1fr 44px; gap: 8px; margin: 6px 0; }
.days { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 10px; }
.days label { margin: 0; font-weight: 500; display: flex; gap: 3px; align-items: center; }
.days input { width: auto; }
.kid .row { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
.kid .row button { padding: 8px 12px; }
.kid .row button[data-act="remove"] { margin-left: auto; color: var(--muted); }
.ava { margin: 0; cursor: pointer; flex: 0 0 auto; position: relative; }
.ava::after { content: "📷"; position: absolute; right: -4px; bottom: -2px; font-size: 13px; background: #fff; border-radius: 50%; width: 20px; height: 20px; line-height: 20px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.25); }

.brand .mark { width: 28px; height: 28px; border-radius: 7px; display: block; }
