/* Large text and quiet controls; colour is reserved for status and actions. */
:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.5;
  color: #242424;
  background: #f5f5f5;
  font-synthesis: none;
  --line: #c9c9c9;
  --green: #345446;
  --red: #982c2c;
}
* { box-sizing: border-box; }
body { margin: 0; }
body.camera-open { overflow: hidden; }
.hidden { display: none !important; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #244f84; outline-offset: 3px; }
button { min-height: 60px; border: 1px solid #a8a8a8; border-radius: 5px; padding: 13px 16px; background: #fff; color: #242424; font-size: 20px; line-height: 1.35; }
.primary, .secondary, .danger { width: 100%; display: flex; justify-content: center; align-items: center; text-align: center; text-decoration: none; }
.primary { background: var(--green); border: 1px solid var(--green); color: #fff; font-weight: 600; }
.danger { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
button:active { filter: brightness(.94); }
header { max-width: 688px; margin: auto; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.app-title { font-size: 25px; font-weight: 600; }
.connection { font-size: 16px; text-align: right; line-height: 1.35; }
.connection.offline { color: var(--red); font-weight: 600; }
main { max-width: 688px; margin: auto; padding: 24px 24px calc(112px + env(safe-area-inset-bottom)); }
h1 { font-size: 25px; line-height: 1.3; font-weight: 600; margin: 0 0 24px; overflow-wrap: anywhere; }
h2 { font-size: 23px; line-height: 1.35; margin: 0 0 12px; font-weight: 600; }
p { margin: 0 0 20px; }
.small { font-size: 16px; color: #515151; line-height: 1.5; }
#home { display: grid; gap: 20px; }
.mode-card { background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 24px 20px; }
.mode-card h1 { margin-bottom: 8px; }
.mode-card p { color: #515151; margin-bottom: 24px; }
.mode-card.armed { border-left: 5px solid var(--green); padding-left: 16px; }
.alarm-card { border: 2px solid var(--red); border-radius: 5px; background: #fffafa; padding: 22px 18px; }
.alarm-card h2 { color: var(--red); }
.alarm-card > button + button { margin-top: 12px; }
.alarm-card > .small { margin: 14px 0 0; }
#alarm-description { overflow-wrap: anywhere; }
.notice { padding: 16px; border: 1px solid var(--red); border-radius: 5px; color: #802525; background: #fff; }
nav { position: fixed; z-index: 10; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; padding: 0 8px env(safe-area-inset-bottom); border-top: 1px solid #aaa; background: #fff; }
nav button { flex: 1; max-width: 224px; min-width: 0; border: 0; border-radius: 0; border-top: 4px solid transparent; min-height: 76px; padding: 14px 6px; font-size: 19px; background: #fff; }
nav button.selected { border-top-color: #345446; font-weight: 700; background: #eeeeec; }
.menu-list { display: grid; gap: 14px; }
#native-status { margin-top: 24px; white-space: pre-line; }
.camera-list { display: grid; gap: 14px; }
.camera { width: 100%; min-height: 92px; text-align: left; padding: 18px 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.camera-title { font-size: 21px; font-weight: 600; }
.camera-status { font-size: 17px; color: #515151; }
.camera.offline .camera-status { color: var(--red); }
.event-list { background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.event-row { display: flex; align-items: center; gap: 16px; padding: 20px 16px; border-bottom: 1px solid var(--line); }
.event-row:last-child { border-bottom: 0; }
.event-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.event-info strong { display: block; font-size: 19px; font-weight: 600; }
.event-info small { display: block; font-size: 16px; color: #515151; margin-top: 5px; }
.event-info .alarm { color: var(--red); }
.event-row button { flex-shrink: 0; width: auto; font-size: 17px; padding: 12px; }
.empty { padding: 22px 18px; color: #515151; }
.back-button { min-height: 52px; margin-bottom: 20px; font-size: 18px; }
.pair { max-width: 460px; padding: 32px 24px; margin: auto; }
.pair label { display: block; margin-bottom: 8px; font-size: 19px; }
input:not([type=checkbox]) { width: 100%; display: block; min-height: 58px; border: 1px solid #8b8b8b; border-radius: 4px; background: #fff; padding: 12px; color: #242424; font-size: 20px; margin: 0 0 24px; }
.pair .primary { margin-top: 24px; min-height: 60px; border-radius: 5px; padding: 14px 18px; font-size: 20px; }
.pair p { font-size: 18px; }
.install .small { font-size: 16px; }
.toast { position: fixed; z-index: 40; left: 16px; right: 16px; bottom: calc(94px + env(safe-area-inset-bottom)); max-width: 620px; margin: auto; background: #242424; color: #fff; border-radius: 5px; padding: 16px 20px; font-size: 18px; line-height: 1.45; }
.viewer { position: fixed; inset: 0; z-index: 30; background: #f5f5f5; color: #242424; overflow: auto; padding-bottom: env(safe-area-inset-bottom); }
.viewer-toolbar { display: flex; align-items: center; gap: 18px; padding: 16px; max-width: 960px; margin: auto; }
.viewer-toolbar button { min-height: 54px; font-size: 19px; flex-shrink: 0; }
.viewer-toolbar strong { font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.video-wrap { position: relative; display: flex; align-items: center; justify-content: center; min-height: 220px; background: #161616; }
.video-wrap img { display: block; width: 100%; max-height: 64vh; object-fit: contain; }
#viewer-error { padding: 24px; margin: 0; color: white; font-size: 20px; text-align: center; }
.viewer-settings { padding: 16px 20px 28px; max-width: 680px; margin: auto; }
.switch-label { display: flex; align-items: center; gap: 16px; min-height: 68px; font-size: 20px; cursor: pointer; margin-bottom: 16px; }
.switch-label input { flex-shrink: 0; width: 28px; height: 28px; accent-color: var(--green); margin: 0; }
@media (max-width: 360px) { header { padding: 18px 16px; } main { padding-left: 16px; padding-right: 16px; } .mode-card { padding-left: 16px; padding-right: 16px; } .mode-card.armed { padding-left: 12px; } }
