/* Patrol Companion. Code 9 Security brand: navy #191D3A (Pantone 282 C), accent #FFE900 (Pantone 803 C). */
:root {
  --navy: #191D3A;
  --navy-2: #252a52;
  --navy-3: #343a6b;
  --accent: #FFE900;
  --text: #ffffff;
  --muted: #b9bdd6;
  --ok: #2fbf71;
  --warn: #ffb020;
  --danger: #e5383b;
  --radius: 14px;
  --tap: 56px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--navy); color: var(--text); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px; line-height: 1.45;
  padding-bottom: calc(150px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.centre { display: grid; place-items: center; min-height: 80vh; padding: 16px; text-align: center; }

.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--navy); border-bottom: 1px solid var(--navy-3);
}
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand img { height: 28px; }
.wordmark { font-weight: 700; letter-spacing: .02em; }
.product { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.net { font-size: .8rem; color: var(--muted); }
.net.offline { color: var(--warn); font-weight: 600; }

main { padding: 16px; max-width: 640px; margin: 0 auto; outline: none; }

.card { background: var(--navy-2); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: 12px; border: 0;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  background: var(--navy-3); color: var(--text);
}
button:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.primary { background: var(--accent); color: var(--navy); }
.ghost { background: transparent; border: 1px solid var(--navy-3); }
.danger { background: var(--danger); color: #fff; }
.block { width: 100%; }
button[disabled] { opacity: .5; cursor: not-allowed; }

.states { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.states button { min-height: 72px; flex-direction: column; gap: 2px; }
.states button .code { font-size: .8rem; color: var(--muted); }
.states button.current { background: var(--accent); color: var(--navy); }
.states button.current .code { color: var(--navy); }

.status-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--navy-3); font-size: .85rem; }
.status-pill.s9 { background: var(--danger); }
.status-pill.s6 { background: var(--ok); color: var(--navy); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--navy-3); }
.list li:last-child { border-bottom: 0; }
.list button { width: 100%; justify-content: space-between; background: transparent; border-radius: 0; padding: 0 4px; text-align: left; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--navy);
  border: 1px solid var(--navy-3); border-radius: 10px; padding: 12px;
}
textarea { min-height: 140px; resize: vertical; }

.check { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--navy-3); }
.seg { display: inline-flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--navy-3); }
.seg button { border-radius: 0; min-height: 44px; padding: 0 12px; background: transparent; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--navy); }

.banner {
  position: sticky; top: 56px; z-index: 4; margin: 0; padding: 14px 16px;
  background: var(--accent); color: var(--navy); font-weight: 600;
}
.banner .row { margin-top: 10px; }
.banner button { background: var(--navy); color: #fff; min-height: 48px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--navy); border-top: 1px solid var(--navy-3);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button { background: transparent; border-radius: 0; min-height: 60px; font-weight: 500; }
.tabs button[aria-current="page"] { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }

.sos {
  position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 7;
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--danger); color: #fff; font-size: .7rem; line-height: 1.1; text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  background-image: conic-gradient(rgba(255,255,255,.35) var(--p, 0%), transparent 0);
}
.sos span { max-width: 60px; }

.notice { border-left: 4px solid var(--accent); padding: 10px 12px; background: var(--navy-3); border-radius: 8px; }
.alert-sev1 { border-left: 6px solid var(--danger); }
.alert-sev2 { border-left: 6px solid var(--warn); }
.alert-sev3 { border-left: 6px solid var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

@media (min-width: 720px) {
  .states { grid-template-columns: repeat(4, 1fr); }
}
.prewrap { white-space: pre-wrap; }
.list li.unit { padding: 10px 4px; }
