/* Shared styles for every page: a clean, quiet look. A warm neutral
   workspace, white cards with a hairline edge, and one strong colour: the
   complex's own (--brand, set at runtime by branding.js), used for what
   matters (the page you're on, counts, the main buttons). */

:root {
  --brand: #e8622c;
  --brand-ink: #ffffff;          /* text on --brand, set for contrast */
  --accent: #f2a541;
  --bg: #f6f3ee;
  --card: #ffffff;
  --text: #1c1b19;
  --muted: #76716a;
  --line: #ece7df;
  --input-line: #dcd5ca;
  --danger: #d63c3c;
  --ok: #1f9d55;
  --info: #2f7fc1;
  --warning: #e0a106;
  --resident: #f5c518;       /* events added by residents */
  --resident-ink: #2b2300;
  --radius: 10px;
  --card-line: #ebe5dc;          /* card outlines */
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  /* Our Complex's own navy (the OCX logo), for pages that are ours rather than a complex's. */
  --ocx: #22385f;
  --ocx-deep: #121f38;
  --ocx-bright: #3b63a8;
  color-scheme: light;
}
/* Dark: <html data-theme="dark">, set by shared/theme.js from the menu's
   switch or the device setting. */
:root[data-theme="dark"] {
  --bg: #121315;
  --card: #1b1c1f;
  --text: #ededee;
  --muted: #9a9aa0;
  --line: #2a2b2f;
  --input-line: #3a3b40;
  --danger: #ef6464;
  --ok: #3cc178;
  --info: #5aa4e0;
  --warning: #f0b429;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --card-line: #27282c;
  color-scheme: dark;
}
/* Brand colours are often dark; lighten links so they stay readable. */
:where([data-theme="dark"]) a:not(.button) { color: color-mix(in srgb, var(--brand) 55%, #ffffff); }

/* DM Sans (SIL Open Font License, web/shared/fonts/OFL.txt): a clean
   geometric sans, served from this site (the CSP allows only our own fonts).
   One variable file covers every weight. */
@font-face {
  font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap;
  src: url("/shared/fonts/dm-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap;
  src: url("/shared/fonts/dm-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans"; font-style: italic; font-weight: 100 1000; font-display: swap;
  src: url("/shared/fonts/dm-sans-latin-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "DM Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 18px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15.5px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
svg.icon { flex: none; vertical-align: middle; }

/* ---------- simple pages without the sidebar (login, shared post) ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  border-top: 3px solid var(--brand);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; margin-right: auto; min-width: 0; color: var(--text); }
.topbar .brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: var(--shadow); }
.topbar .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.container { max-width: 1200px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 420px; margin: 0 auto; padding: 16px; }

/* ---------- cards ---------- */
/* Cards: flat, rounded, with a thin outline; a heading starts the card
   without a separate header bar. */
.card {
  background: var(--card); border: 1px solid var(--card-line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 16px; position: relative;
}
.card > h2:first-child, .card > .spread:first-child { margin: 0 0 14px; font-size: 16px; font-weight: 650; }
.card > .spread:first-child h2 { margin: 0; font-size: 16px; font-weight: 650; }
@media (max-width: 600px) { .card { padding: 18px; border-radius: 14px; } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spread > h1 { margin: 0; }
/* A page heading with a button beside it: keep the usual gap below it. */
.spread:has(> h1) { margin-bottom: 16px; }
.page > .spread:first-child, .page > h1:first-child { margin-bottom: 16px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs :is(a, button) {
  padding: 9px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; font-weight: 500;
}
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; min-height: 0; font-size: 15px; }
.tabs :is(a, button):hover { color: var(--text); text-decoration: none; background: none; }
.tabs :is(a, button).active { color: var(--text); font-weight: 650; border-bottom-color: var(--brand); }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
label.field .hint { display: block; font-weight: normal; color: var(--muted); font-size: 13px; margin-top: 4px; }
label.field .error { display: block; color: var(--danger); font-size: 13px; margin-top: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=url], input[type=search],
input[type=date], input[type=datetime-local], input[type=time], select, textarea {
  width: 100%; font: inherit; color: inherit; background: var(--card);
  padding: 8px 12px; border: 1px solid var(--input-line); border-radius: var(--radius); min-height: 40px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
button:focus-visible, .button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
textarea { min-height: 90px; resize: vertical; }
input[type=color] { width: 48px; height: 38px; padding: 2px; border: 1px solid var(--input-line); border-radius: var(--radius); background: var(--card); }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix > span {
  display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--input-line); border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius); background: var(--bg); color: var(--muted); font-size: 14px; white-space: nowrap;
}
.input-prefix > input { border-radius: 0 var(--radius) var(--radius) 0; }
.input-suffix > span { order: 2; border: 1px solid var(--input-line); border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.input-suffix > input { border-radius: var(--radius) 0 0 var(--radius); }
.code-input { font-size: 28px !important; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; }

button, .button {
  font: inherit; font-size: 14.5px; font-weight: 550; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 15px; border-radius: var(--radius); border: 1px solid var(--input-line); background: var(--card); color: var(--text);
  text-decoration: none; min-height: 40px; line-height: 1.4; transition: background .15s, border-color .15s, filter .15s;
}
button:hover, .button:hover { text-decoration: none; border-color: color-mix(in srgb, var(--text) 25%, var(--input-line)); background: color-mix(in srgb, var(--text) 3%, var(--card)); }
/* Action buttons: a flat solid colour. primary = add / save / go (the
   complex's colour), edit = amber, danger = delete / remove (red). */
button.primary, .button.primary { --btn: var(--brand); --btn-ink: var(--brand-ink); }
button.edit, .button.edit { --btn: #d9770b; --btn-ink: #ffffff; }
button.danger, .button.danger { --btn: var(--danger); --btn-ink: #ffffff; }
:is(button, .button):is(.primary, .edit, .danger) {
  background: var(--btn); border-color: var(--btn); color: var(--btn-ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .12), inset 0 1px 0 rgba(255, 255, 255, .12);
}
:is(button, .button):is(.primary, .edit, .danger):hover { background: var(--btn); border-color: var(--btn); filter: brightness(.94); }
:is(button, .button):is(.primary, .edit, .danger):active { filter: brightness(.88); }
:is(button, .button):is(.primary, .edit, .danger):disabled { filter: none; }
button.link { border: 0; background: none; color: var(--brand); padding: 0; min-height: 0; text-decoration: underline; }
button.small, .button.small { padding: 4px 11px; min-height: 32px; font-size: 13px; border-radius: 9px; }
button:disabled { opacity: .55; cursor: default; filter: none; }
.block { width: 100%; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
/* Lists you can reorder (shared/sortable.js): a six-dot handle on the left to
   drag a row, and the row's action icons flush against the right. */
.drag-handle {
  flex: none; width: 28px; height: 36px; padding: 0; margin-left: -6px; border: 0; background: none; box-shadow: none;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
  cursor: grab; touch-action: none; border-radius: 8px;
}
.drag-handle:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); filter: none; }
.sorting, .sorting * { cursor: grabbing !important; user-select: none; }
.list > li.dragging {
  position: relative; z-index: 1; background: var(--card); border-radius: 12px; border-bottom-color: transparent;
  box-shadow: 0 8px 24px rgba(0,0,0,.18), 0 0 0 1px var(--card-line);
}
.row-actions { flex: none; margin-left: auto; display: flex; align-items: center; gap: 2px; }
.icon-button {
  width: 36px; height: 36px; min-height: 0; padding: 0; border: 0; border-radius: 10px; background: none; box-shadow: none;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
}
.icon-button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); filter: none; }
.icon-button.icon-danger { color: var(--danger); }
.icon-button.icon-danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.icon-button:disabled { opacity: .35; cursor: not-allowed; background: none; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; overflow-wrap: anywhere; }
a.rowlink { color: inherit; text-decoration: none; }
a.rowlink:hover .title { color: var(--brand); }
.thumb { width: 44px; height: 44px; border-radius: var(--radius); object-fit: cover; background: var(--line); flex: none; }

/* Badges (AdminLTE "badge") */
/* Pills: a soft tint of their colour, with the text in a deeper shade. */
.pill { --pill: var(--muted); display: inline-block; font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 999px; margin-left: 6px; white-space: nowrap;
  background: color-mix(in srgb, var(--pill) 14%, transparent); color: color-mix(in srgb, var(--pill) 75%, var(--text)); }
.pill.ok { --pill: var(--ok); }
.pill.warn { --pill: var(--warning); }
.pill.bad, .pill.danger { --pill: var(--danger); }

/* ---------- small boxes (dashboard tiles) ---------- */
.small-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
/* Stat tiles: a flat card with a big number, a label, the icon in a tinted
   square and a link in the tile's colour (--tile, from its bg-* class). */
.small-box {
  position: relative; display: block; text-decoration: none; overflow: hidden;
  background: var(--card); color: var(--text); border: 1px solid var(--card-line); border-radius: 16px;
  box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.small-box:hover { text-decoration: none; border-color: color-mix(in srgb, var(--tile) 45%, var(--card-line)); transform: translateY(-1px); }
.small-box .inner { padding: 16px 70px 8px 18px; }
.small-box .inner b { display: block; font-size: 30px; font-weight: 700; line-height: 1.15; color: var(--text); }
.small-box .inner span { font-size: 14px; color: var(--muted); }
.small-box svg.icon {
  position: absolute; right: 16px; top: 16px; width: 42px; height: 42px; padding: 9px; border-radius: 10px;
  color: color-mix(in srgb, var(--tile) 85%, var(--text)); background: color-mix(in srgb, var(--tile) 14%, transparent);
}
.small-box .more { display: block; padding: 0 18px 14px; font-size: 13.5px; font-weight: 600; color: color-mix(in srgb, var(--tile) 75%, var(--text)); }
.bg-info { --tile: var(--info); }
.bg-success { --tile: var(--ok); }
.bg-warning { --tile: #d39e00; }
.bg-danger { --tile: var(--danger); }
.bg-brand { --tile: var(--brand); }

/* ---------- feedback ---------- */
/* Notices: a soft tint of their colour with a matching edge. */
.notice {
  --note: var(--warning);
  padding: 13px 16px; border-radius: 12px; margin-bottom: 16px;
  background: color-mix(in srgb, var(--note) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--note) 28%, var(--card-line));
}
.notice.error { --note: var(--danger); }
.notice.warning { --note: var(--warning); margin-bottom: 12px; }
.notice > p:last-child { margin-bottom: 0; }
#toast {
  position: fixed; right: 16px; top: 70px; z-index: 100;
  background: #1c1b19; color: #fff; padding: 11px 16px 11px 14px; border-radius: 12px; max-width: min(360px, calc(100vw - 32px));
  box-shadow: 0 12px 32px -8px rgba(0,0,0,.35); border-left: 4px solid var(--ok); font-weight: 500;
}
#toast.error { border-left-color: var(--danger); }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }

/* ---------- login ---------- */
/* The suburb photo (by day, or in the evening in dark mode) fades into a
   plain area holding the form: white by day, a deep near-black grey in dark
   mode (--login-bg).
   - Phones: the photo fills the top of the screen and fades down into the form.
   - Desktop (900px and wider): the form sits centred in the left half and the
     photo fills the right half, fading into the form. The terms of use, shown
     after logging in when they're new, open over the photo on the right.
   The photo comes in the size closest to the screen, so it's never blurry.
   The form is centred with auto margins (not align-items), so a tall form on a
   short screen still scrolls to its top instead of being cut off. */
body.login-page {
  --login-photo: url('/shared/login-day-1280.jpg');
  --login-photo-bg: #8a9aa8;
  --login-bg: var(--card);
  position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: 0 16px; background: var(--login-bg);
}
@media (min-width: 900px), (min-resolution: 2dppx) { body.login-page { --login-photo: url('/shared/login-day-1920.jpg'); } }
@media (min-width: 1700px), (min-width: 1100px) and (min-resolution: 1.5dppx) { body.login-page { --login-photo: url('/shared/login-day-2560.jpg'); } }
:where([data-theme="dark"]) body.login-page { --login-photo: url('/shared/login-evening-1280.jpg'); --login-photo-bg: #1a2742; --login-bg: #0b0c0e; }
@media (min-width: 900px), (min-resolution: 2dppx) { :where([data-theme="dark"]) body.login-page { --login-photo: url('/shared/login-evening-1920.jpg'); } }
@media (min-width: 1700px), (min-width: 1100px) and (min-resolution: 1.5dppx) { :where([data-theme="dark"]) body.login-page { --login-photo: url('/shared/login-evening-2560.jpg'); } }
body.login-page::before {
  content: ""; position: absolute; z-index: 0; left: 0; right: 0; top: 0; height: 50vh; height: 50svh; pointer-events: none;
  background: var(--login-photo-bg) var(--login-photo) center 40% / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 40%, transparent 92%);
}
/* On phones the form starts where the photo has faded out. */
.login-page > main {
  position: relative; z-index: 1; width: 100%; max-width: 400px; margin: 0 auto auto; padding: 38vh 4px 18px;
  padding-top: 38svh;
}
.login-head { text-align: center; margin: 0 0 22px; }
.login-head img, .login-head .mark {
  width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 14px; display: block;
  border: 4px solid var(--login-bg, var(--card)); box-shadow: 0 6px 20px rgba(0,0,0,.18); background: #fff; object-fit: cover;
}
.login-head .mark {
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: var(--brand-ink); font-size: 32px; font-weight: 700;
}
.login-head .mark[hidden], .login-head img[hidden] { display: none; }
/* Our Complex's own logo (light and dark versions, transparent), without the tile. */
.login-head .login-logo { display: flex; justify-content: center; margin: 0 0 14px; }
.login-head .login-logo[hidden] { display: none; }
.login-head .login-logo img { width: auto; height: 104px; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: none; object-fit: contain; }
.login-head h1 { font-size: 32px; font-weight: 600; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 8px; }
.login-head p { margin: 0 auto; max-width: 320px; }
.login-page .card { background: none; box-shadow: none; border: 0; padding: 0; margin: 0 0 18px; }
.login-page .card > h2:first-child { margin: 0 0 12px; padding: 0; border: 0; }
.login-page input { min-height: 50px; border-radius: 14px; padding-left: 16px; padding-right: 16px; }
/* Full-width buttons are tall pills, as in the reference design. */
.login-page button.block, .login-page .join-link .button { min-height: 50px; border-radius: 999px; font-weight: 600; }
.login-page .join-link .button { min-height: 0; padding: 6px 14px; }
@media (min-width: 900px) {
  /* The form fills the left half, centred in it; the photo the right half. */
  body.login-page { padding: 0; }
  body.login-page::before {
    position: fixed; left: 50%; bottom: 0; height: auto;
    -webkit-mask-image: linear-gradient(to left, #000 70%, transparent 100%);
    mask-image: linear-gradient(to left, #000 70%, transparent 100%);
  }
  .login-page > main {
    width: 50%; max-width: none; margin: auto 50% auto 0;
    padding: 48px max(32px, calc(25% - 200px)) 18px;
  }
  /* The terms open over the photo, so the login form stays in view beside them. */
  .login-page dialog.terms-sheet { left: calc(50% + 8px); }
  .login-page dialog.terms-sheet::backdrop { background: rgba(15, 15, 18, .2); }
}

/* The Our Complex wordmark (the long logo), in two versions: dark letters for
   light mode and white letters for dark mode. Only the one for the current
   mode shows. Used under the login button and in the top bar. */
.wordmark { display: inline-flex; align-items: center; }
.wordmark img { display: block; height: 24px; width: auto; }
.wordmark .for-dark { display: none; }
:where([data-theme="dark"]) .wordmark .for-light { display: none; }
:where([data-theme="dark"]) .wordmark .for-dark { display: block; }
.login-wordmark { display: flex; justify-content: center; margin: 26px 0 0; }
.login-wordmark img { height: 26px; }
/* Not twice: where our full logo heads the page, the wordmark below would repeat it. */
.login-page:has(#oc-logo:not([hidden])) .login-wordmark { display: none; }

/* Links styled as tiles keep their own colours (beats the dark-mode link colour). */
a.small-box, a.small-box:hover { color: var(--text); }
#view > .spread:first-child, #view > h1:first-child { margin-bottom: 16px; }
.small-box .inner b { font-size: clamp(24px, 3vw, 30px); }
/* Grid cells and inputs may shrink below their natural width (date pickers
   are wide), so fields never spill out of their card. */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
input, select, textarea { min-width: 0; max-width: 100%; }

.center { text-align: center; }
/* ---------- legal pages (privacy notice, terms of use) ----------
   A plain document layout: a slim top bar with the Our Complex logo, a navy
   band with the title, then the text in one readable column beside a sticky
   "On this page" list (hidden on phones). Sections are plain, not cards.
   The navy is Our Complex's own (--ocx), not a complex's --brand. */
.legal-page { background: var(--card); }
.legal-wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.legal-top { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
.legal-top .legal-wrap { display: flex; align-items: center; gap: 32px; height: 64px; }
.legal-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; text-decoration: none; }
.legal-brand:hover { color: var(--text); text-decoration: none; }
.legal-brand .wordmark img { height: 22px; }
.legal-top nav { display: flex; gap: 22px; }
.legal-top nav a { color: var(--muted); font-weight: 500; font-size: 15px; text-decoration: none; }
.legal-top nav a:hover, .legal-top nav a[aria-current="page"] { color: var(--text); }
.legal-top nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--ocx-bright); padding-bottom: 4px; }
.legal-login { margin-left: auto; font-weight: 600; font-size: 15px; }
.legal-hero { color: #fff; background: linear-gradient(120deg, var(--ocx-deep), var(--ocx) 60%, var(--ocx-bright)); }
.legal-hero .legal-wrap { padding-top: 64px; padding-bottom: 68px; }
.legal-hero h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; margin: 0; }
.legal-hero p { margin: 16px 0 0; max-width: 40em; font-size: 18px; line-height: 1.55; color: rgba(255,255,255,.86); }
.legal-hero .legal-meta { margin-top: 14px; font-size: 14.5px; color: rgba(255,255,255,.68); }
.legal-doc .legal-wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; align-items: start; padding-top: 56px; padding-bottom: 88px; }
.legal-toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; }
.legal-toc p { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.legal-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.legal-toc a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text); font-size: 14px; line-height: 1.35; text-decoration: none; }
.legal-toc a:hover { background: color-mix(in srgb, var(--ocx-bright) 12%, transparent); text-decoration: none; }
main.legal { max-width: 46em; font-size: 16.5px; line-height: 1.7; }
main.legal section { scroll-margin-top: 84px; }
main.legal section + section { margin-top: 44px; }
main.legal h2 { font-size: 24px; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; margin: 0 0 12px; padding: 0; border: 0; }
main.legal p { margin: 0; }
main.legal p + p, main.legal p + ul, main.legal ul + p { margin-top: 12px; }
main.legal ul { padding-left: 1.2em; margin: 0; }
main.legal li + li { margin-top: 8px; }
main.legal ul ul { margin-top: 6px; }
.legal-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14.5px; }
.legal-foot .legal-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 28px; padding-bottom: 32px; }
.legal-foot p { margin: 0; }
.legal-foot b { color: var(--text); }
@media (max-width: 900px) {
  .legal-doc .legal-wrap { grid-template-columns: minmax(0, 1fr); padding-top: 36px; }
  .legal-toc { display: none; }
}
@media (max-width: 640px) {
  .legal-wrap { padding: 0 16px; }
  .legal-top .legal-wrap { gap: 16px; height: 56px; }
  .legal-brand > span:last-child { display: none; }
  .legal-top nav { gap: 14px; }
  .legal-top nav a, .legal-login { font-size: 14px; }
  .legal-hero .legal-wrap { padding-top: 40px; padding-bottom: 44px; }
  .legal-hero p { font-size: 16.5px; }
  main.legal { font-size: 16px; }
  main.legal h2 { font-size: 21px; }
}
/* Printed (or saved as PDF): plain black on white, just the document. */
@media print {
  @page { margin: 18mm 16mm; }
  body.legal-page { background: #fff; color: #000; }
  .legal-top, .legal-toc, .legal-foot, .legal-page .emergency-bar { display: none; }
  .legal-hero { background: none; color: #000; }
  .legal-hero .legal-wrap, .legal-doc .legal-wrap { padding: 0 0 12px; display: block; max-width: none; }
  .legal-hero p, .legal-hero .legal-meta { color: #000; }
  main.legal { max-width: none; }
  main.legal h2 { break-after: avoid; }
  .legal-page a { color: inherit; }
}
.login-page .app-version { margin-top: -10px; font-size: 12px; }

/* National emergency numbers along the bottom of the privacy and terms pages
   (not the login or join pages, where they could be tapped by accident).
   Sticky: it stays on screen while scrolling, and at the end of the page it
   sits in its own space below the content, so it never covers the last lines. */
.emergency-bar {
  position: sticky; bottom: 0; z-index: 20; box-shadow: 0 -4px 14px rgba(0,0,0,.25);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 12px;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom)); background: #7a1f2b; color: #fff; font-size: 14px;
}
.emergency-bar strong { text-transform: uppercase; letter-spacing: .06em; font-size: 12.5px; }
.emergency-bar a, .emergency-bar a:hover {
  color: #fff; text-decoration: none; white-space: nowrap;
  padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.16);
}
.emergency-bar a:hover { background: rgba(255,255,255,.28); }
.emergency-bar b { font-weight: 700; margin-left: 4px; }
@media (max-width: 480px) {
  .emergency-bar { gap: 6px; padding-top: 8px; font-size: 13px; }
  .emergency-bar strong { width: 100%; text-align: center; font-size: 11.5px; }
  .emergency-bar a { padding: 4px 9px; }
}

/* Register to join (web/join) and its link on the login page. */
.join-link { margin: 4px 0 18px; }
.join-link .button { margin-left: 6px; }
input.join-code { text-transform: uppercase; letter-spacing: .12em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.join-code-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.join-code-box code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; letter-spacing: .12em; padding: 4px 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.login-page .trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Pop-up forms (report, remove, reject...). */
dialog.sheet { border: 1px solid var(--card-line); border-radius: 18px; padding: 0; width: min(500px, calc(100vw - 32px)); background: var(--card); color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.3); }
dialog.sheet form { padding: 20px 22px; }
dialog.sheet h2 { margin: 0 0 14px; font-size: 17px; font-weight: 600; }
dialog.sheet::backdrop { background: rgba(15, 15, 18, .45); backdrop-filter: blur(2px); }
/* Terms of use: the whole screen (less a margin) over a solid backdrop, so
   nothing behind it shows or can be clicked until it's accepted or declined. */
dialog.terms-sheet { width: auto; height: auto; max-width: none; max-height: none; position: fixed; inset: 16px; margin: 0; }
dialog.terms-sheet::backdrop { background: var(--bg, #1f2d3d); opacity: 1; }
dialog.terms-sheet[open] { display: flex; }
dialog.terms-sheet form { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0; }
.terms-sheet header, .terms-sheet footer { padding: 18px 24px; }
.terms-sheet header { border-bottom: 1px solid var(--line); }
.terms-sheet header h2 { font-size: 22px; margin-bottom: 8px; }
.terms-sheet header p { margin: 0; }
.terms-sheet footer { border-top: 1px solid var(--line); }
.terms-sheet footer .notice { margin: 0 0 12px; }
.terms-body { flex: 1; overflow-y: auto; padding: 18px 24px; }
.terms-body > ul { padding-left: 18px; margin: 0 0 12px; }
.terms-body li { margin-bottom: 6px; }
.terms-full { max-width: 820px; }
.terms-full h3 { margin: 20px 0 12px; }
.terms-full section + section { margin-top: 22px; }
.terms-full h2 { font-size: 17px; margin: 0 0 8px; }
.terms-actions { justify-content: flex-end; }
@media (max-width: 600px) {
  dialog.terms-sheet { inset: 8px; }
  .terms-sheet header, .terms-sheet footer, .terms-body { padding: 14px 16px; }
  .terms-actions > button { flex: 1; }
}

/* Chips: small rounded filter buttons; the chosen one is the complex's colour.
   (.chips in the consoles, .chip-row in the marketplace, .filter-chip in services.) */
:is(.chips, .chip-row) :is(button, a.button), .filter-chip {
  min-height: 34px; padding: 4px 14px; font-size: 13.5px; font-weight: 600; border-radius: 999px;
  border: 1px solid var(--card-line); background: var(--card); color: var(--text);
}
:is(.chips, .chip-row) :is(button, a.button):hover, .filter-chip:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--card-line)); background: var(--card); }
:is(.chips, .chip-row) :is(button, a.button).on, .filter-chip.on,
:is(.chips, .chip-row) :is(button, a.button).on:hover, .filter-chip.on:hover { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* Tick boxes and radio buttons: the browser default (13px) is hard to see and tap. */
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--brand); cursor: pointer; }
.check { align-items: center; }
.check input[type=checkbox], .check input[type=radio] { margin-top: 0; }
/* A group of radio choices under a bold heading, without the browser's box. */
fieldset.plain { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset.plain legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }

/* Login code step: the help line, then two equal buttons side by side. */
.code-help { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; }
.code-help p { margin: 0 0 10px; }
.code-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.code-actions button { width: 100%; }
@media (max-width: 360px) { .code-actions { grid-template-columns: 1fr; } }
/* Keep the countdown's digits from making the button jiggle. */
#resend { font-variant-numeric: tabular-nums; }

/* Director portfolios: tags beside a name, and the dropdown picker (admin and manager). */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: color-mix(in srgb, var(--brand) 70%, var(--text)); }
.portfolio-picker { margin-bottom: 14px; }
.portfolio-picker > span { display: block; margin-bottom: 6px; }
.portfolio-selects { display: grid; gap: 8px; margin-bottom: 8px; max-width: 460px; }
.portfolio-select { display: flex; gap: 8px; align-items: center; }
.portfolio-select select, .portfolio-select .dropdown { flex: 1; min-width: 0; }

/* Tag picker (service providers): chosen tags with ×, then suggestions to tap. */
.tag-input-chosen { margin: 0 0 8px; min-height: 0; }
.tag-input-chosen:empty { display: none; }
.tag.tag-removable { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 3px 4px 3px 10px; }
.tag.tag-removable button { border: 0; background: none; padding: 0 4px; min-height: 0; font-size: 16px; line-height: 1; cursor: pointer; color: inherit; }
.tag-input-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-suggestion { min-height: 0; padding: 3px 10px; font-size: 12.5px; border-radius: 999px; border: 1px dashed var(--line); background: none; color: var(--muted); cursor: pointer; }
.tag-suggestion:hover { border-color: var(--brand); color: var(--text); }

/* Label/value lists (marketplace items, applications, suggestions). */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

/* Suggestions: one line each (title, who; up and down votes), click to open. */
.suggestion-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.suggestion { background: var(--card); border: 1px solid var(--card-line, var(--line)); border-radius: 12px; overflow: hidden; }
.suggestion-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 4px; }
.suggestion-title { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; column-gap: 8px; text-align: left; background: none; border: 0;
  padding: 6px 10px; min-height: 0; color: inherit; cursor: pointer; border-radius: 8px; font: inherit; }
.suggestion-title:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.suggestion-title .icon { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--muted); transition: transform .15s; }
.suggestion-title[aria-expanded=true] .icon { transform: rotate(180deg); }
.suggestion-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-body { padding: 4px 16px 14px; border-top: 1px solid var(--line); }
.suggestion-body .facts { margin-top: 12px; }
.votes { display: flex; gap: 6px; flex: none; }
.vote { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; min-width: 56px; justify-content: center; padding: 4px 10px;
  border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); font-weight: 700; font-size: 14px; }
button.vote { cursor: pointer; }
button.vote:hover { border-color: var(--text); color: var(--text); }
.vote.up.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.vote.down.on { background: var(--danger); border-color: var(--danger); color: #fff; }
@media (max-width: 520px) {
  .suggestion-row { flex-wrap: wrap; padding-left: 4px; }
  .votes { margin-left: 10px; }
}

/* Dropdowns (shared/dropdown.js): a button like the other fields, and a list that opens below it. */
.dropdown { position: relative; width: 100%; min-width: 0; }
.dropdown-native { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropdown-button { width: 100%; justify-content: space-between; text-align: left; gap: 8px; padding: 8px 10px 8px 12px; line-height: inherit;
  background: var(--card); border: 1px solid var(--input-line); color: var(--text); font-weight: 400; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.dropdown-button:hover { filter: none; background: var(--card); border-color: color-mix(in srgb, var(--brand) 45%, var(--input-line)); }
.dropdown-button:focus-visible, .dropdown.open .dropdown-button { outline: 0; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.dropdown-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-label.placeholder { color: var(--muted); }
.dropdown-button .icon { flex: none; color: var(--muted); transition: transform .15s; }
.dropdown.open .dropdown-button .icon { transform: rotate(180deg); }
.dropdown-menu { position: fixed; z-index: 1000; overflow-y: auto; box-sizing: border-box;
  margin: 0; padding: 4px; list-style: none; background: var(--card); border: 1px solid var(--card-line); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .08); }
.dropdown-menu li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 6px;
  cursor: pointer; font-size: 15px; line-height: 1.35; }
.dropdown-menu li.active { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.dropdown-menu li.selected { font-weight: 600; }
.dropdown-menu li .icon { flex: none; color: var(--brand); }
/* A text box with suggestions: the same list, and an arrow to show them all. */
.dropdown.suggest > input { padding-right: 38px; }
.suggest-toggle { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 36px; min-height: 0; padding: 0; border: 0; background: none;
  color: var(--muted); border-radius: 0 var(--radius) var(--radius) 0; }
.suggest-toggle:hover { color: var(--text); filter: none; }
.dropdown.suggest.open .suggest-toggle .icon { transform: rotate(180deg); }
.suggest-toggle .icon { transition: transform .15s; }

/* Invoices */
.table-scroll { overflow-x: auto; margin: 0 -4px; }
/* Subscription page: the button under the features, for the ticked ones. */
.add-features { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.invoice-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.invoice-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.invoice-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.invoice-table tr:last-child td { border-bottom: 0; }
.invoice-table .num { text-align: right; white-space: nowrap; }
.invoice-table .actions { text-align: right; padding-left: 16px; }
.invoice-table .pill { margin-left: 0; }
.pager { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Summary cards: two cards side by side (one on a phone), each with a big
   figure, e.g. the Subscription overview's plan and next payment. */
.summary-cards { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; margin-bottom: 16px; }
.summary-cards > .card { margin: 0; display: flex; flex-direction: column; }
.summary-cards > .card > :last-child { margin-bottom: 0; }
@media (max-width: 720px) { .summary-cards { grid-template-columns: minmax(0, 1fr); } }
.figure { margin: 4px 0 6px; line-height: 1.15; }
.figure b { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; letter-spacing: -.01em; }
.figure-unit { color: var(--muted); font-size: 16px; font-weight: 500; }
.figure-meta { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.figure-meta .icon { color: var(--muted); }
.figure-meta .pill { margin-left: 0; }
.summary-cards .card > .button:last-child { margin-top: auto; align-self: flex-start; }
.invoice-rows .invoice-amount { font-weight: 600; white-space: nowrap; }
.invoice-table .nowrap { white-space: nowrap; }
@media (max-width: 480px) {
  .invoice-rows > li { flex-wrap: wrap; }
  .invoice-rows .grow { flex-basis: calc(100% - 120px); }
}

/* Conversations between residents and directors */
.conversation-list li.unread .title { font-weight: 700; }
.conversation-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.conversation { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 16px; }
.bubble { max-width: min(560px, 85%); padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--card-line); }
.bubble.mine { align-self: flex-end; background: color-mix(in srgb, var(--brand) 14%, var(--card)); border-color: color-mix(in srgb, var(--brand) 30%, var(--card-line)); }
.bubble.theirs { align-self: flex-start; }
.bubble-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.bubble-body p { margin: 0 0 6px; overflow-wrap: anywhere; }
.bubble-body p:last-child { margin-bottom: 0; }
.conversation-reply textarea { width: 100%; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: var(--brand-ink, #fff); font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }

/* A card in parts, each below a thin rule. */
.card-section { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; }
.card-section > h3 { margin-bottom: 4px; }
.card-section > p.small { margin-bottom: 12px; }

/* A row that opens to show more (e.g. the fee, line by line). */
details.disclosure > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 1px solid var(--card-line); border-radius: 12px; background: color-mix(in srgb, var(--text) 2%, var(--card));
  transition: background .15s, border-color .15s;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary:hover { border-color: var(--input-line); }
details.disclosure > summary > span { color: var(--muted); }
details.disclosure > summary > b { margin-left: auto; font-weight: 650; }
details.disclosure > summary > .icon { color: var(--muted); transition: transform .15s; }
details.disclosure[open] > summary > .icon { transform: rotate(180deg); }
details.disclosure[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details.disclosure > :not(summary) { border: 1px solid var(--card-line); border-top: 0; border-radius: 0 0 12px 12px; padding: 4px 14px 6px; margin: 0; }
