:root {
  --base: #0b1220;
  --surface: #111c34;
  --line: #22304f;
  --ink: #e6ecf7;
  --muted: #8aa0c6;
  --brand: #3b82f6;
  --critical: #f43f5e;
  --high: #fb923c;
  --warn: #f59e0b;
  --ok: #22c55e;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow-soft: 0 8px 30px rgba(2, 8, 23, 0.55);
  --font-display: 'Sora', system-ui, sans-serif;
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 50% -10%, rgba(59, 130, 246, 0.1), transparent 60%),
    var(--base);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  margin: 0;
}

/* The header shares the content column, so logo and title line up. */
header {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
/* White on the dark ground, whatever the colours of the file. */
.logo {
  height: 56px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}
/* Languages and session, together at the right of the header. */
.session-bar {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.languages {
  display: flex;
  gap: 4px;
}
.languages .language {
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 9px;
  cursor: pointer;
}
.languages .language[aria-pressed='true'] {
  color: var(--ink);
  border-color: var(--muted);
}
.languages .language:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 2px;
}
.session {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.session[hidden] {
  display: none;
}
.session button {
  font: inherit;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 11px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.session .console-link {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 11px;
}
.session .console-link[hidden] {
  display: none;
}
.session .console-link:hover,
.session .console-link:focus-visible {
  border-color: var(--brand);
  outline: none;
}
.session button:hover,
.session button:focus-visible {
  border-color: var(--critical);
  color: var(--critical);
  outline: none;
}

main {
  flex: 1;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 38px 32px 60px;
}
h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.lede {
  color: var(--muted);
  max-width: 66ch;
  font-size: 1.02rem;
  margin: 0 0 34px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

/* Two columns at most: with an automatic fit a tile would be left alone on a row of its own. */
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* A card that would end alone on the last row takes the whole row instead of leaving a hole beside it. */
  .grid > li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}
.tile {
  --accent: var(--brand);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 24px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.18s,
    transform 0.18s;
}
.tile::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
}
a.tile:hover,
a.tile:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  outline: none;
}

/* A vertical that is only announced: same card, nothing to click. The border is
   broken and the colours are pulled back so it does not read as a link that
   fails to open. */
.tile.showcase {
  cursor: default;
}
.tile.planned {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
}
.tile.planned::before {
  opacity: 0.45;
}
.tile.planned h2 {
  color: var(--muted);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.tile h2 {
  font-size: 1.16rem;
  font-weight: 700;
}
.tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
}
.foot {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.dot.ok {
  background: var(--ok);
}
.dot.off {
  background: #3b4a6b;
}

/* A shortcut is something to open on another device too: its address comes with a code to frame. */
.shortcut {
  --accent: var(--warn);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
.shortcut::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
}
.shortcut .code {
  flex: none;
  background: #fff;
  border-radius: 10px;
  padding: 6px;
}
.shortcut .code img,
.shortcut .code canvas {
  display: block;
}
.shortcut .text {
  display: grid;
  gap: 6px;
}
.shortcut h3 {
  font-size: 1.05rem;
}
.shortcut p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 52ch;
}
.shortcut .address {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--brand);
  word-break: break-all;
}
a.shortcut:hover .address {
  text-decoration: underline;
}
@media (max-width: 560px) {
  .shortcut .code {
    display: none;
  }
}

.services {
  margin-top: 34px;
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.service {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}
.service .note {
  color: var(--muted);
  margin-left: auto;
}
.status {
  color: var(--muted);
}

/* The way to the demo films: last row of the home, under the services. */
.videos-link {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.18s,
    transform 0.18s;
}
.videos-link[hidden] {
  display: none;
}
.videos-link:hover,
.videos-link:focus-visible {
  border-color: var(--brand);
  transform: translateY(-2px);
  outline: none;
}
.videos-link svg {
  width: 34px;
  height: 34px;
  flex: none;
  fill: none;
  stroke: #93c5fd;
  stroke-width: 1.6;
}
.videos-link svg path {
  fill: #93c5fd;
}
.videos-link .text {
  display: grid;
  gap: 3px;
}
.videos-link .title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.videos-link .note {
  color: var(--muted);
  font-size: 0.88rem;
}
.videos-link .arrow {
  margin-left: auto;
  color: #93c5fd;
  font-size: 1.4rem;
}

/* Catalogue of the demo films. */
main[hidden] {
  display: none;
}
.back {
  display: inline-block;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #93c5fd;
  text-decoration: none;
}
.back:hover {
  text-decoration: underline;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.chip {
  font: 500 0.82rem var(--font-sans);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 36px;
  cursor: pointer;
}
.chip:hover,
.chip:focus-visible {
  border-color: var(--brand);
  outline: none;
}
.chip[aria-pressed='true'] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.videos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.video {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.video video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #16233f;
  object-fit: contain;
}
.video .body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.video .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}
.video .pill {
  border: 1px solid #2c4a80;
  color: #93c5fd;
  border-radius: 999px;
  padding: 2px 9px;
}
.video .duration {
  margin-left: auto;
}
.video h2 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}
.video p {
  margin: 0;
  color: #a9b8d6;
  font-size: 0.88rem;
  line-height: 1.45;
  flex: 1;
}
.video .credit {
  color: var(--muted);
  font-size: 0.76rem;
}
.video .file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}
.video .file .name {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video .file a {
  margin-left: auto;
  color: #93c5fd;
  text-decoration: none;
  white-space: nowrap;
}
.video .file a:hover {
  text-decoration: underline;
}
.video .file.guide {
  border-top: 0;
  padding-top: 2px;
}
.video .file.guide .name {
  color: var(--ink);
}

footer {
  padding: 20px 32px 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
/* On a phone the header keeps the mark and the sign-out: the name of the user would push them past the edge. */
@media (max-width: 560px) {
  header {
    flex-wrap: wrap;
    gap: 10px;
  }
  .brand {
    font-size: 0.7rem;
    min-width: 0;
  }
  #user {
    display: none;
  }
}
@media (max-width: 900px) {
  .logo {
    height: 40px;
  }
  header,
  main {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ---- Control landing: full width, verticals with their figures, systems on the map, reports. ---- */
/* Full width: the landing is the entry of the whole platform, not a column of links. */
header,
main {
  max-width: none;
  padding-left: 40px;
  padding-right: 40px;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.top .lede {
  margin: 0;
}
.summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
}
.summary .flag {
  color: var(--warn);
}
.dot.warn {
  background: var(--warn);
}

.tiles {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(var(--columns, 4), minmax(0, 1fr));
}
.tiles > li {
  display: flex;
}
.tiles .tile {
  flex: 1;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.kpis small {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
}
.kpis b {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}
.kpis b em {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  margin-left: 3px;
}
.tile .foot .flag {
  margin-left: auto;
  color: var(--warn);
}

.mid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.panel {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.panel h2 {
  font-size: 1.16rem;
  font-weight: 700;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.chips {
  margin: 0;
}
.chip[aria-pressed='true'] {
  border-color: var(--brand);
  background: rgba(59, 130, 246, 0.14);
}
.chip .dot {
  margin-right: 6px;
}
#map {
  height: 620px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.legend .hint {
  margin-left: auto;
}

/* A system on the map: its vertical's icon, the ring says how it is. */
.pin {
  width: calc(36px * var(--pin-scale, 1));
  height: calc(36px * var(--pin-scale, 1));
  border-radius: 50%;
  background: var(--base);
  border: calc(2.5px * var(--pin-scale, 1)) solid var(--ok);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  color: var(--c);
}
/* The filter of the map hides the systems of the other verticals; the display above would otherwise override it. */
.pin[hidden] {
  display: none;
}
.pin.warn {
  border-color: var(--warn);
  animation: ring 1.8s ease-out infinite;
}
.pin.off {
  border-color: #3b4a6b;
  color: #64748b;
}
.pin svg {
  width: calc(19px * var(--pin-scale, 1));
  height: calc(19px * var(--pin-scale, 1));
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pin .n {
  --badge: max(0.75, var(--pin-scale, 1));
  position: absolute;
  top: calc(-9px * var(--badge));
  right: calc(-12px * var(--badge));
  min-width: calc(20px * var(--badge));
  height: calc(20px * var(--badge));
  border-radius: 10px;
  background: #1e3a8a;
  color: #fff;
  font: 600 calc(11px * var(--badge)) / calc(20px * var(--badge)) var(--font-sans);
  text-align: center;
  padding: 0 5px;
}
@keyframes ring {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(245, 158, 11, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pin.warn {
    animation: none;
  }
}
.maplibregl-popup-content {
  background: var(--surface) !important;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px !important;
  padding: 14px 16px !important;
  box-shadow: var(--shadow-soft) !important;
  font-family: var(--font-sans);
  min-width: 240px;
}
.maplibregl-popup-tip {
  border-top-color: var(--line) !important;
  border-bottom-color: var(--line) !important;
}
.pop {
  display: grid;
  gap: 6px;
}
.pop h3 {
  font-size: 1rem;
  font-weight: 700;
}
.pop .state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
}
.pop .detail {
  color: var(--muted);
  font-size: 0.84rem;
}
.pop a {
  color: #93c5fd;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* Beside the map the column ends where the map ends: the reports take the height left over. */
  align-self: stretch;
}
.side .reports-panel {
  /* Its own height is its content: the column decides the rest, not the 100 % of the tiles. */
  height: auto;
  flex: 1 1 auto;
}
.reports {
  list-style: none;
  margin: 0;
  padding: 0;
}
.reports li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.reports li[hidden] {
  display: none;
}
.reports li:first-child {
  border-top: 0;
}
.reports .what {
  grid-column: 1 / -1;
  font-weight: 600;
}
.reports .where {
  color: var(--muted);
  font-weight: 400;
}
.reports .when {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.side h2.block {
  font-size: 1.16rem;
  font-weight: 700;
  margin-bottom: -6px;
}
.wide {
  flex-direction: row;
  align-items: center;
  gap: 18px;
}
.wide svg {
  width: 34px;
  height: 34px;
  flex: none;
  fill: none;
  stroke: #fdba74;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wide .text {
  display: grid;
  gap: 4px;
  flex: 1;
}
.wide .text h2 {
  font-size: 1.05rem;
}
.wide .arrow {
  color: #fdba74;
  font-size: 1.4rem;
}
.site-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 40px 26px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
}
.site-foot nav {
  display: flex;
  gap: 22px;
}
.site-foot a {
  color: #93c5fd;
  text-decoration: none;
}
.site-foot a:hover {
  text-decoration: underline;
}
.services {
  margin-top: 22px;
}

@media (max-width: 1200px) {
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  header,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .tiles {
    grid-template-columns: minmax(0, 1fr);
  }
  #map {
    height: 420px;
  }
}

/* The icon of the vertical, in its colour, beside the name: the same icon marks its systems on the map. */
.tile-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vicon {
  width: 34px;
  height: 34px;
  flex: none;
  padding: 7px;
  border-radius: 10px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-sizing: content-box;
}

.tile .kpis:empty {
  display: none;
}
.kpis.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 0;
  border: 0;
}
.kpis.inline b {
  font-size: 1rem;
}
.maintenance {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.maintenance[hidden] {
  display: none;
}
.wide .vicon {
  width: 30px;
  height: 30px;
}
.reports .what {
  color: inherit;
  text-decoration: none;
}
.reports .what:hover {
  text-decoration: underline;
}
.pin svg {
  width: 19px;
  height: 19px;
}
