/* The Housing section of the person page (HousingPanelComponent in app/components; docs/housing/00-integration-plan.md section 5, docs/phase0_core/06-app-layer.md
   section 7b), built from the fact list, the table, the badge, the callout and the empty state, so what is here is only how they sit together: a heading, how old the
   data is, a warning when it is older than it should be, "Now" as a fact list and "History" as a table.

   Linked after the device rules (40-native.css), like 46-sources.css, which is why it is numbered 47 and not among the components' 35 to 39: nothing here needs to come
   before them, because every rule is more specific than the one it adjusts. Tokens only and logical properties only, both enforced (test/styles/tokens_test.rb,
   test/styles/components_test.rb), so all of it reads on the light shell and on the console, in light and in dark, and mirrors in a right-to-left language. It decides no
   mode and no surface. Nothing is pinned to an edge and nothing sets a height in vh.

   Everything that holds words may shrink (`min-inline-size: 0`) and breaks a word that has no room (`overflow-wrap`), so a long hall, a long term name or a language 40%
   longer never widens the page (WCAG 1.4.10). A status is its words, in a badge whose tone is a second signal and never the only one. The table scrolls inside its own
   named region, which is focusable, and is the one place on the page that may be wider than a phone. */

.housing-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--density-gap);
  max-inline-size: 64rem;
  min-inline-size: 0;
}
.housing-part {
  display: grid;
  gap: var(--density-gap);
  min-inline-size: 0;
}
.housing-subheading {
  margin: 0;
  overflow-wrap: anywhere;
}

/* How old it is, and what to make of a stay that is not today's: a line of the muted small text the facts' provenance is in. */
.housing-freshness,
.housing-note {
  min-inline-size: 0;
  margin: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.housing-stale {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* A cell that says two things says them on two lines, so a column of halls and a column of days read down. */
.housing-line {
  display: block;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}
/* The two cells of the history that say words, where and from whom, keep a width a line can be read in: the table scrolls in its own region for the rest, which is the one
   place that may be wider than a phone, instead of squeezing a hall and a designation into a few letters a line. */
.housing-cell {
  display: block;
  min-inline-size: 11rem;
}
.housing-panel .pill {
  max-inline-size: 100%;
}
.housing-panel .pill + .housing-line,
.housing-panel .housing-line + .pill {
  margin-block-start: 0.15rem;
}

/* The Meal plan group (D1c) is the same parts again: its plans in force are fact lists (`.kv`) and its earlier plans are the rows and the fold the history uses, so nothing else is needed but one
   thing. A person who holds a plan and a supplement has two fact lists in force, each with its own source line, and a hairline between them says where one ends and the next begins. */
.housing-meal-plan > .housing-part + .housing-part {
  padding-block-start: var(--density-gap);
  border-block-start: 1px solid var(--rule);
}
