.rh-sec {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rh-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: var(--weight-semibold);
}

/* The one card on the page: today's expected people and events. */
.rh-card {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  background: var(--surface-raised);
  overflow: hidden;
}
.rh-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--surface-border);
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.rh-row:last-child {
  border-bottom: 0;
}
.rh-row:active {
  background: var(--surface-sunken);
}
.rh-row:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: -2px;
}
.rh-av {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-sunken);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
}
.rh-av--event {
  background: var(--text-primary);
  color: var(--surface-raised);
}
.rh-row__m {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
/* Long names wrap rather than cut off. */
.rh-row__t {
  font-size: 15.5px;
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.rh-row__s {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.rh-row__r {
  flex: none;
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.rh-row__r--soon {
  color: var(--color-warning);
  font-weight: var(--weight-semibold);
}
.rh-empty {
  margin: 0;
  padding: 22px 18px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.rh-row > svg {
  flex: none;
  color: var(--text-muted);
}

/* Saved visitors (screens/resident/visitors.js) */
.sv-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.sv-title {
  flex: 1;
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
  font-weight: var(--weight-bold);
  min-width: 0;
}
.sv-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Add or edit a visitor (screens/resident/visitorSheet.js) */
.vs-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.vs-head__av {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--surface-raised);
  display: grid;
  place-items: center;
  font-weight: var(--weight-bold);
  font-size: 17px;
}
.vs-head__name {
  margin: 0;
  font-size: 17px;
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}
.vs-head__sub {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.vs-remove {
  align-self: center;
  min-height: 44px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14.5px;
  font-weight: var(--weight-medium);
  color: var(--color-danger);
  cursor: pointer;
}

/* Quiet day on Home: nobody expected, regulars offered as faces. */
.rh-quiet {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 18px 18px;
}
.rh-quiet__t {
  margin: 0;
  font-size: 16px;
  font-weight: var(--weight-semibold);
}
.rh-quiet__s {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.rh-faces {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.rh-faces::-webkit-scrollbar {
  display: none;
}
.rh-face {
  flex: none;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}
.rh-face__av {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface-sunken);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: var(--weight-bold);
}
.rh-face__n {
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rh-face:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
  border-radius: 12px;
}

/* All passes / Events (screens/resident/passes.js, events.js) */
.pv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pv-seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius-full);
  background: var(--surface-sunken);
}
.pv-seg__opt {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-full);
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  cursor: pointer;
}
.pv-seg__opt.is-active {
  background: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.pv #panel-passes,
.pv #passes-list,
.pv #events-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.rh-row--static {
  cursor: default;
}
.rh-row--static:active {
  background: none;
}
.rh-row__r--ok {
  color: var(--color-success);
  font-weight: var(--weight-semibold);
}
.rh-quiet__cta {
  align-self: flex-start;
  margin-top: 12px;
}
/* A code is read out at the gate: keep it on one line. */
.rh-row__s .rh-code {
  white-space: nowrap;
}

/* Admin home, laid out like a banking app (screens/admin/dashboard.js) */
.adm {
  gap: 16px;
}
.adm-hi {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.adm-hi__av {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-sunken);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
}
.adm-hi__t {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  font-weight: var(--weight-bold);
  text-wrap: balance;
}
.adm-hi__s {
  margin: 1px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
/* The "balance card": dark in both themes, like a bank card. */
.adm-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #111111;
  color: #ffffff;
  padding: 22px 22px 20px;
}
:root[data-theme="dark"] .adm-card {
  background: #1f1f23;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .adm-card {
    background: #1f1f23;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
}
.adm-card__ring {
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 28px solid rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
}
.adm-card__k {
  margin: 0;
  font-size: 13px;
  color: #a3a3a3;
}
.adm-card__big {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 6px 0 0;
}
.adm-card__n {
  font-size: 46px;
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.adm-card__u {
  font-size: 15px;
  color: #d4d4d4;
}
.adm-card__row {
  display: flex;
  gap: 22px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.adm-card__v {
  margin: 0;
  font-size: 17px;
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}
.adm-card__v--bad {
  color: #ff8a8a;
}
.adm-card__l {
  margin: 1px 0 0;
  font-size: 12px;
  color: #a3a3a3;
}
.adm-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.adm-quick__b {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  cursor: pointer;
}
.adm-quick__ic {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--surface-border);
  display: grid;
  place-items: center;
}
.adm-quick__b:active .adm-quick__ic {
  background: var(--surface-sunken);
}
.adm-quick__b:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
  border-radius: 12px;
}
.adm-quick__badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: var(--radius-full);
  background: var(--color-danger);
  border: 2px solid var(--surface-page);
  color: #ffffff;
  font-size: 11px;
  font-weight: var(--weight-bold);
  display: grid;
  place-items: center;
}
.adm-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  border-radius: 16px;
  background: var(--color-warning-bg);
}
.adm-alert__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-warning);
}
.adm-alert__t {
  flex: 1;
  margin: 0;
  font-size: 14.5px;
  font-weight: var(--weight-semibold);
}
.adm-alert__b {
  flex: none;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--text-primary);
  color: var(--surface-raised);
  font: inherit;
  font-size: 13px;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.adm-act {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.adm-act__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 4px 4px 0;
}
.adm-act__t {
  margin: 0;
  font-size: 16px;
  font-weight: var(--weight-bold);
}
.adm-act__all {
  min-height: 36px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  cursor: pointer;
}
.adm-tx__k {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.adm-tx__k--in {
  background: var(--color-success-bg);
  color: var(--color-success);
}
.adm-tx__k--out {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}
.adm-tx__r {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.adm-tx__time {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}
.adm-tx__st {
  font-size: 12px;
  font-weight: var(--weight-semibold);
}
.adm-tx__st--in {
  color: var(--color-success);
}
.adm-tx__st--out {
  color: var(--color-danger);
}
.adm-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Someone has waited a week or more. */
.adm-alert--late {
  align-items: flex-start;
  background: var(--color-danger-bg);
}
.adm-alert--late .adm-alert__dot {
  margin-top: 7px;
  background: var(--color-danger);
}
.adm-alert__m {
  flex: 1;
  min-width: 0;
}
.adm-alert__m .adm-alert__t {
  color: var(--color-danger);
}
.adm-alert__s {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* Resident home (screens/resident/dashboard.js) reuses the admin card and
   shortcuts above. Get help is tinted red; the rest match the admin home. */
.rhm-help .adm-quick__ic {
  background: var(--color-danger-bg);
  border-color: transparent;
  color: var(--color-danger);
}
.rhm-stat {
  min-width: 0;
}
.rhm .adm-card__row .adm-card__l {
  overflow-wrap: anywhere;
}
.rhm-faces {
  padding: 16px 16px 14px;
}
.rhm-faces__s {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.rhm-faces .rh-faces {
  margin-top: 0;
}
.rhm-again {
  flex: none;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  cursor: pointer;
}
.rhm-again:active {
  background: var(--surface-sunken);
}
.rhm-again:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}
.adm-card__n.rhm-none {
  font-size: 34px;
}
@media (max-width: 359px) {
  .rhm-again {
    padding: 0 10px;
    font-size: 12.5px;
  }
}
