/* Witkrans farm style (as the farm app after its design pass, Nov 2026): Inter, cream and farm green, soft borders. */
@font-face { font-family: "Inter"; src: url("/fonts/inter-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
:root { color-scheme: light dark; --bg: #f5f3ee; --card: #fff; --ink: #1f2a1f; --muted: #5d6b5d; --line: #e6e2d8; --border: #d8d4c8; --accent: #2c5d7c;
  --bad: #a3392b; --tint: color-mix(in srgb, var(--accent) 12%, var(--card)); --bad-tint: color-mix(in srgb, var(--bad) 10%, var(--card)); --tabbar: 64px; }
@media (prefers-color-scheme: dark) { :root { --bg: #161a16; --card: #1f251f; --ink: #e8ece6; --muted: #9aa89a; --line: #2b342b; --border: #333d33; --accent: #8bb8d8; --bad: #e0806f; } }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
button, input, select { font-family: inherit; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 760px; margin: 0 auto; padding: 12px 16px 4px; }
/* BomaWatch, Farm | House (Eric, 3 Dec 2026): the name, the switch (the same as on the farm pages: Farm green, House blue,
   which is why this page's accent is blue), the account. On phones only the logo stays beside the switch. */
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.brand img { border-radius: 9px; display: block; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt b { font-size: 1.1rem; }
.side-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; padding: 3px; border-radius: 12px; flex: 0 1 300px;
  background: color-mix(in srgb, var(--ink) 9%, var(--bg)); }
body:not(.signed-in) .side-switch { visibility: hidden; }
.side-switch > * { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border-radius: 9px; font-weight: 600;
  font-size: .95rem; text-decoration: none; color: var(--muted); }
.side-switch svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-switch .ss-on { background: var(--card); color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.16); }
.side-switch a:hover { color: var(--ink); }
.side-switch .ss-off svg { color: #2f6b3a; }
@media (prefers-color-scheme: dark) { .side-switch .ss-off svg { color: #7fbf8a; } }
@media (max-width: 899px) { .brand-txt { display: none; } header.top .side-switch { flex: 1 1 auto; max-width: 300px; } }
body.is-owner .guest-only { display: none !important; }
h1 { font-size: 1.4rem; margin: 0; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 1.05rem; margin: 0 0 8px; font-weight: 600; letter-spacing: -0.01em; }
main { max-width: 760px; margin: 0 auto; padding: 8px 16px 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
form.card { display: grid; gap: 10px; }
input { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: inherit; }
button { font: inherit; padding: 10px 14px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; cursor: pointer; min-height: 44px; }
@media (prefers-color-scheme: dark) { button { color: #10200f; } button.link, button.ghost, button.x, .acct-item { color: var(--accent); } }
button.link { background: none; color: var(--accent); padding: 6px; min-height: 0; }
button.ghost { background: none; color: var(--accent); border: 1px solid var(--border); }
button.small-btn { min-height: 36px; padding: 4px 12px; font-size: .9rem; border-radius: 999px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.msg { margin: 0; color: var(--bad); }
.bad { color: var(--bad); }
.hidden { display: none !important; }
body:not(.is-owner) .owner-only { display: none !important; }
#page { display: grid; gap: 14px; }
.tab-page { display: grid; gap: 14px; }
.small { font-size: .85rem; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); flex: none; }
.dot.on { background: #3a9a55; } .dot.off { background: var(--bad); }

/* Account: a round button in the header, as on the farm app */
.acct { position: relative; }
.acct-btn { width: 44px; height: 44px; border-radius: 50%; padding: 0; background: var(--card); color: var(--accent); border: 1px solid var(--border); font-weight: 600; font-size: 1.05rem; }
.acct-menu { position: absolute; right: 0; top: 52px; z-index: 40; min-width: 220px; background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.18); padding: 6px; display: grid; }
.acct-menu p { margin: 0; padding: 8px 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.acct-item { background: none; color: var(--ink); text-align: left; padding: 12px 10px; border-radius: 9px; }
.acct-item:hover { background: var(--tint); }

/* Sections: the same menu as the farm pages (Eric, 3 Dec 2026: "the sidebar menu and all the rest should be the same"):
   a sidebar on wide screens (the name, the Farm | House switch, the sections, the account), a tab bar at the bottom on
   phones; the farm's sizes, colours and icon pills (witkransfarm.com web/index.html, #nav). */
.tabs { background: var(--card); z-index: 30; }
.tab-link { position: relative; display: flex; align-items: center; gap: 12px; color: var(--muted); text-decoration: none; font-weight: 600; border-radius: 10px; }
.tab-link svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-link:hover { color: var(--ink); }
.tab-link[aria-current="page"] { color: var(--accent); }
.tab-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-brand, .nav-account, .nav-doors, .tabs .side-switch { display: none; }
@media (min-width: 900px) {
  body.signed-in header.top { display: none; }
  body.signed-in { padding-left: 220px; }
  main { max-width: 900px; padding-top: 20px; }
  .tabs { position: fixed; top: 0; bottom: 0; left: 0; width: 220px; border-right: 1px solid var(--border); display: flex; flex-direction: column;
    gap: 4px; padding: 16px 12px; overflow-y: auto; }
  .nav-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--ink); text-decoration: none; }
  .nav-brand img { border-radius: 9px; flex: none; }
  .nav-brand > span { display: flex; flex-direction: column; }
  .nav-title { font-weight: 700; font-size: 1.1rem; line-height: 1.2; }
  .tabs .side-switch { display: grid; flex: none; margin: 0 4px 14px; }
  .tab-link { padding: 10px 12px; }
  .tab-link[aria-current="page"] { background: color-mix(in srgb, var(--accent) 14%, transparent); }
  .nav-doors:not(:empty) { display: grid; gap: 2px; margin-top: auto; padding: 10px 8px 6px; border-top: 1px solid var(--line); }
  .nav-doors:not(:empty) + .nav-account { margin-top: 0; }
  .nav-account { display: block; margin-top: auto; padding: 8px; overflow-wrap: anywhere; }
  .nav-account button.link { padding: 0; min-height: 0; text-decoration: underline; }
}
@media (max-width: 899px) {
  main { padding-bottom: calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; border-top: 1px solid var(--border);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tab-link { flex: 1; min-width: 0; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: .75rem; min-height: 48px; justify-content: center; }
  .tab-link svg { box-sizing: content-box; padding: 3px 14px; border-radius: 999px; }
  .tab-link[aria-current="page"] svg { background: var(--tint); stroke-width: 2.3; }
  /* The menu stays at the very bottom (Eric, 3 Dec 2026: "the menu is a bit too low"), as on the farm pages: the page
     itself never scrolls, the body scrolls inside the screen, so Safari (iOS 26) doesn't move the bar while its toolbar
     shrinks; app.js puts the page back if the keyboard leaves it moved. */
  html { overflow-x: clip; }
  body { touch-action: manipulation; }
  html:has(> body.signed-in) { height: 100%; overflow: hidden; }
  body.signed-in { position: fixed; inset: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain;
    scroll-padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* Home: the answer first */
.hero { border-radius: 16px; padding: 16px 18px; background: var(--tint); min-width: 0; }
.hero.attention { background: var(--bad-tint); }
.hero .big { display: flex; align-items: center; gap: 10px; font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.hero .big .ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; flex: none; background: var(--accent); color: #fff; }
.hero.attention .big .ico { background: var(--bad); }
.hero p { margin: 6px 0 0; }
.hero ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.hero li { display: flex; gap: 8px; align-items: baseline; }
.hero li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); flex: none; transform: translateY(-2px); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: grid; align-content: start; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; color: inherit; text-decoration: none; min-width: 0; }
.tile .k { font-size: .8rem; color: var(--muted); }
.tile .v { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.25; }
.tile .s { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.tile .thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 9px; background: var(--line); margin-bottom: 6px; display: block; }
.now { padding: 0 4px; }
.now p { margin: 0; }

/* Cameras: a grid of live pictures */
.camgrid { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cam { display: grid; gap: 4px; min-width: 0; }
.cam .pic { padding: 0; min-height: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--line); display: grid; place-items: center; color: var(--muted); width: 100%; }
.cam .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam .pic .off { font-size: .85rem; }
.cam .name { display: flex; align-items: center; font-size: .88rem; line-height: 1.25; min-width: 0; }
.cam .name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.dot.on { background: var(--accent); } .dot.off { background: var(--bad); }
.small { font-size: .85rem; }
details.more { border-top: 1px solid var(--line); padding: 8px 0; }
details.more:first-of-type { border-top: 0; }
details.more summary { cursor: pointer; font-weight: 600; min-height: 32px; }
details.more ol, details.more ul { padding-left: 20px; }
.devices { list-style: none; padding: 0 !important; margin: 6px 0 0; display: grid; gap: 8px; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; font-size: .8rem; white-space: nowrap; }
th, td { border-bottom: 1px solid var(--line); padding: 4px 8px; text-align: left; }
code { font-size: .9em; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.inline input, .inline select { flex: 1 1 130px; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: inherit; }
.rows { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.rows li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.rows li:first-child { border-top: 0; padding-top: 0; }
.plate { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: .04em; }
.tagk { color: var(--accent); } .tagu { color: var(--muted); }
button.x { background: none; color: var(--bad); padding: 4px 8px; min-height: 0; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hist-q { width: 100%; margin: 2px 0 8px; }
.hist-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; }
body:not(.is-owner) .hist-pills { display: none; }
.hist-pill { flex: none; min-height: 40px; padding: 6px 13px; border-radius: 999px; background: none; color: var(--ink); border: 1px solid var(--border); font: inherit; font-size: .92rem; }
.hist-pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--card); font-weight: 600; }
details.day > summary > span { display: grid; }
.day-sum { font-weight: 400; }
details.opt > summary > span { display: grid; }
.opt-best { font-size: .75rem; font-weight: 600; color: var(--accent); border: 1px solid currentColor; border-radius: 999px; padding: 1px 8px; margin-left: 4px; white-space: nowrap; }
.opt-h { font-weight: 600; margin: 8px 0 2px; }
/* Options: a topic's price list (each part, its shop and exact price, the total) */
.parts { background: var(--tint); border-radius: 12px; padding: 10px 12px; margin: 8px 0 12px; }
.parts-h { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 4px; font-size: 1.02rem; }
.parts > ul { list-style: none; margin: 0; padding: 0; }
.parts > ul > li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border); }
.parts > ul > li > span:first-child { display: grid; min-width: 0; }
.p-r { white-space: nowrap; font-variant-numeric: tabular-nums; }
.parts-foot { margin: 6px 0 2px; border-top: 1px solid var(--border); padding-top: 6px; }
.parts details ul { margin: 4px 0 0; padding-left: 18px; }
details.opt ul, details.opt ol { margin: 0 0 4px; }
.hist, details.more ul.hist { list-style: none; margin: 4px 0 0; padding: 0; }
.h-row { display: flex; gap: 12px; padding: 8px 2px; min-height: 44px; box-sizing: border-box; color: inherit; text-decoration: none; }
.hist li + li .h-row { border-top: 1px solid var(--line); }
.h-t { flex: none; width: 3.1em; color: var(--muted); font-variant-numeric: tabular-nums; }
.h-b { display: grid; min-width: 0; overflow-wrap: anywhere; }
.h-x b { font-weight: 600; }
.h-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: var(--muted); }
.d-ours { background: var(--accent); } .d-bad { background: var(--bad); } .d-night { background: #5b63b7; } .d-animal { background: #b98a3c; }
details.note summary { cursor: pointer; list-style: none; } details.note summary::-webkit-details-marker { display: none; }
details.note[open] summary .link { display: none; } details.note p { margin: 6px 0 0; }
.log .k-problem b { color: var(--bad); }
.way { font-size: .8em; padding: 0 .4em; border-radius: 1em; background: var(--line, #e5e5e5); }
.way-in { color: var(--accent); }
.way-stopped { color: #fff; background: #b4532a; }
.opens { display: block; width: 100%; color: var(--accent); }
.opens input { margin-right: .3em; }
.rows li:has(.opens) { flex-wrap: wrap; }
.animals { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.animal { display: grid; gap: 6px; align-content: start; min-width: 0; }
.animal .pic { padding: 0; min-height: 0; background: var(--line); border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; display: block; width: 100%; }
.animal .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.animal form.name { display: flex; gap: 6px; } .animal form.name input { min-width: 0; width: 0; flex: 1; padding: 6px 8px; } .animal form.name button { padding: 6px 10px; min-height: 0; }
.animal .acts { display: flex; flex-wrap: wrap; gap: 0 4px; } .animal .acts button { width: auto; }
details.more ul.animals { padding-left: 0; }
.car { color: var(--muted, #666); white-space: nowrap; }

/* Big picture view */
.viewer { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: grid; grid-template-rows: auto 1fr auto; touch-action: none; }
.viewer.hidden { display: none; }
body.viewing { overflow: hidden; }
.v-stage { position: absolute; inset: 0; overflow: hidden; display: grid; place-items: center; }
.v-stage img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; will-change: transform; }
.v-wait { position: absolute; margin: 0; color: #bbb; }
.v-top, .v-bottom { position: relative; z-index: 1; padding: 10px 12px; background: linear-gradient(rgba(0,0,0,.7), rgba(0,0,0,0)); }
.v-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-top: max(10px, env(safe-area-inset-top)); }
.v-bottom { grid-row: 3; background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.88)); padding-bottom: max(12px, env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.v-sub { font-size: .85rem; color: #ccc; }
.v-btn { background: rgba(255,255,255,.15); color: #fff; border-radius: 50%; width: 44px; height: 44px; padding: 0; font-size: 1.3rem; line-height: 1; flex: none; }
.v-side { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; font-size: 2rem; }
.v-prev { left: 8px; } .v-next { right: 8px; }
.v-views { display: flex; gap: 6px; flex-wrap: wrap; }
.v-views button, .v-tools button.ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); min-height: 40px; padding: 6px 12px; }
.v-views button[aria-pressed="true"] { background: #fff; color: #000; }
.v-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.v-tools button.link { color: #9fe0bd; }
.v-tools form.name { display: flex; gap: 6px; flex: 1 1 100%; }
.v-tools form.name input { flex: 1; min-width: 0; color: #fff; border-color: rgba(255,255,255,.35); }
.viewer .msg { color: #ffb3a7; }
@media (hover: none) { .v-side { display: none; } }  /* phones: swipe instead */
.tile.row { grid-column: 1 / -1; display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 12px; }
.tile.row .lead { display: grid; place-items: center; }
.tile.row .thumb { width: 96px; height: 64px; aspect-ratio: auto; margin: 0; }
.tile.row .txt { display: grid; gap: 1px; min-width: 0; }
.tile.row .v { font-size: 1.05rem; }
.numberplate { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: .9rem; letter-spacing: .04em;
  color: #111; background: #fff; border: 2px solid #222; border-radius: 6px; padding: 4px 6px; white-space: nowrap; max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
.cam .pic img { opacity: 0; transition: opacity .25s; } .cam .pic img.loaded { opacity: 1; }
details.more summary { list-style: none; display: flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin: 0 4px 0 2px; flex: none; }
details.more[open] > summary::before { transform: rotate(45deg); }

/* Cars: one line per car */
.sub-h { font-size: .95rem; font-weight: 600; margin: 14px 0 6px; }
.carlist { list-style: none; margin: 0; padding: 0; display: grid; }
.carlist li { border-top: 1px solid var(--line); }
.carlist li:first-child { border-top: 0; }
.carrow { width: 100%; background: none; color: inherit; text-align: left; padding: 10px 2px; border-radius: 0; min-height: 0;
  display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; grid-template-areas: "plate desc seen" "plate who seen"; column-gap: 12px; row-gap: 4px; align-items: center; }
.cthumb { grid-area: plate; width: 112px; height: 74px; border-radius: 9px; overflow: hidden; background: var(--line); position: relative; display: grid; place-items: center; }
.cthumb img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; opacity: 0; }
.cthumb.has img { opacity: 1; } .cthumb.has .none { display: none; }
.cthumb .none { font-size: .7rem; color: var(--muted); text-align: center; line-height: 1.2; }
.carrow:hover { background: var(--tint); }
.carrow .cdesc .numberplate { max-width: none; }
.carrow .cdesc { grid-area: desc; font-weight: 500; overflow-wrap: anywhere; }
.carrow .cwho { grid-area: who; font-size: .9rem; overflow-wrap: anywhere; }
.carrow .cseen { grid-area: seen; text-align: right; line-height: 1.3; }
.carhead { display: none; }
@media (min-width: 760px) {
  .carhead { display: grid; grid-template-columns: 112px 1fr 1fr 90px; column-gap: 12px; padding: 0 2px 4px; border-bottom: 1px solid var(--line); }
  .carhead span:last-child { text-align: right; }
  .carrow { grid-template-columns: 112px 1fr 1fr 90px; grid-template-areas: "plate desc who seen"; }
}

/* Animals: suggested names to check */
.guess { font-style: italic; color: var(--accent); }
.ask { background: var(--tint); border-radius: 12px; padding: 10px 12px; margin: 8px 0 4px; }
.ask p { margin: 0 0 4px; }
.ask .rows li { align-items: center; }
.ask-btns { display: flex; gap: 6px; }

/* Which animal: names as pills in the big view */
.v-pick { flex: 1 1 100%; display: grid; gap: 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 40px; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); font-size: .95rem; }
.pill.on { background: #fff; color: #000; }
.pill[data-act="dog"] { border-style: dashed; }
.pill[data-act="other"] { background: none; }
.pill.suggest { border: 2px solid #fff; background: rgba(255,255,255,.24); font-weight: 600; }
.pill.drop { background: none; }
.pill[data-act="not"] { border-color: #fca5a5; color: #fecaca; }

/* Cars tab: cards stacked; our cars with an on/off switch for the gate; forms behind an Add button */
.stack { display: grid; gap: 14px; }
.ourcar { display: flex; align-items: center; gap: 8px; }
.ourcar .carrow { flex: 1; min-width: 0; grid-template-columns: 112px minmax(0, 1fr); grid-template-areas: "plate desc" "plate who"; }
.ourcar .cwho { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
@media (min-width: 760px) { .ourcar .carrow { grid-template-columns: 112px minmax(0, 1fr); grid-template-areas: "plate desc" "plate who"; } }
.switch { position: relative; width: 50px; height: 30px; flex: none; display: inline-block; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border); transition: background .15s; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.add-btn { width: 100%; margin-top: 10px; border-style: dashed; }
.addform { display: grid; gap: 8px; margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--tint); }
.addform.inline { display: flex; }
.addform.hidden { display: none !important; }
.form-btns { display: flex; gap: 8px; align-items: center; }
.v-sub-h { margin: 0; font-weight: 600; flex: 1 1 100%; }
.v-switch { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; font-size: .95rem; }
.v-switch input { width: 20px; height: 20px; }
.sw { display: grid; justify-items: center; gap: 2px; flex: none; } .sw-cap { font-size: .7rem; color: var(--muted); }

/* Next steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.step { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; border-top: 1px solid var(--line); padding: 4px 0; }
.steps .step:first-child { border-top: 0; }
.tick { display: grid; place-items: center; height: 40px; }
.tick input { width: 20px; height: 20px; accent-color: var(--accent); }
.step-body { border-top: 0 !important; padding: 6px 0 !important; }
.step-body summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-weight: 500; }
.step-body summary::before { display: none; }
.step-title { flex: 1 1 auto; }
.step-who { font-size: .8rem; color: var(--muted); font-weight: 400; }
.step-body ol { margin: 6px 0 4px; padding-left: 20px; display: grid; gap: 4px; }
.step.done .step-title { text-decoration: line-through; color: var(--muted); }
.step-who { flex-basis: 100%; }
.way.night { background: #2b2f4a; color: #dfe3ff; }
.v-more { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; }

/* One visit on its own page */
.visit-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; }
.numberplate.big { font-size: 1.15rem; padding: 6px 10px; max-width: none; }
.visit-note { background: var(--tint); border-radius: 12px; padding: 10px 12px; font-size: 1.05rem; }
.addform textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: inherit; resize: vertical; }
.visit-pics { list-style: none; margin: 10px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.visit-pics .pic { padding: 0; min-height: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--line); display: block; width: 100%; }
.visit-pics .pic img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .2s; }
.visit-pics .pic.has img { opacity: 1; }

/* Timelapse: one picture a day; a camera chooser, the picture, a slider through the days */
.lapse-cam { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: inherit; margin: 4px 0 10px; }
.lapse-pic { display: block; width: 100%; padding: 0; min-height: 0; border-radius: 12px; overflow: hidden; background: var(--line); aspect-ratio: 16 / 9; }
.lapse-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lapse-pic img:not([src]) { visibility: hidden; }
.lapse-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.lapse-bar input[type=range] { flex: 1; min-width: 0; padding: 0; border: 0; accent-color: var(--accent); min-height: 36px; }
.lapse-date { margin: 8px 0 0; }

/* Alerts (2 Dec 2026): cars that stopped at the gate; cleared or not cleared */
.tab-link { position: relative; }
.badge { position: absolute; top: -2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #c0392b; color: #fff;
  font-size: .7rem; line-height: 18px; text-align: center; font-weight: 600; box-sizing: border-box; }
@media (max-width: 899px) { .badge { top: 2px; right: auto; left: calc(50% + 6px); } }
.alert-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.alert-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.alert-item.watch { border-color: #b4532a; }
.alert-item p { margin: 6px 0; }
.alert-tools { display: grid; gap: 8px; margin-top: 8px; }
.alert-tools input { width: 100%; box-sizing: border-box; }
.alert-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
button.danger { background: #b4532a; border-color: #b4532a; color: #fff; }
a.btn-link { display: inline-block; min-height: 36px; padding: 6px 14px; font-size: .9rem; border-radius: 999px; box-sizing: border-box; text-decoration: none; border: 1px solid var(--accent); color: var(--accent); }
.v-hours { display: grid; gap: 6px; margin: 6px 0; }
.v-hours .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.v-hours input[type=time] { min-width: 7em; }

/* Animals in the big view (2 Dec 2026): one row of choices; Undo for the last tap */
.v-drop-help { margin: 6px 0 0; }
.v-undo { margin: 8px 0 0; font-size: .9rem; }
.v-undo .link { font-weight: 600; }
.alert-visits { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 12px; }
.alert-visits li { display: grid; grid-template-columns: 140px 1fr; gap: 10px; align-items: start; }
.alert-visits .pic { padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; background: #222; }
.alert-visits .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.alert-head a { text-decoration: none; color: inherit; }
/* An alert's page: level, reasons, the car, the people, each stop with its cameras */
.level { display: inline-block; font-size: .78em; font-weight: 600; padding: 0 .55em; border-radius: 1em; color: #fff; background: #777; }
.level-high { background: #b3261e; } .level-medium { background: #c86b16; } .level-low { background: #6b7280; } .level-cleared { background: #2f6b3a; }
.reasons { margin: 4px 0 12px; padding-left: 1.2em; }
.reasons li { margin: 2px 0; }
.apics { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.apic { flex: 0 0 auto; width: 150px; display: grid; gap: 4px; }
.apics.big .apic { width: 240px; }
.apics.people .apic { width: 120px; }
.apic .pic { padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: #222; width: 100%; }
.apics.people .apic .pic { aspect-ratio: 3 / 4; }
.apic .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.astops { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 14px; }
.astop p { margin: 4px 0; }
/* Times a car opens the gate: presets, day buttons, from-to, last day */
/* The days-and-times picker (4 Dec 2026): light on the Cars page, dark in a car's big view: it takes the colour around it */
.hours-pick { display: grid; gap: 10px; margin: 6px 0; }
.hp-b { min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); background: transparent; color: inherit; font: inherit; font-size: .9rem; cursor: pointer; }
.hp-b.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.hp-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.hp-day { padding: 6px 0; min-width: 0; font-size: .85rem; }
.hp-allday { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.hp-allday input { width: 20px; height: 20px; }
.hp-times { display: flex; gap: 8px; align-items: center; }
.hp-times input { flex: 1; min-width: 0; padding: 8px; border-radius: 8px; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); background: transparent; color: inherit; font: inherit; }
.hp-until summary { cursor: pointer; font-size: .9rem; padding: 4px 0; }
.hp-until summary .muted { font-size: .8rem; }
.hp-until .hp-times { margin-top: 6px; }
.hp-sum { margin: 0; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 600; font-size: .9rem; }
.v-when { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin: 4px 0; }
.v-hours .row { display: flex; gap: 12px; align-items: center; }
.alert-banner { background: #fbeae8; border-radius: 10px; padding: 8px 12px; }
@media (prefers-color-scheme: dark) { .alert-banner { background: #3a2422; } }
.alert-banner a { font-weight: 600; }

/* Someone rang at the gate (Home and its own page) */
.ring-now { margin-bottom: 0.9rem; min-width: 0; max-width: 100%; }
.ring-now .apics { max-width: 100%; }
.ring-now + .big, .ring-now + p.big { margin-top: 0.4rem; }
.apics.ring-pics .apic:first-child { width: 220px; }
.open-gate { background: var(--accent); color: #fff; border-color: var(--accent); min-width: 8.5rem; }
.open-gate.armed { background: var(--bad); border-color: var(--bad); }
.d-ring { background: #c0702a; }
.tab-page > .card { min-width: 0; }  /* a row of pictures scrolls inside the card, never widens the page */

/* The Intercom page */
#ic-now .hero { margin-bottom: 12px; }
.ic-live { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #222; margin-top: 8px; }
.ic-live img { width: 100%; height: 100%; object-fit: cover; grid-area: 1 / 1; }
.ic-live img:not([src]) { display: none; }
.ic-live span { grid-area: 1 / 1; color: #ddd; padding: 0 12px; text-align: center; }
.ic-list { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 8px; }
.ic-ring { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.ic-ring > span:last-child { display: grid; gap: 2px; }
.ic-thumb { flex: none; width: 72px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #222; }
.ic-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 640px) { body.is-owner .tab-link svg { padding: 3px 6px; } body.is-owner .tab-link { font-size: .64rem; padding-left: 0; padding-right: 0; } }

/* Devices: the full record */
.chain { list-style: none; padding: 0; margin: 6px 0 14px; display: grid; gap: 0; }
.chain li { display: grid; padding: 6px 0 6px 14px; border-left: 2px solid var(--accent); position: relative; }
.chain li::before { content: ""; position: absolute; left: -6px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
details.doc > summary > span { display: grid; gap: 2px; }
.doc-line { font-weight: 400; }
.facts { display: grid; grid-template-columns: minmax(6.5rem, 32%) 1fr; gap: 6px 12px; margin: 10px 0; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; gap: 0; } .facts dd { margin-bottom: 8px; } }

/* Software for the devices */
.fw-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.fw-form input[type=file] { flex: 1 1 12rem; min-width: 0; font-size: .9rem; }
.fw-bar { height: 8px; border-radius: 999px; background: var(--tint); overflow: hidden; margin: 6px 0; }
.fw-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* Listen and talk */
.ic-sound { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.talk-btn { flex: 1 1 12rem; min-height: 52px; font-size: 1.05rem; background: var(--accent); color: #fff; border-color: var(--accent);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.talk-btn.on { background: var(--bad); border-color: var(--bad); }
#ic-listen[aria-pressed="true"] { background: var(--tint); }

.small.good { color: var(--accent); }

/* More (2 Dec 2026): a menu of sections, each row with its answer in one line; then one section at a time with a way back */
.more-menu { padding-top: 4px; padding-bottom: 4px; }
.more-menu ul { list-style: none; margin: 0; padding: 0; }
.more-menu li + li { border-top: 1px solid var(--line); }
.more-menu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 11px 0; color: inherit; text-decoration: none; }
.more-menu a > span:first-child { display: grid; gap: 1px; min-width: 0; }
.more-menu a b { font-size: 1.05rem; font-weight: 600; }
.more-menu .chev { color: var(--muted); font-size: 1.5rem; line-height: 1; }
.more-back { margin: 0 0 6px; }
.more-back a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; font-weight: 600; text-decoration: none; }
details.group > summary, details.ideas > summary, details.done-fold > summary { min-height: 44px; font-size: 1.02rem; }
details.group > ul.steps, details.ideas > ul.steps { padding-left: 0; }
/* To buy: the model is the line to read out in a shop */
.p-m { font-weight: 600; overflow-wrap: anywhere; }
.parts + .parts { margin-top: 14px; }
/* Cameras: whose glass to clean, with the picture it was judged from */
.care-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 14px; }
.care { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 12px; align-items: start; }
.care > span { display: grid; gap: 3px; min-width: 0; }
.care-pic { padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--tint); aspect-ratio: 16 / 9; width: 116px; cursor: pointer; }
.care-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tag { font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; color: var(--muted); white-space: nowrap; }
.tag-bad { color: var(--bad); }
/* Intercom: which camera (pills on the page, not on the dark viewer), and when rings could not be seen */
.ic-views { margin-top: 8px; gap: 6px; }
.ic-views .pill { color: inherit; background: var(--card); border-color: var(--border); min-height: 36px; padding: 4px 12px; font-size: .9rem; }
.ic-views .pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ic-live img.dim { opacity: .45; }
details.ic-gaps { border-top: 0; padding: 0 0 8px; }
details.ic-gaps summary { font-weight: 400; font-size: .9rem; color: var(--muted); }
/* More → Automations: ideas only, one line each, the rest folded */
.auto-h { margin: 16px 0 2px; font-size: 1rem; }
details.auto-idea { border-top: 1px solid var(--line); padding: 2px 0; }
.auto-h + details.auto-idea { border-top: 0; }
details.auto-idea summary { cursor: pointer; padding: 9px 0; }
details.auto-idea summary .tag { float: right; margin-left: 8px; }
.tag.lvl-easy { color: #1a7f37; } .tag.lvl-medium { color: #9a6700; } .tag.lvl-hard { color: var(--bad); }
@media (prefers-color-scheme: dark) { .tag.lvl-easy { color: #56d364; } .tag.lvl-medium { color: #e3b341; } }
details.auto-idea p { margin: 2px 0 8px; }
.more-menu a { min-height: 54px; padding: 8px 0; }

/* One-time gate pass (Intercom) */
.pass-form { display: grid; gap: 8px; margin-top: 8px; }
.pass-hours { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.pass-hours select { flex: 0 1 160px; }
.pass-me { display: flex; align-items: center; gap: 8px; }
.pass-me input { width: 20px; height: 20px; }
.pass-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.pass-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.pass-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }

/* Our cars in groups (3 Dec 2026) */
.car-group { font-size: 0.95rem; margin: 14px 0 4px; display: flex; gap: 8px; align-items: baseline; }
.car-group:first-of-type { margin-top: 6px; }
#plate-group { padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--card, #fff); color: inherit; font: inherit; }
.v-group { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.v-group select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); font: inherit; background: transparent; color: inherit; }

/* My profile choices (3 Dec 2026): only the house, and sections left out of the menu */
.pref-off, body.pref-house-only .side-switch, body.pref-house-only .tab-link[data-tab="hub"] { display: none !important; }
body.pref-no-todo .todo-block, body.pref-no-todo #more-menu a[href="#more/todo"] { display: none !important; }
.lapse-at { display: inline-flex; gap: 8px; align-items: center; margin: 0 8px 8px 0; }
.lapse-at select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); font: inherit; background: transparent; color: inherit; }
/* A car's view with the times open (4 Dec 2026): the panel goes solid over the photo and scrolls if the phone is short */
.v-bottom:has([data-v-hours-box]:not(.hidden)) { background: #000; max-height: 80vh; max-height: 80dvh; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }
.v-tools .v-hours { flex: 1 1 100%; }
/* The gate and garages on the main screen (4 Dec 2026) */
.doors-tile { grid-column: 1 / -1; }
.doors { list-style: none; margin: 4px 0 0; padding: 0; display: grid; }
.door { width: 100%; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; grid-template-areas: "dot n st" ". s s"; column-gap: 10px; align-items: center; text-align: left;
  background: none; border: 0; border-radius: 0; border-top: 1px solid var(--line); padding: 9px 0; color: inherit; font: inherit; min-height: 44px; cursor: pointer; }
.doors li:first-child .door { border-top: 0; }
.door:disabled { cursor: default; }
.door .dot { grid-area: dot; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.door .dot.closed { background: #16a34a; }
.door .dot.open { background: #d97706; }
.door .dn { grid-area: n; }
.door b { grid-area: st; }
.door .ds { grid-area: s; font-size: .82rem; color: var(--muted); }
.door.bad b, .door.bad .dn { color: #b91c1c; }
.door.bad .dot { background: #dc2626; }
/* Gate and garages at the bottom of the left menu (4 Dec 2026) */
.nd-h { margin: 0 0 4px; font-size: .78rem; color: var(--muted); }
.nd { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; background: none; border: 0; border-radius: 8px;
  padding: 5px 4px; color: inherit; font: inherit; font-size: .88rem; text-align: left; cursor: pointer; min-height: 32px; }
.nd:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.nd:disabled { cursor: default; }
.nd .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.nd .dot.closed { background: #16a34a; }
.nd .dot.open { background: #d97706; }
.nd .dn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd b { font-weight: 600; font-size: .82rem; }
.nd.bad .dot { background: #dc2626; }
.nd.bad b, .nd.bad .dn { color: #b91c1c; }
