:root {
  --bg: #0B1108;
  --panel: #131B0F;
  --panel-2: #1B2516;
  --border: #2B3726;
  --text: #EFE8D2;
  --muted: #9DA58E;
  --accent: #E5D8AE;
  --good: #9FBF7C;
  --warn: #D8A33E;
  --bad: #D2573F;
}

/* The kitchen Command Center loads pages with ?embed=1 and every kiosk page
   adds body.embed before it paints. Those light-on-gradient layouts were tuned
   against the original slate palette, so the kiosk keeps it; the Meadow palette
   above is for phones and laptops. */
html.embed { color-scheme: light; }
body.embed {
  --bg: #0d1117; --panel: #161b22; --panel-2: #1c2330; --border: #2b3442;
  --text: #e6edf3; --muted: #8b98a8; --accent: #4da3ff;
  --good: #3fb950; --warn: #d29922; --bad: #f85149;
}

/* Every form control is dark by default. Forms that style their own inputs
   still win (their selectors are more specific); this catches the ones that
   never got a rule and were showing up as white iOS/Android boxes. The
   color-scheme hint also makes native pickers (date/time/select popups) dark. */
:root { color-scheme: dark; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
select, textarea {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 11px; font-size: .9rem; font-family: inherit;
  max-width: 100%; box-sizing: border-box;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }
select {
  -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238b98a8' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
select option { background: var(--panel-2); color: var(--text); }
textarea { resize: vertical; }
input[type="date"], input[type="time"] { min-height: 38px; }
input::-webkit-calendar-picker-indicator { filter: invert(.75); cursor: pointer; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: radial-gradient(1200px 600px at 70% -10%, #16233a 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 32px 10px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-icon { font-size: 2.4rem; }
h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: .5px; }
.sub { color: var(--muted); font-size: .85rem; letter-spacing: 2px; text-transform: uppercase; }
.head-right { text-align: right; }
.clock { font-size: 1.9rem; font-weight: 300; font-variant-numeric: tabular-nums; }
.clock-date { color: var(--muted); font-size: .85rem; white-space: nowrap; }

main { flex: 1; padding: 8px 32px 24px; max-width: 1400px; width: 100%; margin: 0 auto; }
h2 {
  font-size: .8rem; font-weight: 600; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--muted); margin: 22px 0 12px;
}

/* --- app tiles --- */
/* Each group is its own top-level block now, sitting between full <h2>
   sections (Message Board, Controls), so it takes h2's 22px top margin to keep
   one rhythm down the page — and NOT a :first-child reset, which would zero
   every one of them, since each group heading is first inside its own section. */
.tile-group {
  font-size: .68rem; font-weight: 600; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--muted); opacity: .75; margin: 22px 0 8px;
}
.tile-group .count { opacity: .6; letter-spacing: 1px; margin-left: 3px; }
/* Tiles are icon+name chips — four or five to a row where the old full card
   fit one or two on a phone, so the whole launcher fits above the fold. The
   blurb lives on the <a title> instead of a second line. */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}
.tile {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
  position: relative;
}
.tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.tile-icon { font-size: 1.3rem; display: flex; align-items: center; }
.tile-svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.hub-ico { width: 18px; height: 18px; color: var(--accent); vertical-align: -4px; flex: none; }
/* emoji swapped in by icons.js: size to the surrounding text, wheat in headings/titles,
   inherit elsewhere (so an icon inside a wheat button stays ink). */
.hub-emoji { width: 1.05em; height: 1.05em; vertical-align: -0.18em; flex: none; }
h1 .hub-emoji, h2 .hub-emoji, h3 .hub-emoji, .card-title .hub-emoji, .brand-icon .hub-emoji,
.tile-icon .hub-emoji, .list-title .hub-emoji, .sk-head .hub-emoji { color: var(--accent); }
.brand-icon .hub-emoji { width: 1em; height: 1em; vertical-align: -0.12em; }
.act-ico { display: flex; align-items: center; align-self: center; }
.tile-name { font-weight: 600; font-size: .86rem; min-width: 0; }
/* marks a tile that leaves the hub (opens in a new tab) */
.tile-away { color: var(--muted); font-size: .75em; vertical-align: 1px; }
/* Shared: an inline status pip (Stack Health's Live row uses these too, so the
   base rule must NOT carry the tile's absolute corner placement). */
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--muted); flex: none;
}
/* on a tile it's a corner badge instead */
.tile .dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; }
.dot.up   { background: var(--good); box-shadow: 0 0 6px var(--good); }
.dot.down { background: var(--bad);  box-shadow: 0 0 6px var(--bad); }

/* --- one-tap controls --- */
/* Same chip as .tile — icon beside the label, not stacked above it — so the
   Controls row reads as one grid with the launcher rather than a second,
   taller set of buttons. */
.ctrl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}
.ctrl {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 12px 14px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-family: inherit; cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.ctrl:hover { transform: translateY(-2px); border-color: var(--accent); }
.ctrl:active { transform: scale(.96); }
.ctrl-icon { font-size: 1.3rem; display: flex; align-items: center; flex: none; }
.ctrl-svg { width: 22px; height: 22px; color: var(--accent); }
.ctrl-label { font-size: .86rem; font-weight: 600; min-width: 0; }
.ctrl.busy { opacity: .6; pointer-events: none; }
.ctrl.ok   { border-color: var(--good); box-shadow: 0 0 8px rgba(159, 191, 124, .45); }
.ctrl.fail { border-color: var(--bad);  box-shadow: 0 0 8px rgba(210, 87, 63, .45); }

/* --- dashboard cards --- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.card-title { font-weight: 600; font-size: .95rem; margin-bottom: 12px; }
.loading { color: var(--muted); font-size: .85rem; }

.row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, .04);
  font-size: .9rem;
}
.row:last-child { border-bottom: none; }
.row .label { color: var(--muted); }
.row .value { font-weight: 600; font-variant-numeric: tabular-nums; }
.value.good { color: var(--good); }
.value.warn { color: var(--warn); }
.value.bad  { color: var(--bad); }

.big-temp { font-size: 2.2rem; font-weight: 300; line-height: 1; }
.big-wrap { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.big-cond { color: var(--muted); text-transform: capitalize; }

/* --- cameras --- */
.cam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.cam {
  margin: 0; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: #000; cursor: pointer; position: relative;
  transition: border-color .12s ease;
}
.cam:hover { border-color: var(--accent); }
.cam img {
  display: block; width: 100%; aspect-ratio: 16 / 9;
  object-fit: cover; background: #0a0e14;
}
.cam figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 6px 10px; font-size: .8rem; font-weight: 600;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75));
}

.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, .88);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out; padding: 24px;
}
.lightbox.hidden { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* --- who's home --- */
/* --- family summary --- */
.fam-wrap { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.fam-card { flex: 1 1 420px; min-width: 320px; }
.fam-wrap .list-cards { flex: 1 1 380px; column-width: 180px; }
.fam-row {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  color: var(--text); padding: 9px 6px; border-radius: 10px;
}
.fam-row:hover { background: rgba(139, 148, 158, .08); }
.fam-row + .fam-row { border-top: 1px solid var(--border); }
.fam-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #10190C;
}
.fam-name { font-weight: 600; min-width: 90px; }
.fam-presence { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }
.fam-presence.home { color: var(--good); }
.fam-wifi { display: inline-flex; }
.fam-wifi svg { width: 17px; height: 17px; }
.fam-wifi.ok { color: var(--good); }
.fam-wifi.off { color: var(--bad); }
.fam-streak { font-size: .8rem; color: var(--warn); font-weight: 700; }
.fam-count { margin-left: auto; font-size: .85rem; font-variant-numeric: tabular-nums; }
.fam-count.muted { color: var(--muted); font-size: .78rem; }
.fam-todos { margin-left: auto; margin-right: 8px; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.fam-count.muted .fam-todos { margin: 0; }
.fam-todos + .fam-count { margin-left: 0; }
.fam-todos.late { color: var(--warn); }
.fam-bar {
  width: 90px; height: 8px; border-radius: 4px; background: var(--panel-2);
  overflow: hidden; flex: 0 0 auto;
}
.fam-bar > span { display: block; height: 100%; background: var(--good); border-radius: 4px; }

.people { display: flex; flex-wrap: wrap; gap: 12px; }
.person {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 16px 6px 6px;
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; background: var(--panel-2);
  border: 2px solid var(--muted);
}
.person.home .avatar { border-color: var(--good); }
.person.away .avatar { border-color: var(--muted); opacity: .8; }
.person-name { font-weight: 600; font-size: .9rem; }
.person-state { font-size: .75rem; color: var(--muted); }
.person.home .person-state { color: var(--good); }

/* --- today + lists --- */
.ev { display: flex; gap: 10px; padding: 4px 0; font-size: .88rem; align-items: baseline; }
.ev-when { color: var(--accent); flex: 0 0 auto; min-width: 62px; font-size: .8rem; }
.ev-title { color: var(--text); }
.sun-line { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .82rem; }
.muted-line { color: var(--muted); font-size: .85rem; }
.value.muted, .muted { color: var(--muted); font-weight: 400; }

/* --- family lists (masonry-style, so tall lists don't create gaps) --- */
.list-cards { column-width: 220px; column-gap: 14px; }
.list-card {
  break-inside: avoid; margin: 0 0 14px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
}
.list-card.empty { opacity: .55; }
.list-card-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 8px;
}
.list-title { font-weight: 600; font-size: .92rem; }
.list-count {
  background: var(--accent); color: #10190C; font-weight: 700;
  font-size: .72rem; border-radius: 999px; padding: 1px 8px;
  min-width: 22px; text-align: center;
}
.list-count.zero { background: transparent; color: var(--good); }
.list-card ul { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.list-card li {
  font-size: .83rem; color: var(--text);
  padding-left: 13px; position: relative;
}
.list-card li::before { content: "•"; position: absolute; left: 0; color: var(--muted); }
.list-card li.more { color: var(--muted); font-size: .78rem; }
.list-card li.more::before { content: ""; }
.list-empty { font-size: .8rem; color: var(--muted); }

/* editable list items: tap to check off */
.list-card li.editable { cursor: pointer; padding-left: 22px; transition: opacity .12s ease, color .12s ease; }
.list-card li.editable::before { content: "○"; color: var(--muted); font-size: .9rem; }
.list-card li.editable:hover { color: var(--good); }
.list-card li.editable:hover::before { content: "✓"; color: var(--good); }
.list-card li.editable.completing { opacity: .35; text-decoration: line-through; }

/* add-item form on editable list cards */
.add-item { display: flex; gap: 6px; margin-top: 10px; }
.add-item input {
  flex: 1; min-width: 0; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; font-size: .84rem; font-family: inherit;
}
.add-item input:focus { outline: none; border-color: var(--accent); }
.add-item input::placeholder { color: var(--muted); }
.add-item button {
  flex: 0 0 auto; width: 34px; border: none; border-radius: 8px;
  background: var(--accent); color: #10190C; font-size: 1.1rem; font-weight: 700;
  cursor: pointer; line-height: 1;
}
.add-item button:hover { filter: brightness(1.1); }
.add-item button:active { transform: scale(.94); }

.manage-link {
  float: right; color: var(--accent); text-decoration: none;
  text-transform: none; letter-spacing: normal; font-size: .8rem;
}
.manage-link:hover { text-decoration: underline; }

/* --- manage chores page --- */
.back-link { color: var(--accent); text-decoration: none; text-transform: none; letter-spacing: normal; }
.back-link:hover { text-decoration: underline; }
.hidden { display: none !important; }

.pin-gate { display: flex; justify-content: center; padding: 40px 0; }
.pin-card { max-width: 300px; width: 100%; }
.pin-card form { display: flex; gap: 8px; }
.pin-card input {
  flex: 1; min-width: 0; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  font-size: 1rem; font-family: inherit; text-align: center; letter-spacing: 4px;
}
.pin-card input:focus { outline: none; border-color: var(--accent); }

.form-card { max-width: 640px; }
.f-label {
  display: block; color: var(--muted); font-size: .8rem; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; margin: 14px 0 8px;
}
.form-card > .f-label:first-child { margin-top: 0; }
#schedule-fields > .f-label:first-child { margin-top: 16px; }
#f-name {
  width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  font-size: .95rem; font-family: inherit;
}
#f-name:focus { outline: none; border-color: var(--accent); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px; border-radius: 999px; font-size: .88rem; cursor: pointer;
  border: 1px solid var(--border); color: var(--muted); user-select: none;
  transition: all .12s ease;
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); color: #10190C; border-color: var(--accent); font-weight: 600; }

.day-row-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.day-row { display: flex; gap: 6px; }
.day-dot {
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: .85rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); color: var(--muted); user-select: none;
}
.day-dot.on { background: var(--accent); color: #10190C; border-color: var(--accent); }
.mini-btn {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  border-radius: 8px; padding: 6px 12px; font-size: .78rem; cursor: pointer; font-family: inherit;
}
.mini-btn:hover { border-color: var(--accent); color: var(--text); }
.mini-btn:disabled, .mini-btn:disabled:hover {
  opacity: .4; cursor: default; border-color: var(--border); color: var(--muted);
}

.beh-col { display: flex; flex-direction: column; gap: 8px; }
.beh {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px;
  cursor: pointer; user-select: none; transition: all .12s ease;
}
.beh:hover { border-color: var(--accent); }
.beh.on { border-color: var(--accent); background: rgba(229, 216, 174, .08); }
.beh-name { font-size: .92rem; font-weight: 600; }
.beh-desc { font-size: .78rem; color: var(--muted); margin-top: 2px; }

.form-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.form-actions button {
  border: 1px solid var(--border); background: transparent; color: var(--text);
  border-radius: 8px; padding: 9px 18px; font-size: .88rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.form-actions button:hover { border-color: var(--accent); }
.primary-btn { background: var(--accent) !important; color: #10190C !important; border-color: var(--accent) !important; }
.danger-btn { color: var(--bad) !important; border-color: var(--bad) !important; margin-left: auto; }
.form-error { color: var(--bad); font-size: .82rem; margin-top: 10px; min-height: 1em; }

.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.person-card .card-title { display: flex; align-items: center; gap: 8px; }
.count-badge {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  font-size: .72rem; border-radius: 999px; padding: 1px 8px; margin-left: auto;
}
.chore-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.chore-row:last-child { border-bottom: none; }
.chore-row.paused { opacity: .5; }
.chore-main { flex: 1; min-width: 0; }
.chore-name { font-size: .9rem; font-weight: 600; }
.chore-meta { font-size: .75rem; color: var(--muted); margin-top: 1px; }
.shared-badge {
  font-size: .68rem; font-weight: 600; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px; padding: 0 7px; margin-left: 4px;
}
.edit-btn {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  border-radius: 8px; padding: 5px 12px; font-size: .78rem; cursor: pointer; font-family: inherit;
}
.edit-btn:hover { border-color: var(--accent); color: var(--text); }

.interval-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; flex-wrap: wrap; }
.interval-row input {
  width: 70px; background: var(--panel-2); color: var(--text); text-align: center;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 6px;
  font-size: 1rem; font-family: inherit;
}
.interval-row input:focus { outline: none; border-color: var(--accent); }

.times-card { max-width: 640px; }

/* --- login page --- */
.login-wrap { display: flex; justify-content: center; align-items: flex-start; padding-top: 8vh; }
.login-card { max-width: 360px; width: 100%; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.login-card input {
  width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  font-size: .95rem; font-family: inherit;
}
.login-card input:focus { outline: none; border-color: var(--accent); }

/* --- admin page --- */
.add-user-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.add-user-grid input {
  width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
  font-size: .9rem; font-family: inherit;
}
.add-user-grid input:focus { outline: none; border-color: var(--accent); }
.user-card .user-sub { color: var(--muted); font-size: .75rem; font-weight: 400; margin-left: 8px; }
.chip.small { padding: 5px 12px; font-size: .78rem; }
.chip.locked { cursor: default; opacity: .8; }
.device-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: .8rem;
}
.device-row:last-of-type { border-bottom: none; }
.device-info { color: var(--muted); }
.revoke-btn { color: var(--warn); border-color: var(--warn); }
.time-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.time-grid label { display: flex; flex-direction: column; gap: 6px; font-size: .8rem; color: var(--muted); }
.time-grid input {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font-size: .9rem; font-family: inherit;
}
.time-grid input:focus { outline: none; border-color: var(--accent); }

footer {
  display: flex; gap: 14px;
  padding: 10px 32px; color: var(--muted); font-size: .75rem;
}
footer #updated { margin-left: auto; }
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  header, main, footer { padding-left: 16px; padding-right: 16px; }

  /* four footer items in one row broke each of them mid-phrase ("Up to /
     date"); let the row wrap between items instead */
  footer { flex-wrap: wrap; row-gap: 4px; }
  footer > span { white-space: nowrap; }

  /* The header is two columns fighting for a phone's width. At full size the
     title wrapped to "Motroni / Meadows" and the date to "Tuesday, September /
     1", which made the header nearly a third of the screen before any content.
     Everything shrinks a step, the title is allowed to stay on one line, and
     the two columns are kept apart by a real gap instead of by luck. */
  header { gap: 12px; align-items: flex-start; }
  .brand { gap: 10px; min-width: 0; }
  .brand-icon { font-size: 1.8rem; }
  h1 { font-size: 1.15rem; white-space: nowrap; }
  .sub { font-size: .7rem; letter-spacing: 1.5px; }
  .head-right { flex: none; }
  .clock { font-size: 1.4rem; line-height: 1.15; }
  .clock-date { font-size: .75rem; }

  /* Six cameras one-per-row were about 40% of the home page on a phone and
     pushed Today, Weather and Security below the fold. Two across is still a
     picture, and tapping one opens it full screen anyway. */
  .cam-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cam figcaption { font-size: .72rem; padding: 4px 8px; }
}

/* ---- custom date picker (datepicker.js) ---- */
.dp-input { cursor: pointer; }
.dp-pop {
  position: fixed; z-index: 200; width: 264px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5); padding: 10px; user-select: none;
  color: var(--text); font-size: .95rem;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-mo { font-weight: 700; }
.dp-nav {
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 1.2rem;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.dp-nav:active { transform: scale(.92); }
.dp-dow { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.dp-dow span { text-align: center; font-size: .72rem; color: var(--muted); padding: 2px 0; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-empty { height: 34px; }
.dp-day {
  height: 34px; border: none; background: none; color: var(--text); cursor: pointer;
  border-radius: 50%; font-family: inherit; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
}
.dp-day:hover:not([disabled]) { background: var(--panel-2); }
.dp-day.today { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); font-weight: 700; }
.dp-day.sel { background: var(--accent); color: #10190C; font-weight: 700; }
.dp-day.sel.today { box-shadow: none; }
.dp-day[disabled] { opacity: .28; cursor: default; }
.dp-foot { margin-top: 8px; text-align: center; }
.dp-today {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--accent);
  border-radius: 999px; padding: 5px 16px; cursor: pointer; font-family: inherit;
  font-weight: 700; font-size: .85rem;
}
/* kiosk (light-on-gradient) variant */
.dp-pop.embed {
  background: #fbfdff; border: none; color: var(--panel-2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .3);
}
.dp-pop.embed .dp-nav { background: #eaf0f7; border: none; color: var(--panel-2); }
.dp-pop.embed .dp-dow span { color: rgba(0, 0, 0, .5); }
.dp-pop.embed .dp-day { color: var(--panel-2); }
.dp-pop.embed .dp-day:hover:not([disabled]) { background: #eaf0f7; }
.dp-pop.embed .dp-day.today { box-shadow: inset 0 0 0 2px #1a6fc4; color: #1a6fc4; }
.dp-pop.embed .dp-day.sel { background: #1a6fc4; color: #fff; }
.dp-pop.embed .dp-today { background: #eaf0f7; border: none; color: #1a6fc4; }

/* --- Admin: login activity ------------------------------------------------ */
.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 18px; min-width: 116px;
}
.stat-num { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat-num.bad { color: var(--bad); }
.stat-num.good { color: var(--good); }
.stat-label { font-size: .72rem; color: var(--muted); margin-top: 2px; }

.block-card { border-color: var(--bad); margin-bottom: 14px; }
.block-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: .88rem;
}
.block-row:last-child { border-bottom: none; }
.block-what { flex: 1; min-width: 0; }
.block-left { color: var(--muted); font-size: .78rem; }

.auth-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.auth-table th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 0 10px 8px 0; border-bottom: 1px solid var(--border);
}
.auth-table td { padding: 7px 10px 7px 0; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.auth-table tr:last-child td { border-bottom: none; }
.auth-when { color: var(--muted); white-space: nowrap; }
.auth-ip { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.auth-why { color: var(--muted); }
.auth-badge {
  font-size: .68rem; font-weight: 700; border-radius: 999px;
  padding: 2px 9px; white-space: nowrap; display: inline-block;
}
.auth-badge.ok { color: var(--good); border: 1px solid var(--good); }
.auth-badge.fail { color: var(--bad); border: 1px solid var(--bad); }
.auth-badge.warn { color: var(--warn); border: 1px solid var(--warn); }
.auth-badge.info { color: var(--muted); border: 1px solid var(--border); }
.where-tag { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.where-tag.wan { color: var(--warn); }
.auth-scroll { max-height: 460px; overflow-y: auto; overflow-x: auto; margin-top: 12px; }

/* --- away / vacation banner --- */
.away-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); padding: 12px 18px; margin: 14px 0 4px;
  font-size: .9rem;
}
.away-banner.on { border-color: var(--warn); background: rgba(216, 163, 62, .08); }
.away-icon { font-size: 1.4rem; }
.away-text { flex: 1; min-width: 220px; }
.away-text .muted { display: block; font-size: .8rem; margin-top: 2px; }
.away-banner button { flex: none; }

/* --- message board --- */
.link-btn {
  background: none; border: none; cursor: pointer; font: inherit; padding: 0;
}
.note-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.note {
  position: relative; border-radius: 10px; padding: 14px 16px 10px;
  border: 1px solid var(--border); border-top-width: 4px;
  background: var(--panel); min-height: 92px;
}
.note.yellow { border-top-color: var(--warn); }
.note.blue   { border-top-color: var(--accent); }
.note.green  { border-top-color: var(--good); }
.note.pink   { border-top-color: #db61a2; }
.note-text { white-space: pre-wrap; word-break: break-word; font-size: .93rem; }
.note-by { color: var(--muted); font-size: .76rem; margin-top: 10px; }
.note-pin { position: absolute; top: 8px; right: 10px; font-size: .8rem; }
.note-x {
  position: absolute; top: 4px; right: 6px; background: none; border: none;
  color: var(--muted); font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 2px 5px;
}
.note-x:hover { color: var(--bad); }
.note .note-pin + .note-x { right: 28px; }
.note-opts { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.note-inline { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.note-swatch.yellow.on { background: var(--warn); border-color: var(--warn); }
.note-swatch.blue.on   { background: var(--accent); border-color: var(--accent); }
.note-swatch.green.on  { background: var(--good); border-color: var(--good); }
.note-swatch.pink.on   { background: #db61a2; border-color: #db61a2; }

/* --- recent activity card --- */
.act-row {
  display: flex; gap: 10px; align-items: baseline; padding: 6px 0;
  border-bottom: 1px solid var(--border); font-size: .88rem;
}
.act-row:last-child { border-bottom: none; }
.act-time {
  color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums;
  white-space: nowrap; width: 62px; flex: none;
}
.act-what { flex: 1; min-width: 0; }
.act-what .good { color: var(--good); }
.act-what .warn { color: var(--warn); }
.act-what .bad  { color: var(--bad); font-weight: 600; }
.act-what .muted { color: var(--muted); }

/* --- allowance ledger --- */
.cash-hint { color: var(--muted); font-size: .8rem; }
.cash-hint b { color: var(--good); }
.pts-balance.owed { color: var(--good); }
.allow-sub { color: var(--muted); font-size: .82rem; margin: 2px 0; }
.allow-row {
  display: flex; gap: 12px; align-items: baseline; padding: 7px 0;
  border-bottom: 1px solid var(--border); font-size: .88rem;
}
.allow-row:last-child { border-bottom: none; }
.allow-when { color: var(--muted); font-size: .8rem; white-space: nowrap; width: 62px; flex: none; }
.allow-who { font-weight: 600; width: 74px; flex: none; }
.allow-amt { font-variant-numeric: tabular-nums; width: 78px; flex: none; text-align: right; }
.allow-amt.in { color: var(--good); }
.allow-amt.out { color: var(--muted); }
.allow-note { color: var(--muted); flex: 1; }

/* Server card: service dots on one line above the stats */
.health-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 8px; font-size: .88rem; }
.health-line .hl { display: inline-flex; align-items: center; gap: 6px; }
.health-line .mini-btn { margin-left: auto; }
