/* Metz Gardens — earthy palette */
:root {
  --cream: #FBF7EF;
  --sand: #F3EBDD;
  --linen: #E9DDC8;
  --line: #DCCDB4;
  --stone: #8A7B6A;
  --ink: #2E2620;
  --ink-2: #5A4C3F;
  --bark: #4A2F1D;
  --umber: #7A4A2B;
  --olive: #4E5B31;
  --moss: #6B7A45;
  --sage: #A9B38A;
  --clay: #BA5A28;      /* chart: expenditure (validated) */
  --lagoon: #006E9E;    /* chart: income (validated) */
  --ochre: #B9862A;
  --good: #3F6B33;
  --warn: #9A6A12;
  --bad: #9B2F1E;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(46, 38, 32, .06), 0 8px 24px rgba(46, 38, 32, .08);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); color: var(--ink); background: var(--sand); font-size: 15px; line-height: 1.55; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--bark); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
a { color: var(--umber); }
p { margin: 0 0 1em; }
small, .muted { color: var(--stone); }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 12px 0 5px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line);
  border-radius: 7px; padding: 10px 12px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--moss); outline: none; box-shadow: 0 0 0 3px rgba(107, 122, 69, .2); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600;
  border: 0; border-radius: 7px; padding: 10px 18px; cursor: pointer; background: var(--olive); color: var(--cream);
  text-decoration: none; transition: background .15s;
}
.btn:hover { background: #3e4927; }
.btn.secondary { background: transparent; color: var(--olive); border: 1px solid var(--olive); }
.btn.secondary:hover { background: rgba(78, 91, 49, .08); }
.btn.clay { background: var(--umber); } .btn.clay:hover { background: var(--bark); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }
/* show / hide password */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 68px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--umber); padding: 6px 10px; border-radius: 5px; cursor: pointer;
}
.pw-toggle:hover { background: var(--linen); }
.pw-toggle[aria-pressed="true"] { color: var(--olive); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--umber); text-decoration: underline; cursor: pointer; }
.alert { border-radius: 8px; padding: 10px 14px; margin: 12px 0; font-size: 14px; }
.alert.ok { background: #E6EEDB; color: #2F4A22; border: 1px solid #C5D4AE; }
.alert.err { background: #F6E1D8; color: #7A2414; border: 1px solid #E8BCA9; }
.alert.info { background: #F4ECDC; color: var(--bark); border: 1px solid var(--line); }

/* ---------- login ---------- */
.login-page { overflow: hidden; background: #1f1a14; }
.flyover-fallback { position: fixed; inset: 0; width: 100%; height: 100%; }
/* The 3D view fills the open space to the right of the card (computers) or above it (phones), so the complex is
   centred where you can see it. --card-right / --card-top are measured in login.js; the edge next to the card fades out. */
#flyover { position: fixed; top: 0; right: 0; bottom: 0; left: max(0px, calc(var(--card-right, 0px) - 80px));
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 140px); mask-image: linear-gradient(90deg, transparent 0, #000 140px);
  transition: opacity 1.6s ease; }
body.stacked #flyover { left: 0; -webkit-mask-image: none; mask-image: none; }
/* after signing in, the view opens up to the whole screen while the drone flies to your unit */
body.leaving #flyover { left: 0; transition: opacity 1.6s ease, left .9s cubic-bezier(.2, .7, .2, 1), height .9s cubic-bezier(.2, .7, .2, 1); }
/* 3D map stays invisible until it has fully loaded, then fades in over the photo */
#flyover { opacity: 0; }
#flyover.ready { opacity: 1; }
.flyover-fallback { background: url(/assets/aerial.png) center/cover no-repeat; animation: drift 60s ease-in-out infinite alternate;
  /* soft, dimmed backdrop while the sharp 3D view loads (the photo is low-res, so don't show it crisp) */
  filter: blur(6px) brightness(.62) saturate(.85); transition: opacity 1.6s ease; }
.flyover-fallback.gone { opacity: 0; }
/* Login intro: the complex builds itself as a little model while the 3D map loads (public/js/build-intro.js).
   Same box as #flyover, so the model sits where the drone view will appear; it cross-fades into it. */
.build-intro { position: fixed; top: 0; right: 0; bottom: 0; left: max(0px, calc(var(--card-right, 0px) - 80px)); z-index: 1;
  pointer-events: none; transition: opacity 1.4s ease; }
.build-intro canvas { position: absolute; inset: 0; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .28)); }
body.stacked .build-intro { left: 0; }
.build-intro.gone, body.leaving .build-intro { opacity: 0; }
.build-caption { position: absolute; left: 50%; bottom: 7vh; transform: translateX(-50%); width: min(340px, 70%);
  color: #F3EBDD; text-shadow: 0 1px 6px rgba(0, 0, 0, .65); animation: bc-in .8s .2s ease both; }
@keyframes bc-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.bc-track { height: 3px; border-radius: 3px; background: rgba(243, 235, 221, .22); overflow: hidden; box-shadow: 0 1px 6px rgba(0, 0, 0, .25); }
.bc-fill { width: 0; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #c9a45c, #f0d9a4); }
.bc-line { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 12px; letter-spacing: .06em; }
.bc-text { font-family: var(--serif, Georgia, serif); font-size: 14px; letter-spacing: .02em; }
.bc-pct { font-variant-numeric: tabular-nums; opacity: .8; }
/* phones: sit above the Sign in / Join block */
body.stacked .build-caption { bottom: calc(max(28px, env(safe-area-inset-bottom) + 20px) + 150px); width: min(300px, 78%); }
body.card-open .build-caption { opacity: 0; transition: opacity .3s ease; }
/* night (after sunset): a deep blue dusk over the photo and around the edges */
body.night { background: #070b18; }
body.night .flyover-fallback { filter: blur(6px) brightness(.3) saturate(.5); }
body.night .flyover-fallback::after { content: ""; position: absolute; inset: 0; background: rgba(16, 34, 92, .5); mix-blend-mode: multiply; }
body.night .login-shade { background: linear-gradient(90deg, rgba(5, 9, 22, .82) 0%, rgba(5, 9, 22, .5) 38%, rgba(5, 9, 22, 0) 65%); }
/* ---------- drone layers (login + home window) ---------- */
/* Night: the whole 3D scene is darkened and tinted navy; the lights and the pin sit in an HTML layer above it */
.drone-shade, .drone-lights { position: absolute; inset: 0; pointer-events: none; }
.drone-lights { overflow: hidden; }
gmp-map-3d.drone-night { filter: brightness(.42) saturate(.55) contrast(1.08); }
.is-night > .drone-shade { background: rgba(18, 36, 105, .42); mix-blend-mode: multiply; }
.drone-glow { border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 247, 226, 1) 0 9%, rgba(255, 214, 140, .9) 19%, rgba(255, 178, 90, .32) 42%, rgba(255, 160, 70, 0) 70%); }
.drone-glow.warm { background: radial-gradient(circle, rgba(255, 240, 205, 1) 0 9%, rgba(255, 192, 104, .9) 19%, rgba(255, 150, 60, .32) 42%, rgba(255, 140, 50, 0) 70%); }
.drone-glow.dim { opacity: .8; }
.drone-glow.pool { background: radial-gradient(circle, rgba(200, 250, 255, .95) 0 10%, rgba(70, 200, 235, .6) 28%, rgba(30, 150, 210, .2) 50%, rgba(20, 120, 200, 0) 72%); }
.drone-pin { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }
.drone-pin svg { display: block; }
/* after signing in: the card steps aside while the drone flies to your unit, then the hub fades in */
.login-card, .login-shade, .place-tag { transition: opacity .6s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
body.leaving .login-card { opacity: 0; transform: translateX(-28px); pointer-events: none; }
body.leaving .login-shade { opacity: .3; }
body.leaving .place-tag { opacity: 0; }
body.gone #flyover, body.gone .flyover-fallback { opacity: 0 !important; transition: opacity .38s ease; }
@keyframes drift { from { transform: scale(1.08) translate(-1.5%, 0); } to { transform: scale(1.22) translate(1.5%, -2%); } }
@media (prefers-reduced-motion: reduce) { .flyover-fallback { animation: none; } }
.login-shade { position: fixed; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(31, 26, 20, .78) 0%, rgba(31, 26, 20, .45) 38%, rgba(31, 26, 20, 0) 65%); }
.login-wrap { position: relative; z-index: 2; min-height: 100%; display: flex; align-items: center; padding: 32px clamp(16px, 5vw, 72px); pointer-events: none; }
.login-card { pointer-events: auto; width: 100%; max-width: 420px; background: rgba(251, 247, 239, .96); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35); padding: 30px 30px 24px; max-height: calc(100vh - 64px); overflow: auto; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.brand-mark { width: 42px; height: 42px; border-radius: 50%; background: var(--olive); color: var(--cream); display: grid; place-items: center;
  font-family: var(--serif); font-size: 20px; }
.brand-name { font-family: var(--serif); font-size: 24px; color: var(--bark); line-height: 1.1; }
.brand-sub { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--stone); }
.tabs { display: flex; gap: 4px; background: var(--linen); padding: 4px; border-radius: 9px; margin: 18px 0 6px; position: relative; }
.tabs button { flex: 1; border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 8px; border-radius: 6px; cursor: pointer;
  position: relative; z-index: 1; }
.tabs button[aria-selected="true"] { color: var(--bark); }
/* the white pill slides between "Sign in" and "Join" */
.tabs::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: 6px;
  background: var(--cream); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); transition: transform .34s cubic-bezier(.2, .7, .2, 1), opacity .2s; }
.tabs[data-active="register"]::before { transform: translateX(calc(100% + 4px)); }
.tabs[data-active="forgot"]::before { opacity: 0; }
[data-panel]:not(.hidden) { animation: fade-in .3s ease both; }
.login-foot { margin-top: 16px; font-size: 12px; color: var(--stone); }
.place-tag { position: fixed; right: 18px; bottom: 16px; z-index: 2; color: #F3EBDD; font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
/* phones only: a small Sign in / Join block over the full-screen drone shot (hidden on computers) */
.m-entry, .m-close { display: none; }
@media (max-width: 640px) {
  /* phones: the drone shot fills the screen; a small block offers Sign in / Join; the full card slides up when tapped */
  .login-shade { background: linear-gradient(180deg, rgba(31, 26, 20, 0) 0%, rgba(31, 26, 20, 0) 55%, rgba(31, 26, 20, .55) 100%);
    transition: background .4s ease, opacity .6s ease; }
  body.night .login-shade { background: linear-gradient(180deg, rgba(5, 9, 22, 0) 0%, rgba(5, 9, 22, .1) 55%, rgba(5, 9, 22, .6) 100%); }
  body.card-open .login-shade { background: rgba(31, 26, 20, .5); }
  body.night.card-open .login-shade { background: rgba(5, 9, 22, .6); }
  .m-entry { display: block; position: fixed; z-index: 3; left: 50%; bottom: max(28px, calc(env(safe-area-inset-bottom) + 20px));
    width: min(340px, calc(100% - 40px)); transform: translateX(-50%); padding: 14px 16px 16px; border-radius: 18px;
    background: rgba(251, 247, 239, .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .35); transition: opacity .35s ease, transform .45s cubic-bezier(.2, .7, .2, 1);
    animation: m-rise .7s .3s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes m-rise { from { opacity: 0; transform: translate(-50%, 24px); } }
  .m-brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
  .m-brand .brand-mark { width: 34px; height: 34px; font-size: 16px; }
  .m-brand .brand-name { font-size: 20px; }
  .m-brand .brand-sub { font-size: 10px; }
  .m-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
  .m-actions .btn { padding: 11px 10px; font-size: 15px; }
  body.card-open .m-entry, body.leaving .m-entry { opacity: 0; transform: translate(-50%, 16px); pointer-events: none; }
  .m-close { display: grid; place-items: center; position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%;
    background: var(--linen); color: var(--bark); font-size: 22px; line-height: 1; cursor: pointer; }
  .login-card { position: relative; }
  .login-wrap { align-items: flex-end; padding: 16px 12px max(12px, env(safe-area-inset-bottom)); }
  .login-card { padding: 20px 20px 16px; border-radius: 16px; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px);
    transform: translateY(calc(100% + 40px)); opacity: 0; pointer-events: none;
    transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .35s ease; }
  body.card-open .login-card { transform: none; opacity: 1; pointer-events: auto; }
  .login-card .brand-mark { width: 36px; height: 36px; font-size: 17px; }
  .login-card .brand-name { font-size: 21px; }
  .tabs { margin: 14px 0 2px; }
  .login-card label { margin-top: 10px; }
  .row { grid-template-columns: 1fr; }
  .place-tag { display: none; }
  body.leaving .login-card { transform: translateY(40px); }
}

/* ---------- page transitions ---------- */
/* Between the sign-in page and the hub (Chrome, Edge, Opera): a cross-fade instead of a hard cut */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .5s; }
/* Inside the hub (see route() in app.js): the page you leave is pinned in place and fades out while the next one fades
   and rises in, its sections one after another */
.page-ghost { position: fixed; z-index: 1; overflow: hidden; pointer-events: none; margin: 0; opacity: .8; /* dims at once: "got your click" */
  transition: opacity .24s ease, transform .3s cubic-bezier(.4, 0, .2, 1); }
.page-ghost.leaving { opacity: 0; transform: translateY(-8px); }
#view.entering { opacity: 0; }
#view.view-in > * { animation: rise-in .46s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 55ms + 40ms); }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.swap-in { animation: fade-in .32s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* slim loading bar along the top, only when a page takes a moment */
.route-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; pointer-events: none;
  background: linear-gradient(90deg, var(--olive), var(--ochre)); transform-origin: 0 50%; transform: scaleX(0); opacity: 0; }
.route-progress.run { opacity: 1; transform: scaleX(.75); transition: transform 2.4s cubic-bezier(.1, .7, .3, 1), opacity .2s; }
.route-progress.done { transform: scaleX(1); opacity: 0; transition: transform .25s ease, opacity .3s ease .2s; }
/* bars grow up from the axis, bar lists grow from the left, the savings line draws itself */
.chart path.bar { transform-box: fill-box; transform-origin: 50% 100%; animation: grow-up .6s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--d, 0ms); }
@keyframes grow-up { from { transform: scaleY(0); } }
.chart .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-line 1.1s cubic-bezier(.4, 0, .2, 1) .25s forwards; }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
.chart .dot { animation: fade-in .3s ease both; animation-delay: var(--d, 0ms); }
.shares .bar span, .progress > span { transform-origin: 0 50%; animation: grow-right .7s cubic-bezier(.2, .7, .2, 1) .1s both; }
@keyframes grow-right { from { transform: scaleX(0); } }
.shell { animation: shell-in .45s ease both; }
@keyframes shell-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- links, buttons and anything clickable ---------- */
html { scroll-behavior: smooth; }
a { text-underline-offset: 2px; text-decoration-thickness: 1px;
  transition: color .18s ease, text-underline-offset .18s ease, text-decoration-color .18s ease; }
a:hover { text-underline-offset: 4px; }
.linkbtn { text-underline-offset: 2px; transition: color .18s ease, text-underline-offset .18s ease; }
.linkbtn:hover { text-underline-offset: 4px; }
.btn { transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .2s ease, transform .2s cubic-bezier(.2, .7, .2, 1); }
.btn:hover:not([disabled]) { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(60, 40, 20, .16); }
.btn:active:not([disabled]) { transform: translateY(0) scale(.98); box-shadow: 0 1px 3px rgba(60, 40, 20, .12); transition-duration: .07s; }
a.card { transition: transform .24s cubic-bezier(.2, .7, .2, 1), box-shadow .24s ease, border-color .24s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(60, 40, 20, .12); border-color: #D8C5A4; }
a.card:active { transform: translateY(0) scale(.995); transition-duration: .08s; }
.list a.item { transition: transform .22s cubic-bezier(.2, .7, .2, 1); }
.list a.item:hover { transform: translateX(3px); }
.list a.item .t { transition: color .18s ease; }
.seg button, .chips button, .tabs button, .pw-toggle, .viewas-btn {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .12s ease; }
.seg button:active, .chips button:active, .viewas-btn:active { transform: scale(.97); }
details.rule > summary { transition: color .18s ease; }
/* rules open and close smoothly (Chrome/Edge 131+; elsewhere they simply open) */
@supports selector(::details-content) {
  :root { interpolate-size: allow-keywords; }
  details.rule::details-content { height: 0; overflow: clip; transition: height .32s cubic-bezier(.2, .7, .2, 1), content-visibility .32s allow-discrete; }
  details.rule[open]::details-content { height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .chart .draw { stroke-dashoffset: 0; }
}

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--bark); color: #EADBC4; padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.side .brand-name { color: #F6EEDF; font-size: 20px; }
.side .brand-sub { color: #C2AE92; }
.side .brand-mark { background: var(--moss); }
.nav { margin-top: 22px; display: flex; flex-direction: column; gap: 1px; position: relative; }
.nav a { color: #EADBC4; text-decoration: none; padding: 8px 12px; border-radius: 7px; font-weight: 500; display: flex; justify-content: space-between;
  position: relative; z-index: 1; transition: color .25s ease, background-color .2s ease; }
.nav a:hover { background: rgba(255, 255, 255, .06); }
.nav a.active { background: rgba(169, 179, 138, .22); color: #fff; }
/* the highlight behind the current section glides from item to item (set up in app.js) */
.nav-mark { position: absolute; left: 0; right: 0; top: 0; height: 0; border-radius: 7px; background: rgba(169, 179, 138, .22); pointer-events: none;
  opacity: 0; transition: transform .42s cubic-bezier(.2, .7, .2, 1), height .42s cubic-bezier(.2, .7, .2, 1), opacity .2s; }
.nav.has-mark .nav-mark { opacity: 1; }
.nav.has-mark a.active { background: transparent; }
.nav.has-mark a.active:hover { background: rgba(255, 255, 255, .04); }
.nav .badge { background: var(--ochre); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; align-self: center; line-height: 1.5; }
.side-foot { margin-top: auto; padding-top: 16px; font-size: 13px; color: #C2AE92; }
.side-foot .linkbtn { color: #F3EBDD; }
.col { min-width: 0; }
/* the content area takes focus on each page change (for screen readers) — no ochre frame around the whole page */
#view:focus, #view:focus-visible { outline: none; }
.main { padding: 32px clamp(16px, 4vw, 48px) 60px; max-width: 1120px; width: 100%; }
/* trustee "view as resident" */
.viewas-btn { display: block; width: 100%; margin: 12px 0 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer;
  background: transparent; color: #F3EBDD; border: 1px solid rgba(243, 235, 221, .35); font: inherit; font-size: 13px; font-weight: 600; }
.viewas-btn:hover { background: rgba(255, 255, 255, .08); }
.viewas-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #F2E2BC; color: var(--bark); border-bottom: 1px solid #DDC48C; padding: 10px clamp(16px, 4vw, 48px); font-size: 14px; }
.topbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 30% 0 0; z-index: 20; transform: translateX(-100%); height: 100%;
    transition: transform .34s cubic-bezier(.2, .7, .2, 1), box-shadow .34s ease; }
  .side.open { transform: none; box-shadow: 12px 0 40px rgba(30, 20, 10, .35); }
  .topbar { display: flex; align-items: center; gap: 12px; background: var(--bark); color: #F3EBDD; padding: 12px 16px; position: sticky; top: 0; z-index: 10; }
  .topbar button { background: none; border: 0; color: inherit; font-size: 22px; cursor: pointer; }
  .main { padding-top: 20px; }
  .viewas-bar { position: static; }
}

/* ---------- content ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 0; color: var(--ink-2); }
.card { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
.tile { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.tile .k { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--stone); }
.tile .v { font-family: var(--serif); font-size: 28px; color: var(--bark); margin-top: 4px; }
.tile .s { font-size: 13px; color: var(--ink-2); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 20px; padding: 2px 10px; background: var(--linen); color: var(--ink-2); white-space: nowrap; }
.pill.received { background: #EFE3C9; color: #6E4E12; }
.pill.in_progress, .pill.awaiting_decision { background: #F1DCCB; color: #7A3A17; }
.pill.resolved, .pill.complete { background: #DFE8D2; color: #2F4A22; }
.pill.declined, .pill.paused { background: #E8DDD5; color: #5A4C3F; }
.pill.planning { background: #E3E6D3; color: #4E5B31; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--linen); }
.list li:last-child { border-bottom: 0; }
.list a.item { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.list a.item:hover .t { color: var(--umber); text-decoration: underline; }
.t { font-weight: 600; }
.meta { font-size: 13px; color: var(--stone); }
.progress { height: 10px; background: var(--linen); border-radius: 6px; overflow: hidden; margin: 8px 0 4px; }
.progress > span { display: block; height: 100%; background: var(--moss); border-radius: 6px; }

/* project stages */
.stages { display: grid; gap: 18px; }
.stage { border-left: 4px solid var(--line); padding: 2px 0 2px 18px; }
.stage .label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
.stage.issue { border-color: var(--clay); } .stage.issue .label { color: var(--clay); }
.stage.options { border-color: var(--ochre); } .stage.options .label { color: var(--warn); }
.stage.decided { border-color: var(--olive); } .stage.decided .label { color: var(--olive); }
.prose { white-space: pre-line; }
.option { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; margin-bottom: 12px; }
.option h3 { font-size: 17px; margin-bottom: 6px; }
.option .cost { background: var(--sand); border-radius: 6px; padding: 8px 12px; font-size: 14px; white-space: pre-line; margin: 8px 0; font-variant-numeric: tabular-nums; }
.pc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 14px; }
.pc b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.pc .pro b { color: var(--good); } .pc .con b { color: var(--bad); }
@media (max-width: 640px) { .pc { grid-template-columns: 1fr; } }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--moss); border: 2px solid var(--cream); }
.timeline li:last-child { border-left-color: transparent; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--linen); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--stone); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
tr.flag td { background: #F8E7DC; }
.neg { color: var(--bad); }

/* chart */
.chart-legend { display: flex; gap: 18px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.chart-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--cream); font-size: 12px; padding: 7px 10px; border-radius: 6px;
  white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; }
.chart .tip.on { opacity: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--cream); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--olive); color: var(--cream); }
.callout { border-left: 4px solid var(--clay); background: #FAEDE4; padding: 12px 16px; border-radius: 0 8px 8px 0; font-size: 14px; margin: 12px 0; }

.replies .reply { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; margin-bottom: 10px; }
.replies .reply.trustee { border-left: 4px solid var(--olive); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.empty { color: var(--stone); font-style: italic; padding: 8px 0; }
.spinner { color: var(--stone); padding: 30px 0; }

/* ---------- project page: progress notes, pinned notices, "have your say" ---------- */
.project-layout { display: grid; gap: 18px; align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); grid-template-areas: "notes pinned" "notes say"; }
.project-layout.no-pins { grid-template-areas: "notes say"; }
.project-layout.no-pins.no-say { grid-template-columns: 1fr; grid-template-areas: "notes"; }
.project-layout > .card { margin-bottom: 0; }
.pl-notes { grid-area: notes; } .pl-pinned { grid-area: pinned; } .pl-say { grid-area: say; }
.pl-pinned h2 { font-size: 18px; margin-bottom: 10px; }
.notice { background: #FBF1DC; border: 1px solid #E5CF9F; border-left: 4px solid var(--ochre); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.notice h3 { font-size: 16px; margin: 2px 0 6px; }
.notice .prose { font-size: 14px; }
.notice-tag { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--warn); }
@media (max-width: 960px) {
  .project-layout, .project-layout.no-pins { grid-template-columns: 1fr; grid-template-areas: "pinned" "notes" "say"; }
}
.tag { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 1px 8px; background: var(--linen); color: var(--ink-2);
  vertical-align: 2px; font-family: var(--sans); }
.tag.pin { background: #F2E2BC; color: var(--warn); }
.note-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 10px 0 4px; }
.checks label, .check-row { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 6px 0; }
.checks input, .check-row input { width: auto; }
.check-row.hidden { display: none !important; }

/* ---------- residents' budget: percentages ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 4px; }
.chips button { border: 1px solid var(--line); background: var(--cream); color: var(--ink-2); border-radius: 16px; padding: 5px 12px;
  font: inherit; font-size: 13px; cursor: pointer; }
.chips button:hover { background: var(--linen); }
.chips button[aria-pressed="true"] { background: var(--olive); border-color: var(--olive); color: var(--cream); }
.shares { list-style: none; margin: 8px 0 0; padding: 0; }
.shares li { display: grid; grid-template-columns: minmax(150px, 260px) 1fr 56px; gap: 12px; align-items: center; padding: 7px 0;
  border-bottom: 1px solid var(--linen); font-size: 14px; }
.shares li:last-child { border-bottom: 0; }
.shares .bar { height: 10px; background: var(--linen); border-radius: 5px; overflow: hidden; }
.shares .bar span { display: block; height: 100%; background: var(--clay); border-radius: 0 4px 4px 0; }
.shares li.other .bar span { background: var(--stone); }
.shares li.other .name { color: var(--ink-2); font-style: italic; }
.shares .pct { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 640px) {
  .shares li { grid-template-columns: 1fr 52px; gap: 4px 10px; }
  .shares .name { grid-column: 1 / -1; }
}
.chart-legend { flex-wrap: wrap; row-gap: 6px; }
.chart-legend i.sline { width: 18px; height: 0; border-top: 2px solid #8E3B6B; border-radius: 0; vertical-align: 3px; position: relative; }
.chart-legend i.sline::after { content: ""; position: absolute; left: 5px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: #8E3B6B; }
.chart-legend i.line { width: 18px; height: 0; border-top: 2px dashed var(--bark); border-radius: 0; vertical-align: 3px; }

/* ---------- rules ---------- */
.rules-status { border-left: 4px solid var(--ochre); background: #FBF1DC; border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px; margin-bottom: 18px; color: var(--bark); }
.rules-status p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.rules-status.in_force { border-left-color: var(--good); background: #E9F0DF; }
.glance { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.glance li { line-height: 1.5; }
.glance a { margin-left: 4px; white-space: nowrap; }
.rules-tools { display: flex; gap: 14px; align-items: center; margin-bottom: 4px; }
.rules-tools input { flex: 1; }
details.rule { border-top: 1px solid var(--linen); scroll-margin-top: 70px; }
details.rule:first-of-type { border-top: 0; }
details.rule > summary { cursor: pointer; padding: 12px 2px; font-weight: 600; color: var(--bark); list-style: none; display: flex; gap: 10px; align-items: center; }
details.rule > summary::-webkit-details-marker { display: none; }
details.rule > summary::before { content: "▸"; color: var(--stone); transition: transform .28s cubic-bezier(.2, .7, .2, 1); }
details.rule[open] > summary::before { transform: rotate(90deg); }
details.rule > summary:hover { color: var(--umber); }
.rule-body { padding: 0 4px 14px 22px; font-size: 14.5px; }
.rule-body p { margin: 0 0 8px; }
.rule-body h3 { font-size: 15px; margin: 14px 0 6px; }
.rule-body .r-sub { padding-left: 22px; }
.rule-body .r-bullet { padding-left: 22px; position: relative; }
.rule-body .r-bullet::before { content: "•"; position: absolute; left: 8px; color: var(--stone); }
.rule-body mark { background: #F2DDA8; color: inherit; border-radius: 2px; padding: 0 1px; }

.pct-pill { white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--bark); background: var(--linen); border-radius: 12px; padding: 3px 10px; }

/* ---------- home: drone window over your unit ---------- */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.home-main { min-width: 0; }
.drone-card { padding: 0; overflow: hidden; position: sticky; top: 20px; }
.drone-view { position: relative; height: 330px; background: #1f1a14; overflow: hidden; }
.drone-view .drone-photo { position: absolute; inset: 0; background: url(/assets/aerial.png) center/cover no-repeat;
  filter: blur(5px) brightness(.7) saturate(.85); transform: scale(1.15); transition: opacity 1.2s ease; }
.drone-view.office .drone-photo { background: linear-gradient(160deg, #5f5446, #2a231b); }
.drone-view.night .drone-photo { filter: blur(5px) brightness(.28) saturate(.5); }
.drone-view.night { background: #070b18; }
.drone-view > gmp-map-3d, .drone-view > .drone-shade, .drone-view > .drone-lights { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.drone-view.ready > gmp-map-3d, .drone-view.ready > .drone-shade, .drone-view.ready > .drone-lights { opacity: 1; }
.drone-view.ready .drone-photo { opacity: 0; }
.drone-cap { padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.drone-cap .t { font-family: var(--serif); font-size: 19px; color: var(--bark); line-height: 1.25; }
.drone-cap .meta { font-size: 13px; color: var(--stone); }
.night-tag { background: #1b2547; color: #F3E6C6; border-color: #1b2547; vertical-align: 3px; }
@media (max-width: 1100px) {
  .home-layout { grid-template-columns: 1fr; }
  .drone-card { position: static; max-width: 560px; }
  .drone-view { height: 250px; }
}

/* =====================================================================
   Additions 4 Dec 2026: notices, contacts, calendar, polls, documents,
   map, photos, dialogs, report, account, installable app
   ===================================================================== */
[hidden] { display: none !important; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 14px; color: var(--ink); margin: 14px 0 6px; cursor: pointer; }
label.check input { width: auto; margin-top: 3px; accent-color: var(--olive); }
.linkbtn.danger { color: var(--bad); }
.prose.small { font-size: 14px; color: var(--ink-2); }
@media (max-width: 640px) { .row3 { grid-template-columns: 1fr; } }

/* toast */
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--bark); color: var(--cream); padding: 10px 16px; border-radius: 9px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  font-size: 14px; transition: opacity .25s ease, transform .3s cubic-bezier(.2, .7, .2, 1); max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* sidebar: account link, install */
.who-link { display: block; color: inherit; text-decoration: none; border-radius: 7px; padding: 6px 8px; margin: 0 -8px; transition: background-color .2s ease; }
.who-link:hover { background: rgba(255, 255, 255, .06); }
.install-btn { display: block; width: 100%; margin: 10px 0 0; padding: 8px 10px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  background: var(--moss); color: #fff; border: 0; transition: background-color .2s ease; }
.install-btn:hover { background: var(--olive); }
.side-foot .ios-hint { font-size: 12px; margin: 8px 0 0; color: #EADBC4; }

/* notices */
.notices { margin: 0 0 18px; display: grid; gap: 10px; }
.notice { display: flex; gap: 12px; align-items: flex-start; border-radius: 10px; padding: 12px 14px; border: 1px solid #DDC48C; background: #F6EBCF;
  color: var(--bark); transition: opacity .25s ease, transform .25s ease; }
.notice.info { background: #EEF0E4; border-color: #CBD2B3; }
.notice.urgent { background: #F6E1D8; border-color: #E2A991; color: #6B2010; }
.notice .prose { margin-top: 3px; font-size: 14px; }
.notice .meta { margin-top: 4px; font-size: 12px; }
.notice.gone { opacity: 0; transform: translateY(-6px); }
.notice-x { border: 0; background: transparent; color: inherit; opacity: .6; cursor: pointer; padding: 4px; border-radius: 6px; line-height: 0; }
.notice-x:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
.notices-admin { margin: 0; font-size: 13px; }
.notice-row { margin-bottom: 14px; }
.notice-row > .meta { margin-top: 6px; }

/* calendar */
.cal-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 46px; padding: 4px 6px;
  border-radius: 8px; background: var(--linen); color: var(--ink-2); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; line-height: 1.2; }
.cal-chip b { font-family: var(--serif); font-size: 19px; color: var(--bark); letter-spacing: 0; font-weight: 600; }
.list a.item .cal-chip { margin-right: 4px; }
.list a.item { align-items: center; }
.cal-month { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--stone); font-family: var(--sans); font-weight: 600; margin: 18px 0 6px; }
.cal-month:first-child { margin-top: 0; }
.cal-row { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--linen); }
.cal-row:last-of-type { border-bottom: 0; }
.cal-row.meeting .cal-chip { background: #E3E6D3; }
.cal-row.admin .cal-chip { background: #F2E2BC; }
.cal-row.maintenance .cal-chip { background: #F1DCCB; }
.cal-actions { margin-top: 6px; display: flex; gap: 14px; font-size: 13px; }
.cal-actions .linkbtn, .cal-actions a { display: inline-flex; gap: 5px; align-items: center; }

/* contacts */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.contact { position: relative; border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; background: #fff; }
.contact .t { padding-right: 34px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.contact-actions .btn svg { flex: none; }
.contact .email { margin-top: 6px; word-break: break-all; }
.contact .note { margin: 6px 0 0; }
.contact .edit { position: absolute; top: 10px; right: 12px; font-size: 13px; }
.contacts.emergency { border-color: #E8BCA9; background: #FCF3EE; }
.contacts.emergency .contact { border-color: #EBC7B6; }

/* polls */
.poll-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.poll-head h2 { margin: 0 0 6px; }
.poll-opt { display: flex; gap: 10px; align-items: center; font-weight: 500; font-size: 15px; color: var(--ink); padding: 9px 12px; margin: 6px 0;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
.poll-opt:hover { border-color: var(--moss); }
.poll-opt:has(input:checked) { border-color: var(--olive); background: #F1F3E8; }
.poll-opt input { width: auto; accent-color: var(--olive); }
.poll form .btn { margin-top: 6px; }
.poll-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr 84px; gap: 12px; align-items: center; padding: 6px 0; }
.poll-row .bar { height: 12px; background: var(--linen); border-radius: 6px; overflow: hidden; }
.poll-row .bar span { display: block; height: 100%; background: var(--moss); border-radius: 6px; transform-origin: 0 50%; animation: grow-right .7s cubic-bezier(.2, .7, .2, 1) both; }
.poll-row.mine .bar span { background: var(--olive); }
.poll-row .pct { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .poll-row { grid-template-columns: 1fr 64px; } .poll-row .poll-label { grid-column: 1 / -1; } }

/* documents */
.doc-group { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--stone); font-family: var(--sans); font-weight: 600; margin: 16px 0 2px; }
.doc-group:first-of-type { margin-top: 4px; }
.doc-item { display: flex; gap: 12px; align-items: center; }

/* dialogs */
dialog.dlg { border: 0; padding: 0; border-radius: 14px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); background: var(--cream);
  color: var(--ink); box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
dialog.dlg[open] { animation: dlg-in .26s cubic-bezier(.2, .7, .2, 1); }
dialog::backdrop { background: rgba(31, 26, 20, .45); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.dlg-form { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 6px; }
.dlg-head h2 { margin: 0; }
.dlg-x { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 7px; color: var(--ink-2); line-height: 0; }
.dlg-x:hover { background: var(--linen); }
.dlg-body { padding: 0 18px 8px; overflow: auto; }
.dlg-form > .alert { margin: 4px 18px; }
.dlg-foot { display: flex; gap: 8px; align-items: center; padding: 12px 18px 16px; border-top: 1px solid var(--linen); }
dialog.map-dialog { width: min(900px, calc(100vw - 16px)); }
.map-dialog .map-box { height: min(62vh, 560px); margin: 0 18px; border-radius: 10px; overflow: hidden; background: #1f1a14; }
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; overflow: visible; }
dialog.lightbox img { display: block; max-width: 96vw; max-height: 90vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
dialog.lightbox::backdrop { background: rgba(20, 15, 10, .82); }
dialog.lightbox .dlg-x { position: absolute; top: -14px; right: -14px; background: var(--cream); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }

/* photos & location on complaints */
.photo-pick { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 2px 0 8px; }
.photo-pick label.btn { margin: 0; cursor: pointer; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 3px; right: 3px; border: 0; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center;
  background: rgba(31, 26, 20, .7); color: #fff; cursor: pointer; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 12px; }
.gallery .ph { border: 0; padding: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; cursor: zoom-in; background: var(--linen); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.gallery .ph:hover img { transform: scale(1.04); }
.loc-field { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.loc-field .btn svg, .btn svg { flex: none; }
.loc-label { font-weight: 600; color: var(--olive); font-size: 14px; }
.status-form { display: grid; gap: 10px; }
.status-form .seg { justify-self: start; flex-wrap: wrap; }

/* complex map */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.map-card { padding: 0; overflow: hidden; }
.map-box { position: relative; background: #1f1a14; }
.map-box.tall { height: min(72vh, 680px); }
.map-side h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--stone); font-family: var(--sans); font-weight: 600; margin: 16px 0 4px; }
@media (max-width: 1000px) { .map-layout { grid-template-columns: 1fr; } .map-box.tall { height: 62vh; } }
.unit-tag { pointer-events: none; font: 700 11px/1 var(--sans); color: #fff; background: rgba(74, 47, 29, .82); border: 1px solid rgba(255, 255, 255, .55);
  padding: 3px 5px; border-radius: 9px; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); white-space: nowrap; }
.unit-tag.mine { background: var(--clay); }
.unit-tag.place { background: rgba(0, 110, 158, .85); }
.unit-tag.gate { background: rgba(78, 91, 49, .92); display: inline-flex; align-items: center; gap: 3px; }
.unit-tag.refuse { background: rgba(90, 76, 63, .92); display: inline-flex; align-items: center; gap: 3px; }

/* map loading card: a little Metz Gardens scene whose bar follows the photo tiles as they download */
.map-loader { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; overflow: hidden;
  background: #2a231b; transition: opacity .5s ease; }
.map-loader::before { content: ""; position: absolute; inset: -30px; background: url(/assets/aerial.png) center/cover no-repeat;
  filter: blur(14px) brightness(.5) saturate(.7); transform: scale(1.08); animation: ml-drift 24s ease-in-out infinite alternate; }
.map-loader.out { opacity: 0; pointer-events: none; }
@keyframes ml-drift { to { transform: scale(1.16) translate(-12px, 8px); } }
.ml-card { position: relative; width: min(340px, calc(100% - 40px)); padding: 18px 20px 14px; border-radius: 14px;
  background: rgba(251, 247, 239, .94); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.ml-title { font-family: var(--serif); font-size: 19px; color: var(--bark); margin-bottom: 22px; }
.ml-track { position: relative; height: 12px; border-radius: 7px; background: var(--linen); box-shadow: inset 0 1px 2px rgba(46, 38, 32, .18); }
.ml-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 7px; }
.ml-rider { position: absolute; left: 0; bottom: 4px; transform: translateX(-60%); line-height: 0; }
.ml-line { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.ml-pct { font-variant-numeric: tabular-nums; color: var(--stone); }
.ml-text.swap { animation: ml-swap .45s ease; }
@keyframes ml-swap { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* paint: an ochre coat with a few drips, the roller at the wet edge */
.map-loader.paint .ml-fill { background: linear-gradient(180deg, #D3A24A, var(--ochre)); }
.map-loader.paint .ml-fill::after { content: ""; position: absolute; right: 18%; top: 100%; width: 3px; height: 6px; border-radius: 0 0 3px 3px; background: var(--ochre);
  box-shadow: -22px 2px 0 -0.5px var(--ochre), -51px -1px 0 0 var(--ochre); }
.map-loader.paint .ml-rider { bottom: 2px; animation: ml-roll .5s ease-in-out infinite alternate; }
@keyframes ml-roll { to { transform: translateX(-60%) translateY(-2px); } }
/* drive: tar with a dashed centre line; the bakkie drives along it */
.map-loader.drive .ml-track { background: #5a5148; }
.map-loader.drive .ml-track::after { content: ""; position: absolute; left: 6px; right: 6px; top: 5px; height: 2px;
  background: repeating-linear-gradient(90deg, #F3EBDD 0 10px, transparent 10px 20px); opacity: .7; }
.map-loader.drive .ml-fill { background: linear-gradient(90deg, rgba(186, 90, 40, 0), rgba(186, 90, 40, .55)); }
.map-loader.drive .ml-rider { bottom: 1px; animation: ml-bump .35s ease-in-out infinite alternate; }
@keyframes ml-bump { to { transform: translateX(-60%) translateY(-1.5px); } }
/* mow: freshly cut stripes behind the mower, long grass ahead */
.map-loader.mow .ml-track { background: repeating-linear-gradient(90deg, #7f8d55 0 3px, #6B7A45 3px 6px); }
.map-loader.mow .ml-fill { background: repeating-linear-gradient(90deg, #A9B38A 0 14px, #98A576 14px 28px); }
.map-loader.mow .ml-rider { bottom: 1px; animation: ml-bump .25s ease-in-out infinite alternate; }
/* pool: water rising with a gentle ripple */
.map-loader.pool .ml-track { background: #E3EEF1; }
.map-loader.pool .ml-fill { background: linear-gradient(90deg, #4a9cc0, var(--lagoon)); overflow: hidden; }
.map-loader.pool .ml-fill::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(100deg, rgba(255, 255, 255, .28) 0 6px, transparent 6px 16px);
  animation: ml-ripple 1.2s linear infinite; }
@keyframes ml-ripple { to { background-position: 32px 0; } }
.map-loader.pool .ml-rider { bottom: 6px; }
@media (prefers-reduced-motion: reduce) {
  .map-loader::before, .ml-rider, .ml-text.swap, .map-loader.pool .ml-fill::after { animation: none !important; }
}

/* message to a contact */
.msg-dialog .msg-to { margin: 0 0 6px; }
.msg-dialog textarea { min-height: 150px; }
.pin-wrap { pointer-events: none; }
.map-pin { pointer-events: auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--clay); color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); margin-bottom: 4px; }
.map-pin svg { transform: rotate(45deg); }
.map-pin.ticket { background: var(--bad); text-decoration: none; }

/* report: printing */
.flag-old { color: var(--bad); font-weight: 600; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .side, .topbar, .viewas-bar, .no-print, .route-progress, .toast { display: none !important; }
  .shell { display: block; animation: none; }
  .main { max-width: none; padding: 0; }
  #view.view-in > * { animation: none; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .tile { border: 1px solid #ccc; }
  a { color: inherit; text-decoration: none; }
  .grid.tiles { grid-template-columns: repeat(4, 1fr); }
  tr { break-inside: avoid; }
}

/* ---------- 3D walk-through (#/walk) ---------- */
.walk-stage { position: relative; height: min(78vh, 820px); min-height: 420px; border-radius: 14px; overflow: hidden; background: #1f1a14;
  box-shadow: var(--shadow); outline: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.walk-stage:fullscreen { height: 100%; border-radius: 0; }
.walk-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.walk-bar { position: absolute; z-index: 4; top: 10px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; pointer-events: none; }
.walk-bar > * { pointer-events: auto; }
.walk-bar .spacer { flex: 1; pointer-events: none; }
.walk-bar .seg { display: inline-flex; border: 0; border-radius: 9px; overflow: hidden; background: rgba(251, 247, 239, .9);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.walk-bar .seg button, .walk-editor .seg button { border: 0; background: transparent; padding: 7px 11px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.walk-bar .seg button.on, .walk-editor .seg button.on { background: var(--olive); color: var(--cream); }
.wbtn { border: 0; border-radius: 9px; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: rgba(251, 247, 239, .9); color: var(--bark); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.wbtn.edit { background: var(--clay); color: #fff; }
.walk-stage.editing .wbtn.edit { background: var(--bark); }
.walk-help { position: absolute; z-index: 3; left: 12px; bottom: 12px; max-width: calc(100% - 24px); padding: 6px 10px; border-radius: 8px;
  background: rgba(31, 26, 20, .62); color: #f3ebdd; font-size: 12px; pointer-events: none; }
.walk-note { position: absolute; z-index: 4; left: 50%; top: 60px; transform: translateX(-50%); padding: 8px 14px; border-radius: 9px;
  background: rgba(251, 247, 239, .95); color: var(--bark); font-size: 13px; box-shadow: 0 4px 16px rgba(0, 0, 0, .3); max-width: 90%; text-align: center; }
.walk-loading { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: #2a231b; transition: opacity .6s ease; }
.walk-loading::before { content: ""; position: absolute; inset: -30px; background: url(/assets/aerial.png) center/cover no-repeat;
  filter: blur(14px) brightness(.5) saturate(.7); }
.walk-loading.out { opacity: 0; pointer-events: none; }
.walk-loading .ml-fill { transition: width .4s ease; }
.walk-joy { position: absolute; z-index: 4; left: 22px; bottom: 54px; width: 116px; height: 116px; border-radius: 50%;
  background: rgba(251, 247, 239, .22); border: 2px solid rgba(251, 247, 239, .55); touch-action: none; }
.walk-joy .knob { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%;
  background: rgba(251, 247, 239, .85); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); transition: transform .08s linear; }
.walk-foot { margin-top: 8px; }
/* editor panel (trustees) */
.walk-editor { position: absolute; z-index: 6; top: 56px; right: 10px; bottom: 10px; width: 320px; display: flex; flex-direction: column;
  background: rgba(251, 247, 239, .97); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); overflow: hidden; }
.we-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 6px; font-size: 13px; }
.we-head select { font: inherit; font-size: 13px; padding: 3px 6px; margin-left: 4px; }
.we-head .dlg-x { border: 0; background: var(--linen); border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 18px; line-height: 1; }
.we-tabs { margin: 0 12px; border: 1px solid var(--line); border-radius: 9px; display: flex !important; }
.we-tabs button { flex: 1; }
.we-body { flex: 1; overflow: auto; padding: 8px 12px 12px; font-size: 14px; }
.we-body label { margin-top: 10px; }
.we-body select { width: 100%; }
.we-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 4px; font-weight: 600; font-size: 13px; }
.we-row input[type="color"] { width: 46px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.we-row input[type="range"] { flex: 1; }
.we-colour { border-bottom: 1px solid var(--linen); padding-bottom: 6px; }
.we-swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.we-swatches .sw { width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .2); cursor: pointer; padding: 0; }
.we-swatches .sw.on { outline: 2px solid var(--clay); outline-offset: 1px; }
.we-unit { background: #FBF1DC; border: 1px solid #E5CF9F; border-radius: 9px; padding: 8px 10px; margin: 8px 0; }
.we-unit h4 { margin: 0 0 4px; font-family: var(--serif); font-weight: 500; color: var(--bark); }
.we-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.we-foot { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--linen); background: var(--cream); }
.we-foot .spacer { flex: 1; }
.btn.small.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
@media (max-width: 700px) {
  .walk-stage { height: calc(100dvh - 150px); min-height: 380px; border-radius: 10px; }
  .walk-bar .seg button { padding: 6px 8px; font-size: 12px; }
  .walk-editor { top: auto; left: 8px; right: 8px; width: auto; height: 52%; bottom: 8px; }
  .walk-stage.editing .walk-joy { bottom: calc(52% + 20px); }
}
