/*
  The viewer page's layout and components. Every value is a token from tokens.css. Three layouts: a phone (the map
  with a bottom panel), a desktop (the map with a side panel) and the ten-foot TV view (html.view-tv: large type,
  dark, the people list on the right, focus moved by the arrow keys). Nothing depends on hover.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--on-surface);
  font-family: var(--font);
  font-size: var(--body-size);
  line-height: var(--body-line);
  font-weight: var(--weight-regular);
}

[hidden] {
  display: none !important;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Type roles. */
.headline {
  margin: 0 0 var(--space3);
  font-size: var(--headline-size);
  line-height: var(--headline-line);
  font-weight: var(--weight-bold);
}

.title {
  margin: 0;
  font-size: var(--title-size);
  line-height: var(--title-line);
  font-weight: var(--weight-semibold);
}

.label {
  margin: 0;
  font-size: var(--label-size);
  line-height: var(--label-line);
  font-weight: var(--weight-semibold);
}

.body {
  margin: 0 0 var(--space5);
  font-size: var(--body-size);
  line-height: var(--body-line);
}

.caption {
  margin: 0;
  font-size: var(--caption-size);
  line-height: var(--caption-line);
  color: var(--on-surface-muted);
}

.muted {
  color: var(--on-surface-muted);
}

.icon {
  flex: none;
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.icon-xl {
  width: var(--icon-xl);
  height: var(--icon-xl);
  margin-bottom: var(--space4);
  color: var(--primary);
}

/* Buttons (APP-STYLE.md "Core components"). */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--button-height);
  padding: 0 var(--space5);
  border: 0;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--label-size);
  line-height: var(--label-line);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--motion-short) var(--ease-standard);
}

.button.filled {
  background: var(--primary);
  color: var(--on-primary);
}

.button.tonal {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.button.text {
  background: transparent;
  color: var(--primary);
  padding: 0 var(--space3);
}

.button[disabled] {
  opacity: var(--disabled-opacity);
  cursor: default;
}

/* Focus: visible on everything, and in the TV view the outline, the gap and the scale (APP-STYLE.md "TV"). */
:focus-visible {
  outline: var(--focus-ring) solid var(--accent);
  outline-offset: var(--focus-gap);
}

.view-tv :focus {
  outline: var(--focus-ring) solid var(--accent);
  outline-offset: var(--focus-gap);
  transform: scale(var(--focus-scale));
  position: relative;
  z-index: 1;
}

/* The bar at the top. */
.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: var(--space2) var(--page-gutter);
  background: var(--surface);
  box-shadow: var(--elevation1);
  position: relative;
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  margin-right: var(--space4);
}

.logo {
  width: var(--logo-size);
  height: var(--logo-size);
  color: var(--logo-outline);
  margin-right: var(--space2);
}

.product-name {
  font-size: var(--title-size);
  line-height: var(--title-line);
  font-weight: var(--weight-bold);
  color: var(--primary);
}

.household-name {
  flex: 1;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--label-size);
  color: var(--on-surface-muted);
}

.actions {
  display: flex;
  align-items: center;
}

/* Full-page screens: starting, sign-in, messages, the household chooser. */
.screens {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.screen.centred {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space6) var(--page-gutter);
  text-align: center;
  overflow: auto;
}

.screen.centred .body {
  max-width: var(--text-measure);
}

.character {
  height: var(--character-height);
  width: auto;
  max-width: 100%;
  margin-bottom: var(--space5);
}

:root[data-theme="dark"] .light-only,
:root:not([data-theme="dark"]) .dark-only {
  display: none;
}

/* The static pages (wwwroot/legal) run no script, so data-theme is never set there: they follow the system's setting. */
@media (prefers-color-scheme: dark) {
  :root.static-page .light-only {
    display: none;
  }

  :root.static-page .dark-only {
    display: inline;
  }
}

/* The dog drawings of the brief (issue 70): 160 as the account page's header, 56 beside the Family title. */
.character-header {
  display: block;
  height: var(--character-header-height);
  width: auto;
  max-width: 100%;
  margin-bottom: var(--space3);
}

.character-small {
  height: var(--character-small-height);
  width: auto;
  margin-left: var(--space3);
}

/* A destructive action is text or an outline in danger, never a filled red button (APP-STYLE.md "Core components"). */
.button.outlined-danger {
  border: var(--outline-strong) solid var(--danger);
  color: var(--danger);
  background: transparent;
}

.link {
  color: var(--primary);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
}

/* The one line that says a sign-in ended: plain, not an error. */
.notice {
  max-width: var(--text-measure);
  margin: 0 0 var(--space4);
  padding: var(--space3) var(--space4);
  border-radius: var(--radius-sm);
  background: var(--surface-variant);
  color: var(--on-surface);
}

.message {
  max-width: var(--text-measure);
  margin: var(--space4) 0 0;
  padding: var(--space3) var(--space4);
  border-radius: var(--radius-sm);
  background: var(--danger-container);
  color: var(--on-danger-container);
}

.choices {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: var(--choice-width);
}

.choices li + li {
  margin-top: var(--space2);
}

.choices .button {
  width: 100%;
}

/* The map screen: the banner, the map and the panel. */
.map-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: var(--space2) var(--page-gutter);
  background: var(--surface-variant);
  color: var(--on-surface);
  font-size: var(--label-size);
  line-height: var(--label-line);
}

.banner .icon {
  color: var(--warning);
  margin-right: var(--space2);
}

/* A banner that is news, not a fault (a changed document): a quiet mark, not the warning colour. */
.banner.is-news .icon {
  color: var(--on-surface-muted);
}

.banner-text {
  flex: 1 1 12rem;
  margin-right: var(--space3);
}

.map-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr var(--panel-width);
  min-height: 0;
}

.map {
  min-height: 0;
  height: 100%;
}

.panel {
  overflow: auto;
  background: var(--surface);
  box-shadow: var(--elevation2);
  padding: var(--space4) 0;
}

.panel > .title {
  padding: 0 var(--space4) var(--space2);
}

.people {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* One person: a whole row is one button (APP-STYLE.md "Lists"). */
.person {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--row-height);
  padding: var(--space2) var(--space4);
  border: 0;
  border-bottom: var(--divider) solid var(--outline-subtle);
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}

.person.is-selected {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.person.is-selected .caption,
.person.is-selected .status {
  color: inherit;
}

.avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--avatar-size);
  height: var(--avatar-size);
  margin-right: var(--space3);
  border-radius: var(--radius-full);
  background: var(--member);
  color: var(--on-member);
  font-size: var(--label-size);
  font-weight: var(--weight-bold);
}

.avatar.is-not-heard-from,
.avatar.is-no-fix {
  background: var(--offline-fill);
  color: var(--on-offline-fill);
}

.person-text {
  flex: 1;
  min-width: 0;
}

.person-name {
  display: block;
  font-size: var(--title-size);
  line-height: var(--title-line);
  font-weight: var(--weight-semibold);
}

.status {
  display: flex;
  align-items: flex-start;
  font-size: var(--label-size);
  line-height: var(--label-line);
}

/* The icon stays level with the first line when the status wraps. */
.status .icon {
  margin-right: var(--space1);
  margin-top: calc((var(--label-line) - var(--icon-sm)) / 2);
}

.block {
  display: block;
}

.people .empty {
  padding: var(--space2) var(--space4);
}

.status.is-stale,
.status.is-not-heard-from,
.status.is-no-fix {
  color: var(--stale);
}

.trail-controls {
  padding: var(--space4);
}

.windows {
  display: flex;
  flex-wrap: wrap;
  margin: var(--space2) 0;
}

.windows .button {
  margin: 0 var(--space2) var(--space2) 0;
}

.windows .button[aria-pressed="true"] {
  background: var(--primary);
  color: var(--on-primary);
}

/* Joining with a code, and the family page (issue #53). */
.code-input {
  width: 100%;
  max-width: var(--choice-width);
  min-height: var(--button-height);
  margin: var(--space2) 0 var(--space3);
  padding: 0 var(--space4);
  border: var(--divider) solid var(--outline);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--on-surface);
  font-family: inherit;
  font-size: var(--title-size);
  line-height: var(--title-line);
  letter-spacing: var(--code-spacing);
  text-align: center;
  text-transform: uppercase;
}

.join-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space3);
}

.join-actions .button {
  margin: 0 var(--space2) var(--space2);
}

.family .join-actions {
  justify-content: flex-start;
}

.family .join-actions .button {
  margin-left: 0;
}

.screen.centred .message {
  text-align: center;
}

.family-screen {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--space5) var(--page-gutter);
}

.family {
  width: 100%;
  max-width: var(--family-width);
  margin: 0 auto;
}

.family-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.family-head .headline {
  margin: 0;
}

.family > .title {
  margin: var(--space5) 0 var(--space2);
}

.family-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.family-row {
  padding: var(--space2) 0;
  border-bottom: var(--divider) solid var(--outline-subtle);
}

.family-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--row-height);
}

.family-manage,
.family-confirm {
  padding: var(--space2) 0 var(--space3);
}

.family-manage .button {
  margin: 0 var(--space2) var(--space2) 0;
}

.family-confirm .body {
  margin-bottom: var(--space2);
}

.family-invite {
  margin-top: var(--space5);
}

.family-invite .label {
  margin-top: var(--space3);
}

.family-invite > .button.filled {
  margin-top: var(--space2);
}

.code-panel {
  margin-top: var(--space4);
  padding: var(--space4);
  border-radius: var(--radius-md);
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.code-panel .caption {
  color: inherit;
}

/* The panel is itself a tonal surface, so its own buttons stand out from it. */
.code-panel .button.tonal {
  background: var(--surface);
  color: var(--primary);
}

.code-panel .button.text {
  color: var(--on-primary-container);
}

.code-value {
  margin: var(--space2) 0;
  font-size: var(--headline-size);
  line-height: var(--headline-line);
  font-weight: var(--weight-bold);
  letter-spacing: var(--code-spacing);
  -webkit-user-select: all;
  user-select: all;
}

#family-open-invites {
  margin-top: var(--space5);
}

#family-open-invites > .title {
  margin-bottom: var(--space2);
}

.family-list .empty {
  padding: var(--space2) 0;
}

.button.text.danger {
  color: var(--danger);
}

/* The family page's title, with its drawing beside it. */
.family-title {
  display: flex;
  align-items: center;
}

/* The account page (issue 70, board "Web · Account page"). */
.account-screen {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--space5) var(--page-gutter);
}

.account {
  width: 100%;
  max-width: var(--family-width);
  margin: 0 auto;
}

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.account-head .headline {
  margin: 0;
}

.account > .title {
  margin: var(--space5) 0 var(--space2);
}

.account-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.account-row {
  padding: var(--space2) 0;
  border-bottom: var(--divider) solid var(--outline-subtle);
}

.account-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--row-height);
}

.account-row .hint {
  padding-bottom: var(--space2);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: var(--space3);
}

/* The web's own version, the last line of Your account (B206 board: 32 above, 4 padding). */
.account .account-version {
  margin: var(--space6) 0 0;
  padding: var(--space1) 0;
}

/* A device's app version in a People row: 2 below the battery line, wraps as text does, never cut (B206 board). */
.app-version {
  margin-top: calc(var(--divider) * 2);
  overflow-wrap: break-word;
}

.account .body {
  margin: var(--space2) 0 0;
}

/* A refusal on the account page: an icon and words on the danger container, never red alone. */
.refusal {
  display: flex;
  align-items: flex-start;
  margin-top: var(--space4);
  padding: var(--space3) var(--space4);
  border-radius: var(--radius-sm);
  background: var(--danger-container);
  color: var(--on-danger-container);
}

.refusal .icon {
  margin-right: var(--space2);
  margin-top: calc((var(--label-line) - var(--icon-sm)) / 2);
}

.refusal-text {
  margin: 0;
  font-size: var(--label-size);
  line-height: var(--label-line);
}

/* The dialog (APP-STYLE.md "Dialogs"): radius 28 over a scrim, a title, at most two sentences and two buttons of 56. */
.scrim {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  background: var(--scrim);
}

.dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 11;
  width: calc(100% - (2 * var(--page-gutter)));
  max-width: var(--dialog-width);
  max-height: calc(100% - (2 * var(--page-gutter)));
  overflow: auto;
  transform: translate(-50%, -50%);
  padding: var(--space5);
  border-radius: var(--radius-xl);
  background: var(--dialog-surface);
  color: var(--on-surface);
  box-shadow: var(--elevation3);
}

.dialog .body {
  margin: var(--space3) 0 0;
}

.dialog-word {
  margin-top: var(--space4);
}

.dialog-input {
  display: block;
  width: 100%;
  min-height: var(--button-height);
  margin-top: var(--space1);
  padding: 0 var(--space4);
  border: var(--divider) solid var(--outline);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--on-surface);
  font-family: inherit;
  font-size: var(--title-size);
  line-height: var(--title-line);
  letter-spacing: var(--code-spacing);
}

.dialog .message {
  margin-top: var(--space3);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: var(--space5);
}

.dialog .button {
  flex: 1 1 var(--dialog-button-min-width);
  min-height: var(--dialog-button-height);
  margin: 0 var(--space2) var(--space2) 0;
}

/* The static legal pages (wwwroot/legal, generated by Build-Pages.ps1): prose in a measure of its own, left aligned. */
.legal-screen {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--space6) var(--page-gutter);
}

.prose {
  width: 100%;
  max-width: var(--prose-width);
  margin: 0 auto;
}

.prose .title {
  margin: var(--space5) 0 0;
}

.prose .body {
  margin: var(--space2) 0 0;
}

/* The map (Leaflet), toned down so people stand out (APP-STYLE.md "Map style"). */
.leaflet-container {
  background: var(--surface-variant);
  font-family: var(--font);
}

.leaflet-tile-pane {
  filter: var(--map-tone);
}

.leaflet-control-attribution {
  font-size: var(--caption-size);
  line-height: var(--caption-line);
}

.leaflet-container .leaflet-control-attribution {
  background: var(--surface);
  color: var(--on-surface);
}

.leaflet-control-attribution a {
  color: var(--primary);
}

.leaflet-bar a,
.leaflet-touch .leaflet-bar a {
  width: var(--control-size);
  height: var(--control-size);
  line-height: var(--control-size);
  background: var(--surface);
  color: var(--on-surface);
}

/* A person's marker: a disc with initials, a ring, a state badge and a label (APP-STYLE.md "A person's marker"). */
.person-marker-icon {
  width: 0;
  height: 0;
}

.person-marker {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--marker-size);
  height: var(--marker-size);
  transform: translate(-50%, -50%);
  border: var(--marker-ring) solid var(--surface);
  border-radius: var(--radius-full);
  background: var(--member);
  color: var(--on-member);
  box-shadow: var(--elevation2);
  font-size: var(--title-size);
  font-weight: var(--weight-semibold);
  transition: transform var(--motion-medium) var(--ease-standard);
}

.person-marker.is-stale {
  border-style: dashed;
}

.person-marker.is-not-heard-from {
  background: var(--offline-fill);
  color: var(--on-offline-fill);
}

.person-marker.is-selected {
  transform: translate(-50%, -50%) scale(var(--marker-selected-scale));
  border-color: var(--accent);
  box-shadow: 0 0 0 var(--marker-selected-outer) var(--on-surface);
}

.person-marker .badge {
  position: absolute;
  right: calc(-1 * var(--space1));
  bottom: calc(-1 * var(--space1));
  width: var(--badge-size);
  height: var(--badge-size);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--stale);
}

/* The direction badge covers the marker and a ring around it; its chevron sits outside the ring, turned to the course. */
.person-marker .heading {
  position: absolute;
  left: -25%;
  top: -25%;
  width: 150%;
  height: 150%;
  color: var(--on-surface);
  pointer-events: none;
}

.marker-label {
  position: absolute;
  top: calc(100% + var(--space1));
  left: 50%;
  transform: translateX(-50%);
  display: none;
  padding: 0 var(--space2);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--on-surface);
  box-shadow: var(--elevation1);
  font-size: var(--caption-size);
  line-height: var(--caption-line);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.person-marker.is-selected .marker-label,
.person-marker.is-stale .marker-label,
.person-marker.is-not-heard-from .marker-label,
.view-tv .marker-label {
  display: block;
}

.person-marker.is-selected .marker-label {
  transform: translateX(-50%) scale(calc(1 / var(--marker-selected-scale)));
}

/* Member colour slots: the marker, the avatar, the accuracy circle and the trail take --member from these. */
.slot-1 { --member: var(--member1); }
.slot-2 { --member: var(--member2); }
.slot-3 { --member: var(--member3); }
.slot-4 { --member: var(--member4); }
.slot-5 { --member: var(--member5); }
.slot-6 { --member: var(--member6); }

/* The accuracy circle (APP-STYLE.md "Accuracy circle") and the trail (APP-STYLE.md "Trail"). */
.leaflet-overlay-pane .accuracy {
  stroke: var(--member);
  stroke-width: var(--accuracy-outline);
  fill: var(--member);
  fill-opacity: var(--accuracy-fill-opacity);
}

.leaflet-overlay-pane .trail-casing {
  stroke: var(--surface);
  stroke-width: calc(var(--trail-width) + (2 * var(--trail-casing)));
  fill: none;
}

.leaflet-overlay-pane .trail-line {
  stroke: var(--member);
  stroke-width: var(--trail-width);
  fill: none;
}

.leaflet-overlay-pane .trail-line.is-older {
  stroke-dasharray: var(--trail-dash);
}

/* A phone, up to 720 px wide (45rem; a media query cannot read a token): the map above, the people in a panel below. */
@media (max-width: 45rem) {
  .map-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .panel {
    max-height: var(--sheet-max-height);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--elevation3);
  }

  .household-name {
    order: 3;
    flex-basis: 100%;
  }
}

/* The ten-foot view: inside the TV's safe margins, the people on the right (4 of 12 columns), no zoom control. */
.view-tv body {
  padding: var(--tv-margin-y) var(--tv-margin-x);
}

.view-tv .topbar {
  box-shadow: none;
  background: transparent;
  padding: 0 0 var(--space4);
}

/* On a TV the household's name heads the people list instead (main.js), leaving the top bar one line. */
.view-tv .household-name {
  display: none;
}

/*
  Six of twelve columns rather than APP-STYLE.md's "about 4": at the TV type sizes (32 sp names, 24 sp status) a
  status line such as "Not recent, updated 14 minutes ago" needs about half the screen to stay on one line.
*/
.view-tv .map-layout {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

.view-tv .panel {
  max-height: none;
  border-radius: 0;
  margin-left: var(--space4);
  overflow-x: hidden;
}

/* Room for a focused row to grow by the focus scale without the panel scrolling sideways. */
.view-tv .people {
  padding: 0 var(--space3);
}

/* One status line per person from across the room (APP-STYLE.md "What the TV shows"); the phone's own name is for close reading. */
.view-tv .phone-name {
  display: none;
}

/* Names beside the markers, in the body size (APP-STYLE.md: 28 sp on a TV). */
.view-tv .marker-label {
  font-size: var(--body-size);
  line-height: var(--body-line);
}

/* The family's plan (docs/design/PAYMENTS-STORIES.md; the boards of "Payments (M8)"). */

/* The plan line under the top bar (story 7): the clock for a date, the warning mark for a payment, Dismiss at the end. */
.plan-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: var(--space1) var(--page-gutter);
  background: var(--surface-variant);
  color: var(--on-surface);
  font-size: var(--label-size);
  line-height: var(--label-line);
}

.plan-line .icon {
  flex: none;
  margin-right: var(--space2);
  color: var(--on-surface-muted);
}

.plan-line.is-warning .icon {
  color: var(--warning);
}

.plan-line-text {
  flex: 1 1 12rem;
  min-width: 0;
  padding: var(--space2) 0;
}

/* Dismiss (the plan line and the not-current banner): a text button at the end of the row, a full tap target. */
.dismiss {
  margin-left: auto;
}

/* The plan-ended screen takes the map's place: calm, no red, the words in a measure of their own. */
#screen-plan-ended .caption {
  max-width: var(--text-measure);
  margin-top: var(--space2);
}

#screen-plan-ended .choices {
  margin-top: var(--space2);
}

/* The payer's sentence over the delete-account question: a caution in the warning colour, never red (story 22). */
.dialog-payer {
  margin: var(--space3) 0 0;
  padding: var(--space3) var(--space4);
  border-left: var(--outline-strong) solid var(--warning);
  border-radius: var(--radius-sm);
  background: var(--surface-variant);
  color: var(--on-surface);
}

/* The site footer: the privacy policy and the terms of use (story 38). A person on a TV cannot follow a link. */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 0 var(--page-gutter);
  background: var(--surface);
  border-top: var(--divider) solid var(--outline-subtle);
  font-size: var(--label-size);
  line-height: var(--label-line);
}

.site-footer .link {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-size);
  margin-right: var(--space5);
}

.view-tv .site-footer {
  display: none;
}

/* The e-mail and phone number under a name on the family page (issue 380, B190): one line each, a touch target high; your own in
   grey text; a link or text, and Copy beside it on a computer. */
.contact-lines {
  padding: 0 0 var(--space2);
}

.contact-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-height: var(--button-height);
}

.contact-value {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: var(--body-size);
  line-height: var(--body-line);
}

.contact-line.is-own .contact-value {
  color: var(--on-surface-muted);
}

.contact-copy {
  margin-left: var(--space2);
}

.contact-note {
  padding-bottom: var(--space2);
}

/* The Phone number section of the account page (issue 380, B190). */
.account-phone {
  padding-bottom: var(--space4);
  border-bottom: var(--divider) solid var(--outline-subtle);
}

.account-phone .title {
  margin: var(--space5) 0 var(--space2);
}

.account-phone .label {
  display: block;
  margin-top: var(--space3);
}

.account-phone .caption,
.account-phone .message {
  margin-top: var(--space2);
}

.field-input {
  display: block;
  width: 100%;
  max-width: var(--choice-width);
  min-height: var(--button-height);
  margin-top: var(--space1);
  padding: 0 var(--space4);
  border: var(--divider) solid var(--outline);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--on-surface);
  font-family: inherit;
  font-size: var(--body-size);
  line-height: var(--body-line);
}

.field-input[aria-invalid="true"] {
  border-color: var(--danger);
}

.phone-field {
  display: flex;
  align-items: center;
  max-width: var(--choice-width);
}

.phone-prefix {
  min-width: var(--space6);
  margin: var(--space1) var(--space2) 0 0;
  color: var(--on-surface-muted);
  font-size: var(--body-size);
  line-height: var(--body-line);
}

/* Your account, B207 (issue 567): the person's own sign-in e-mail under the title, and the Platform roles section after the households. */
.account-email {
  margin-top: var(--space4);
}

.account-email-value {
  margin: var(--space1) 0 0;
  font-size: var(--body-size);
  line-height: var(--body-line);
  overflow-wrap: anywhere;
}

.account-platform > .title {
  margin: var(--space5) 0 var(--space2);
}

/* The platform roles page (B207, boards "Web · Platform roles"). */
.platform-screen {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--space5) var(--page-gutter);
}

.platform {
  width: 100%;
  max-width: var(--family-width);
  margin: 0 auto;
}

.platform .body {
  margin: var(--space2) 0 0;
}

.platform > .title {
  margin: var(--space5) 0 var(--space2);
}

.platform-list,
.platform-changes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.platform-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space3) 0;
  border-bottom: var(--divider) solid var(--outline-subtle);
}

.platform-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.platform-line,
.platform-reason {
  font-size: var(--label-size);
  line-height: var(--label-line);
  overflow-wrap: anywhere;
}

.platform-line {
  color: var(--on-surface-muted);
}

.platform-reason {
  color: var(--on-surface);
}

.platform-name {
  overflow-wrap: anywhere;
}

.platform-meta {
  display: flex;
  align-items: flex-start;
}

.platform-lock {
  display: inline-flex;
  margin-right: var(--space1);
}

.platform-row .button {
  flex: none;
  margin-top: calc(var(--space1) * -1);
}

.platform-change {
  display: flex;
  align-items: flex-start;
  padding: var(--space3) 0;
  border-bottom: var(--divider) solid var(--outline-subtle);
}

.platform-change-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--space6);
  height: var(--space6);
  margin-right: var(--space3);
  border-radius: var(--radius-full);
  background: var(--surface-variant);
  color: var(--on-surface-muted);
}

.platform-change-title {
  font-size: var(--body-size);
  line-height: var(--body-line);
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}

/* A field's hint on the left and its count on the right; the count turns to danger past the limit. */
.field-help {
  display: flex;
  margin-top: var(--space1);
}

.field-help .caption:first-child {
  flex: 1;
}

.field-count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.field-count.over {
  color: var(--danger);
  font-weight: var(--weight-bold);
}

.platform .label,
.dialog-reason .label {
  display: block;
  margin-top: var(--space4);
}

.platform .caption {
  margin-top: var(--space1);
}

/* A line with its icon, tied to the field it speaks of: a refusal in danger, a done or plain line in the text colour. */
.field-line {
  display: flex;
  align-items: flex-start;
  margin-top: var(--space2);
  color: var(--on-surface);
}

.field-line.is-error,
.field-line.is-failed {
  color: var(--danger);
}

.field-line .icon {
  margin-top: calc((var(--label-line) - var(--icon-sm)) / 2);
  margin-right: var(--space2);
}

.field-line-text {
  margin: 0;
  font-size: var(--label-size);
  line-height: var(--label-line);
  overflow-wrap: anywhere;
}

.field-input[aria-invalid="true"],
.dialog-input[aria-invalid="true"] {
  border-color: var(--danger);
}

/* The Reason of the Remove dialog: a plain line of text, not the typed word's letter-spaced box. */
.dialog-reason {
  margin-top: var(--space4);
}

.dialog-reason-input {
  font-size: var(--body-size);
  line-height: var(--body-line);
  letter-spacing: normal;
}

.dialog-note {
  margin-top: var(--space3);
}
