/* HouseLedger design system (resident screens).
   Tokens generated from the design system tokens.json; components = its bundle.css as is. */

/* Light only: the designs are light, and in the dark theme `brand` (a
   background colour) became the text colour of gate buttons and the
   active tab — almost invisible. Dark tokens stay in tokens.json. */
:root {
  color-scheme: light;
  --surface: #f6f5f2;
  --surface-raised: #ffffff;
  --surface-sunken: #efede8;
  --line: #e3e0d9;
  --line-strong: #8f8a80;
  --ink: #1c2430;
  --ink-muted: #5b6472;
  --brand: #1f3a5c;
  --on-brand: #ffffff;
  --on-brand-muted: #c5d3e6;
  --money: #137a4f;
  --money-soft: #e4f3ea;
  --promise: #8a5a00;
  --promise-soft: #fdf3dc;
  --promise-line: #a37400;
  --problem: #b42318;
  --problem-soft: #fdecea;
  --focus: #1f5fbf;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(28,36,48,0.06);
  --shadow-pop: 0 8px 24px rgba(28,36,48,0.16);
  --font-sans: Heebo, "Segoe UI", Arial, system-ui, sans-serif;
}

/* HouseLedger — component classes. Plain CSS for server-rendered EJS pages; RTL via logical properties. */

.hl { font-family: var(--font-sans); color: var(--ink); font-size: 15px; line-height: 22px; }
.hl *, .hl *::before, .hl *::after { box-sizing: border-box; }
.hl :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Amount ---------- */
.hl-amt { unicode-bidi: isolate; direction: ltr; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; color: var(--ink); }
.hl-amt--in { color: var(--money); }
.hl-amt--charge { color: var(--ink); }
.hl-amt--promise { color: var(--promise); }
.hl-amt--problem { color: var(--problem); }
.hl-amt--void { color: var(--ink-muted); text-decoration: line-through; font-weight: 400; }
.hl-amt--hero { font-size: 34px; line-height: 40px; font-weight: 700; }

/* ---------- StatusPill ---------- */
.hl-pill { display: inline-flex; align-items: center; gap: var(--space-1); padding: 1px 8px; border-radius: var(--radius-sm); font-size: 13px; line-height: 20px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.hl-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.hl-pill--money { background: var(--money-soft); color: var(--money); }
.hl-pill--promise { background: var(--promise-soft); color: var(--promise); border: 1px dashed var(--promise-line); }
.hl-pill--problem { background: var(--problem-soft); color: var(--problem); }
.hl-pill--neutral { background: var(--surface-sunken); color: var(--ink-muted); }
.hl-pill--void { background: transparent; color: var(--ink-muted); border-color: var(--line); text-decoration: line-through; }
.hl-pill--void::before { display: none; }

/* ---------- Button ---------- */
.hl-btn { font: inherit; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.hl-btn--primary { background: var(--brand); color: var(--on-brand); }
.hl-btn--secondary { background: var(--surface-raised); color: var(--ink); border-color: var(--line-strong); }
.hl-btn--ghost { background: transparent; color: var(--ink); }
.hl-btn--ghost:hover, .hl-btn--secondary:hover { background: var(--surface-sunken); }
.hl-btn--danger { background: var(--surface-raised); color: var(--problem); border-color: var(--problem); }
.hl-btn--icon { width: 40px; padding: 0; font-size: 20px; line-height: 1; }
.hl-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Row menu: danger actions live here, never as an inline button */
.hl-menu { position: relative; display: inline-block; }
.hl-menu__list { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); min-width: 180px; margin: 0; padding: var(--space-1); list-style: none; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); z-index: 10; }
.hl-menu__item { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: var(--space-2) var(--space-3); border: 0; background: none; font: inherit; color: var(--ink); text-align: start; border-radius: var(--radius-sm); cursor: pointer; }
.hl-menu__item:hover { background: var(--surface-sunken); }
.hl-menu__sep { height: 1px; background: var(--line); margin: var(--space-1) 0; }
.hl-menu__item--danger { color: var(--problem); }
.hl-menu__item--danger:hover { background: var(--problem-soft); }

/* ---------- Card ---------- */
.hl-card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }

/* ---------- AccountHero ---------- */
.hl-hero { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6) var(--space-4); }
.hl-hero--ok { background: var(--money-soft); border-color: transparent; }
.hl-hero--problem { background: var(--problem-soft); border-color: transparent; }
.hl-hero__verdict { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.hl-hero--ok .hl-hero__verdict { color: var(--money); }
.hl-hero--problem .hl-hero__verdict { color: var(--problem); }
.hl-hero__icon { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: currentColor; flex: none; }
.hl-hero__icon svg { width: 14px; height: 14px; stroke: var(--surface-raised); fill: none; stroke-width: 2.5; }
.hl-hero__main { margin: var(--space-2) 0 0; font-size: 28px; line-height: 36px; font-weight: 700; color: var(--ink); }
.hl-hero__facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin: var(--space-6) 0 0; padding: var(--space-4) 0 0; border-top: 1px solid var(--line); }
.hl-hero--ok .hl-hero__facts, .hl-hero--problem .hl-hero__facts { border-top-color: rgba(127,127,127,.28); }
.hl-hero__facts dt { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-muted); }
.hl-hero__facts dd { margin: 2px 0 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.hl-hero__note { margin: 2px 0 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }

/* ---------- MonthGroup ---------- */
.hl-month { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.hl-month__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); padding: var(--space-2) var(--space-4); background: var(--surface-sunken); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-muted); }
.hl-month__title { color: var(--ink); font-size: 13px; font-weight: 600; }
.hl-month__list { list-style: none; margin: 0; padding: 0; }
.hl-month__list > li + li { border-top: 1px solid var(--line); }

/* ---------- LedgerRow ---------- */
.hl-row { display: grid; grid-template-columns: 1fr auto; column-gap: var(--space-3); row-gap: 2px; padding: var(--space-3) var(--space-4); }
.hl-row__title { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-row__amt { grid-column: 2; grid-row: 1; text-align: end; }
.hl-row__meta { grid-column: 1 / -1; font-size: 13px; line-height: 18px; color: var(--ink-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.hl-row__meta .hl-pill { font-size: 12px; line-height: 18px; padding: 0 6px; }
.hl-row--void .hl-row__title { color: var(--ink-muted); text-decoration: line-through; }
.hl-row details { grid-column: 1 / -1; }
.hl-row summary { cursor: pointer; font-size: 13px; color: var(--ink-muted); list-style: none; width: fit-content; }
.hl-row summary::-webkit-details-marker { display: none; }
.hl-row summary::after { content: " ▾"; }
.hl-row details[open] summary::after { content: " ▴"; }
.hl-row__details { margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3); background: var(--surface-sunken); border-radius: var(--radius-sm); font-size: 13px; line-height: 20px; color: var(--ink-muted); display: grid; grid-template-columns: auto 1fr; gap: 2px var(--space-3); }
.hl-row__details dt { color: var(--ink-muted); }
.hl-row__details dd { margin: 0; color: var(--ink); }
.hl-src { display: inline-flex; align-items: center; gap: 3px; }
.hl-src svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---------- CheckCard ---------- */
.hl-check { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--promise-soft); border: 1.5px dashed var(--promise-line); }
.hl-check__no { font-weight: 500; }
.hl-check__amt { grid-column: 2; grid-row: 1; }
.hl-check__meta { grid-column: 1 / -1; font-size: 13px; line-height: 18px; color: var(--ink-muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.hl-check--passed { background: var(--surface-raised); border: 1px solid var(--line); }
.hl-check--returned { background: var(--problem-soft); border: 1px solid var(--problem); }

/* ---------- Notice ---------- */
.hl-notice { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--problem-soft); color: var(--ink); }
.hl-notice__icon { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--problem); display: grid; place-items: center; color: var(--surface-raised); font-weight: 700; font-size: 14px; line-height: 1; margin-top: 1px; }
.hl-notice__title { margin: 0; font-weight: 600; color: var(--problem); }
.hl-notice__text { margin: 2px 0 0; font-size: 14px; line-height: 20px; }
.hl-notice--promise { background: var(--promise-soft); }
.hl-notice--promise .hl-notice__icon { background: var(--promise); }
.hl-notice--promise .hl-notice__title { color: var(--promise); }

/* ---------- Resident app shell (from the resident screen designs) ---------- */
html, body { margin: 0; }
body.hl { background: var(--surface); min-height: 100vh; -webkit-text-size-adjust: 100%; }
.hl a { color: inherit; text-decoration: none; }
.hl-app { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.hl-top { background: var(--brand); color: var(--on-brand); padding: 20px 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hl-top--back { padding: 14px 8px 14px 16px; justify-content: flex-start; gap: 4px; }
.hl-top__title { font-size: 20px; line-height: 28px; font-weight: 600; }
.hl-top--back .hl-top__title { font-size: 18px; line-height: 24px; }
.hl-top__sub { font-size: 13px; line-height: 18px; color: var(--on-brand-muted); }
.hl-top__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hl-top a, .hl-top button { color: var(--on-brand); }
.hl-top :focus-visible { outline-color: var(--on-brand); }
.hl-back { width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
.hl-top__acts { display: flex; align-items: flex-start; gap: 4px; }
.hl-bell { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.hl-bell:hover { background: rgba(255,255,255,.1); }
.hl-bell__n { position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--problem); color: #ffffff; font-size: 11px; line-height: 18px; font-weight: 700; text-align: center; box-shadow: 0 0 0 2px var(--brand); }
/* In-app updates (ADR-018) */
.hl-upd { display: flex; gap: 12px; padding: 14px 16px; color: var(--ink); text-decoration: none; }
.hl-upd + .hl-upd { border-top: 1px solid var(--line); }
.hl-upd__dot { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: transparent; }
.hl-upd.is-new .hl-upd__dot { background: var(--brand); }
.hl-upd.is-new { background: var(--surface-sunken); }
.hl-upd__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.hl-upd__title { font-size: 15px; line-height: 22px; font-weight: 600; }
.hl-upd__body { font-size: 14px; line-height: 20px; }
.hl-upd__when { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.hl-tile-upd { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface-raised); border: 1px solid var(--brand); border-radius: var(--radius-md); padding: 14px 16px; color: var(--ink); }
.hl-issue:target { background: var(--surface-sunken); box-shadow: inset -3px 0 0 var(--brand); }
.hl-profile { position: relative; }
.hl-profile > summary { list-style: none; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; color: var(--on-brand); }
.hl-profile__avatar { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); display: grid; place-items: center; }
.hl-profile__name { font-size: 12px; line-height: 14px; color: var(--on-brand-muted); max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-profile__who { padding: var(--space-2) var(--space-3); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
/* The menu sits inside the dark header: its items must not take the header's white text. */
.hl-top .hl-menu__list a, .hl-top .hl-menu__list button { color: var(--ink); }
.hl-profile > summary::-webkit-details-marker { display: none; }
.hl-profile .hl-menu__list { color: var(--ink); }
.hl-main { flex: 1; padding: 16px 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.hl-h2 { margin: 4px 0 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.hl-lead { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.hl-muted { color: var(--ink-muted); }
.hl-caption { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.hl-chev { flex: none; stroke: var(--ink-muted); }

/* Home tiles */
.hl-tile-account { display: block; border-radius: var(--radius-lg); padding: 16px; color: var(--ink); }
.hl-tile-account--ok { background: var(--money-soft); }
.hl-tile-account--problem { background: var(--problem-soft); }
.hl-tile-account__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hl-tile-account__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hl-verdict { display: flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; font-weight: 600; }
.hl-tile-account--ok .hl-verdict { color: var(--money); }
.hl-tile-account--problem .hl-verdict { color: var(--problem); }
.hl-tile-account__main { font-size: 24px; line-height: 32px; font-weight: 700; }
.hl-tile-account__sub { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.hl-tile-checks { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface-raised); border: 1.5px dashed var(--promise-line); border-radius: var(--radius-md); padding: 14px 16px; color: var(--ink); }
.hl-tile-checks--problem { border: 1px solid var(--problem); }
.hl-tile-checks__title { font-size: 15px; line-height: 22px; font-weight: 600; }
.hl-tile-checks--problem .hl-tile-checks__title { color: var(--problem); }

/* List of links inside a card (building section) */
.hl-links { overflow: hidden; }
.hl-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--ink); }
.hl-link + .hl-link { border-top: 1px solid var(--line); }
.hl-link__icon { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--surface-sunken); display: grid; place-items: center; flex: none; }
.hl-link__icon svg { stroke: var(--brand); }
.hl-link__text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hl-link__title { font-size: 15px; line-height: 22px; font-weight: 500; }
.hl-link__sub { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.hl-pill--brand { background: var(--brand); color: var(--on-brand); }

/* Bottom navigation */
.hl-nav { position: sticky; bottom: 0; background: var(--surface-raised); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); }
.hl-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--ink-muted); font-size: 12px; line-height: 16px; font-weight: 500; }
.hl-nav a[aria-current="page"] { color: var(--brand); font-weight: 600; }

/* Projects */
.hl-project { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.hl-project__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.hl-project__title { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
.hl-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.hl-steps span { height: 6px; border-radius: 3px; background: var(--surface-sunken); }
.hl-steps span.is-done { background: var(--money); }
.hl-steps span.is-now { background: var(--brand); }
.hl-steps-labels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.hl-steps-labels [aria-current="step"] { color: var(--ink); font-weight: 600; }
.hl-update { background: var(--surface-sunken); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 20px; }
.hl-update__head { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-muted); }
.hl-ranklist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 22px; }
.hl-ranklist li { display: flex; gap: 10px; }
.hl-ranklist b { width: 16px; color: var(--brand); }

/* Survey */
.hl-rank { display: flex; gap: 12px; padding: 14px; align-items: flex-start; }
.hl-rank__place { width: 32px; flex: none; font-size: 28px; line-height: 32px; font-weight: 700; color: var(--brand); text-align: center; font-variant-numeric: tabular-nums; }
.hl-rank__body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hl-bar { height: 8px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.hl-bar > div { height: 100%; border-radius: 999px; background: var(--brand); }
.hl-pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: var(--radius-md); font: inherit; color: var(--ink); cursor: pointer; background: var(--surface-raised); border: 1px solid var(--line); margin: 1px 0; text-align: start; }
.hl-pick[aria-pressed="true"] { border: 2px solid var(--brand); margin: 0; }
.hl-pick__badge { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 15px; font-weight: 700; border: 1.5px dashed var(--line-strong); color: var(--ink-muted); }
.hl-pick[aria-pressed="true"] .hl-pick__badge { background: var(--brand); color: var(--on-brand); border: 0; }
.hl-notice--ok { background: var(--money-soft); }
.hl-notice--ok .hl-notice__icon { background: var(--money); }
.hl-notice--ok .hl-notice__title { color: var(--money); }

/* Issues */
.hl-issue { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.hl-issue + .hl-issue { border-top: 1px solid var(--line); }
.hl-issue__text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hl-issue__meta { font-size: 13px; line-height: 18px; color: var(--ink-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hl-issue__meta .hl-pill { font-size: 12px; line-height: 18px; padding: 0 6px; }
.hl-marked { display: flex; align-items: center; gap: 4px; font-size: 13px; line-height: 18px; color: var(--money); font-weight: 500; }
.hl-form { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.hl-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); }
.hl-input { min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; font-size: 15px; color: var(--ink); background: var(--surface-raised); width: 100%; }
.hl-chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0; padding: 0; }
.hl-chips legend { padding: 0; margin-bottom: 8px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); }
.hl-chip input { position: absolute; opacity: 0; pointer-events: none; }
.hl-chip span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: var(--radius-pill); font-size: 14px; background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line-strong); cursor: pointer; }
.hl-chip input:checked + span { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.hl-chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.hl-file { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--ink); font-weight: 500; cursor: pointer; }
.hl-file input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hl-btn--block { width: 100%; min-height: 48px; }
.hl-link-brand { color: var(--brand) !important; text-decoration: underline !important; text-underline-offset: 3px; }
.hl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hl [hidden] { display: none !important; }

/* Gates (home): one tap opens; the button says what happens */
.hl-gates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hl-gate { min-height: 112px; border-radius: var(--radius-lg); padding: 14px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px; cursor: pointer; font: inherit; text-align: start; background: var(--surface-raised); color: var(--brand); border: 1px solid var(--line); box-shadow: var(--shadow-card); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.hl-gate__name { font-size: 16px; line-height: 22px; font-weight: 600; }
.hl-gate__state { font-size: 13px; line-height: 18px; }
.hl-gate[data-state="opening"] { background: var(--surface-sunken); color: var(--ink); border-color: var(--line-strong); }
.hl-gate[data-state="opened"] { background: var(--money); color: var(--surface-raised); border-color: var(--money); }
.hl-gate[data-state="failed"] { background: var(--problem-soft); color: var(--problem); border-color: var(--problem); }

/* Sending state of a form button (see resident/_end.ejs) */
.hl-btn.is-busy { opacity: .85; cursor: progress; pointer-events: none; }
.hl-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; display: inline-block; animation: hl-spin .8s linear infinite; flex: none; }
@keyframes hl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hl-spinner { animation-duration: 2.4s; } }

/* Row menu "⋯" on the resident's own reports */
.hl-rowmenu > summary { list-style: none; color: var(--ink-muted); }
.hl-rowmenu > summary::-webkit-details-marker { display: none; }
.hl-rowmenu .hl-menu__list { min-width: 160px; }

/* Barrier icon on the gate buttons: post on the start (right) side in RTL,
   the arm lifts while opening and stays up while "נפתח". */
.hl-gate__icon { width: 100%; max-width: 132px; height: auto; display: block; margin-bottom: 4px; }
[dir="rtl"] .hl-gate__icon { transform: scaleX(-1); }
.hl-boom { transition: transform .55s cubic-bezier(.4, 0, .2, 1); }
.hl-gate[data-state="opening"] .hl-boom,
.hl-gate[data-state="opened"] .hl-boom { transform: rotate(-80deg); }
@media (prefers-reduced-motion: reduce) { .hl-boom { transition: none; } }

/* ---------- Committee on the phone (ADR-016): "ניהול" tab and its screens ---------- */
.hl-nav--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hl-nav a { position: relative; }
.hl-nav__n { position: absolute; top: 2px; inset-inline-end: 22%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--problem); color: #ffffff; font-size: 11px; line-height: 18px; font-weight: 700; text-align: center; }
.hl-mbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--brand); color: var(--on-brand); font-weight: 600; text-decoration: none; }
.hl-mbar:hover { color: var(--on-brand); }
.hl-mstats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; }
.hl-mstat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
.hl-mstat:nth-child(even) { border-inline-start: 1px solid var(--line); }
.hl-mstat:nth-child(n+3) { border-top: 1px solid var(--line); }
.hl-mstat__l { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-muted); }
.hl-mstat__v { font-size: 18px; line-height: 24px; font-weight: 700; }
.hl-mstat__go { font-size: 12px; line-height: 16px; color: var(--brand); font-weight: 500; }
.hl-mtask { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-card); }
.hl-mtask:active { background: var(--surface-sunken); }
.hl-mtask__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.hl-mtask__t { font-weight: 600; font-size: 15px; line-height: 22px; }
.hl-mtask__m { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.hl-mdot { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-sunken); color: var(--ink-muted); }
.hl-mdot--problem { background: var(--problem); color: #ffffff; }
.hl-mdot--promise { background: var(--promise-soft); color: var(--promise); border: 1.5px dashed var(--promise-line); }
.hl-mgrp { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.hl-mgrp--dashed { border: 1.5px dashed var(--promise-line); }
.hl-mgrp__h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 14px; background: var(--surface-sunken); font-size: 13px; line-height: 18px; font-weight: 600; }
.hl-mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 15px; line-height: 22px; }
.hl-mgrp__h + .hl-mrow { border-top: 0; }
.hl-mrow__m { grid-column: 1 / -1; font-size: 12px; line-height: 17px; color: var(--ink-muted); }
.hl-msteps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; font-size: 12px; line-height: 16px; }
.hl-msteps span { padding-top: 8px; border-top: 6px solid var(--surface-sunken); color: var(--ink-muted); }
.hl-msteps .is-done { border-top-color: var(--money); color: var(--ink); font-weight: 600; }
.hl-mactions { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface-raised); border-top: 1px solid var(--line); }
.hl-mactions .hl-btn { flex: 1; }
.hl-mactions form { flex: 1; display: flex; margin: 0; }
.hl-mactions form .hl-btn { flex: 1; }
.hl-sheet { margin: auto 0 0; width: 100%; max-width: 480px; margin-inline: auto; padding: 0; border: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-pop); }
.hl-sheet::backdrop { background: rgba(28,36,48,.4); }
.hl-sheet form { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.hl-desktop-link { display: block; margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--ink-muted); }

/* Login and registration (pages/login.ejs) */
.hl-login .hl-main { gap: 16px; }
.hl-login__logo { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.14); display: grid; place-items: center; color: var(--on-brand); flex: none; }
.hl-login__card { padding: 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.hl-login__h { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; color: var(--ink); }
.hl-login__reg > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.hl-login__reg > summary::-webkit-details-marker { display: none; }
.hl-login__reg > summary .hl-login__h::after { content: " ▾"; color: var(--ink-muted); font-size: 14px; }
.hl-login__reg[open] > summary .hl-login__h::after { content: " ▴"; }
.hl-login__form { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }

/* Photo of a check, one per check (partials/hl/check-photo.ejs): admin cards and the committee's phone */
.hl-ckphoto { width: 56px; height: 40px; flex: none; border-radius: var(--radius-sm); overflow: hidden; display: grid; place-items: center; margin: 0; }
.hl-ckphoto img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.hl-ckphoto { border: 1px solid var(--line); background: var(--surface-sunken); }
a.hl-ckphoto:hover { border-color: var(--brand); }
.hl-ckphoto--none label { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--ink-muted); font-size: 11px; line-height: 12px; cursor: pointer; background: var(--surface-raised); }
.hl-ckphoto--none label:hover { color: var(--brand); border-color: var(--brand); }
.hl-ckphoto--none label.is-busy { opacity: .5; pointer-events: none; }
.hl-ckphoto--none label:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.hl-mrow--ph { grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; }
.hl-mrow--ph .hl-ckphoto { grid-row: 1 / span 2; }
.hl-mrow--ph .hl-mrow__m { grid-column: 2 / -1; }
