:root {
  color-scheme: light;
  font: 100% system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17253b;
  background: #eff3f9;
  --ink: #17253b;
  --muted: #50617a;
  --border: #d8e1ed;
  --blue: #244cc5;
  --blue-deep: #193da9;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding: 0 clamp(1rem, 4vw, 3rem) 3rem; }
main { max-width: 69rem; margin-inline: auto; }
.masthead { min-height: 4.75rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: .65rem; font-size: .95rem; font-weight: 750; }
.mark { width: 1.9rem; height: 1.9rem; border-radius: .55rem; background: var(--blue); position: relative; }
.mark::before { content: ""; position: absolute; top: .43rem; left: .7rem; width: .5rem; height: .6rem; border: 2px solid #fff; border-radius: .35rem .35rem 0 0; }
.mark::after { content: ""; position: absolute; top: .87rem; left: .52rem; width: .86rem; height: .55rem; border-radius: .12rem; background: #fff; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3.1rem); line-height: 1.08; letter-spacing: -.055em; }
h2 { font-size: 1.3rem; line-height: 1.2; letter-spacing: -.025em; }
p { color: var(--muted); line-height: 1.55; }
.page-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .9rem 1.2rem; margin: clamp(1.35rem, 4vw, 2.6rem) 0 1.25rem; }
.identity { margin-top: .35rem; font-size: .94rem; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.live-panels { display: grid; gap: 1rem; min-width: 0; }
@media (min-width: 52rem) {
  .dashboard { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 1.4rem; }
  .live-panels { gap: 1.4rem; }
}
button {
  font: inherit;
  font-weight: 700;
  min-height: 3.25rem;
  border-radius: .65rem;
  border: 1px solid transparent;
  padding: .76rem 1.05rem;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible, input:focus-visible { outline: .2rem solid #5777df; outline-offset: .17rem; }
button.primary { color: #fff; background: var(--blue); }
button.primary:hover:enabled { background: var(--blue-deep); }
button.secondary { color: #21375d; background: #fff; border-color: #b8c8dd; }
button.secondary:hover:enabled { background: #e9eff9; }
button:disabled { color: #51617a; background: #e3eaf4; border-color: #d5dfec; cursor: default; }
button.text { color: var(--blue-deep); background: transparent; padding: .5rem .25rem; min-height: 2.75rem; }
button.compact { min-height: 2.75rem; padding: .5rem .85rem; }
.card, .status-panel, .auth-card { border: 1px solid var(--border); border-radius: 1rem; background: #fff; box-shadow: 0 .2rem .75rem #273e6a0b; }
.status-panel { padding: clamp(1rem, 3.5vw, 1.65rem); border-top: .25rem solid #5273db; }
.status-panel[data-state="armed"] { border-top-color: #26795e; }
.status-panel[data-state="arming"], .status-panel[data-state="entry"] { border-top-color: #be7014; }
.status-panel[data-state="sounding"] { border-top-color: #b7283b; }
.status-panel[data-state="unavailable"] { border-top-color: #7a89a0; }
.status-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.status-label { color: var(--muted); font-size: .95rem; font-weight: 650; }
.connection { display: inline-flex; align-items: center; gap: .38rem; padding: .3rem .57rem; border-radius: 1rem; font-size: .875rem; font-weight: 650; color: #465875; background: #edf1f8; }
.connection[data-live="true"] { color: #13563e; background: #e8f5ee; }
.connection::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; }
.status-panel h2 { font-size: clamp(2rem, 8vw, 3.35rem); margin: .75rem 0 .23rem; letter-spacing: -.065em; overflow-wrap: anywhere; }
.status-panel[data-state="sounding"] h2 { color: #9b2334; }
.status-panel[data-state="arming"] h2, .status-panel[data-state="entry"] h2 { color: #7f430b; }
.status-time { margin-top: .45rem; font-size: .875rem; }
.countdown { font-variant-numeric: tabular-nums; display: flex; gap: .5rem; align-items: baseline; margin-top: .6rem; }
.countdown strong { font-size: 2rem; line-height: 1; color: #7f430b; }
.buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-top: 1.2rem; }
.buttons button { min-height: 3.6rem; }
.buttons .disarm-active:enabled { background: var(--blue); border-color: var(--blue); color: #fff; }
.buttons .disarm-active:hover:enabled { background: var(--blue-deep); }
.message { margin: .85rem 0 0; padding: .65rem .78rem; border-radius: .55rem; background: #edf2fe; color: #223e7a; font-size: .94rem; }
.card-heading { padding: 1rem 1.1rem .9rem; display: flex; align-items: start; justify-content: space-between; gap: .6rem; }
.card-heading p { margin-top: .3rem; font-size: .875rem; }
.rows { margin: 0; padding: 0; list-style: none; }
.rows > li { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .75rem 1.1rem; border-top: 1px solid var(--border); }
.row-title { font-weight: 700; overflow-wrap: anywhere; }
.row-detail, .rows time { display: block; font-size: .875rem; color: var(--muted); line-height: 1.4; }
.rows time { text-align: right; font-variant-numeric: tabular-nums; }
.row-detail { margin-top: .2rem; }
.contact { padding: .26rem .6rem; border-radius: 1rem; font-size: .875rem; font-weight: 650; background: #edf1f8; color: #465875; white-space: nowrap; }
.contact[data-state="closed"] { background: #e6f4ed; color: #155840; }
.contact[data-state="open"] { background: #fff1de; color: #794207; }
.activity-note { padding: .2rem 1.1rem 1rem; font-size: .94rem; }
.activity-panel li { align-items: start; }
.auth-card, .owner-panel { max-width: 31rem; margin: clamp(1.75rem, 7vw, 4.75rem) auto 0; padding: clamp(1.25rem, 5vw, 2rem); }
.auth-card > p, .owner-panel > p { margin-top: .7rem; }
.auth-card button { width: 100%; margin-top: 1.05rem; }
.auth-card .auth-note { margin-top: 1rem; font-size: .9rem; }
#auth-feedback { max-width: 31rem; margin-inline: auto; }
.approval-code { display: block; margin: 1rem 0; font: 700 1.75rem ui-monospace, monospace; letter-spacing: .11em; }
.access-form { margin: 1rem 0 1.5rem; }
.access-form, .people form { display: grid; gap: .7rem; }
label { display: block; font-weight: 650; }
input {
  display: block;
  margin-top: .3rem;
  width: 100%;
  min-height: 2.9rem;
  padding: .5rem .65rem;
  border: 1px solid #aabbd2;
  border-radius: .5rem;
  font: inherit;
  color: inherit;
  background: #f8fafd;
}
.people-heading { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.people { list-style: none; padding: 0; margin: 0; }
.people li { border-top: 1px solid var(--border); padding: .8rem 0; }
.people h3 { margin: 0; }
.people p { margin: .3rem 0 .55rem; }
.invite-result { padding: .85rem; margin-bottom: 1.2rem; border: 1px solid var(--border); border-radius: .65rem; background: #f3f6fb; }
.invite-result button, .invite-result p { margin-top: .6rem; }
