:root {
  --ink: #14202b;
  --paper: #ffffff;
  --brand: #1d4f82;
  --quiet: #45525e;
  --danger: #b3261e;
  --line: #c9d3dc;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }

#app {
  max-width: 30rem;
  margin: 0 auto;
  padding: calc(1.5rem + env(safe-area-inset-top)) 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
}

section { display: flex; flex-direction: column; gap: 1rem; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 1rem 0 0; color: var(--quiet); }
p { margin: 0; }
.logo { align-self: center; }

form { display: flex; flex-direction: column; gap: .6rem; }
label { font-weight: 600; }
input {
  font: inherit;
  padding: .85rem 1rem;
  border: 2px solid var(--line);
  border-radius: .75rem;
  color: var(--ink);
  background: var(--paper);
}
input:focus-visible, button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

button {
  font: inherit;
  font-weight: 600;
  min-height: 3.25rem;
  padding: .75rem 1rem;
  border: 0;
  border-radius: .75rem;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
}
button:disabled { opacity: .55; }
button.quiet { color: var(--brand); background: transparent; text-decoration: underline; }

#notice {
  padding: .85rem 1rem;
  margin-bottom: 1rem;
  border-radius: .75rem;
  color: #fff;
  background: var(--danger);
}

.tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 5.5rem;
  text-align: left;
  color: var(--ink);
  background: #eef3f8;
}
.tile img, .tile .initial {
  flex: none;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  object-fit: cover;
}
.tile .initial {
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  color: #fff;
  background: var(--brand);
}
.tile .who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tile .name { font-size: 1.2rem; }
.tile .status { font-size: .8rem; font-weight: 400; color: var(--quiet); white-space: pre-line; }
.tile .alarm { flex: none; display: grid; place-items: center; color: var(--quiet); }
.tile .action { color: var(--brand); }
.empty { color: var(--quiet); }

#screen-call {
  position: fixed;
  inset: 0;
  background: #000;
  color: #fff;
}
/* Both pictures keep the shape they were filmed in: nothing is cropped to
   fill the screen, the black around them is the price. */
#remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#local-video {
  position: absolute;
  top: calc(1rem + env(safe-area-inset-top));
  right: 1rem;
  width: 28%;
  max-width: 9rem;
  height: auto;
  border-radius: .75rem;
}
/* A mirror for the front camera, the way people see themselves; the back one
   films the room, and a room shown backwards is a wrong room. */
#local-video.mirrored { transform: scaleX(-1); }
#enable-audio {
  position: absolute;
  bottom: calc(15rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink);
  background: #fff;
}
#call-status {
  position: absolute;
  top: 40%;
  left: 0;
  right: 0;
  padding: 0 1.5rem;
  text-align: center;
  font-size: 1.4rem;
}
/* Three columns, the companion's: mine on the left, the porteur's on the
   right, the red disc alone in the middle of the bottom row. */
#call-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(2rem + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-areas:
    "mic-mine . mic-theirs"
    "camera-mine hang-up camera-theirs";
  align-items: center;
  justify-items: center;
  row-gap: 1rem;
  max-width: 26rem;
  margin: 0 auto;
}
#mic-mine { grid-area: mic-mine; }
#mic-theirs { grid-area: mic-theirs; }
#camera-mine { grid-area: camera-mine; }
#camera-theirs { grid-area: camera-theirs; }
.control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  min-width: 5.5rem;
  padding: .5rem;
  font-size: .85rem;
  color: #fff;
  background: rgba(255, 255, 255, .16);
}
/* Off is the state worth noticing: white, like a lit warning. */
.control[aria-pressed="true"] { color: var(--ink); background: #fff; }
#hang-up {
  grid-area: hang-up;
  width: 5.5rem;
  height: 5.5rem;
  padding: 0;
  border-radius: 50%;
  background: var(--danger);
}

/* One card per porteur, with air between them. */
#roster { display: flex; flex-direction: column; gap: .5rem; }
#roster h2 { margin-bottom: 0; }
