div.pid.announcements-active #announcements {
  display: flex;
}

div.pid.no-trains #no-trains {
  display: flex;
}

#announcements, #no-trains {
  background: #000;
  display: none;
  justify-content: center;
  align-items: center;
  position: absolute;
  width: var(--width);
  height: var(--height);
  gap: calc(var(--width) * 0.02);

  z-index: 1000;
}

#no-trains {
  flex-direction: column;
  gap: 0;
}

#announcements img {
  height: calc(var(--height) * 0.3);
}

#announcements p {
  font-size: calc(var(--height) * 0.12);
  color: #fff;
}

#no-trains p {
  margin: 0;
  font-size: calc(var(--height) * 0.25);
  color: #fff;
}

div.pid {
  --body-margin: calc(var(--width) * 0.01);
  --border-thickness: calc(var(--width) * 0.004);
}

div#service-info {
  --header-height: calc(var(--height) * 0.33);
  --next-service-width: calc(var(--width) * 0.696);

  display: flex;
  --header-width: calc(var(--next-service-width) - var(--body-margin) * 2);
}

div.next-service-info-container {
  width: var(--next-service-width);
  height: var(--height);
  border-right: var(--border-thickness) solid #000;
  display: flex;
  flex-direction: column;
  align-items: center;
}

div.next-service-header {
  height: calc(var(--height) * 0.2);
  margin-top: var(--body-margin);
}

div.pid div.next-service-pattern-info {
  margin-top: 0;
  border-bottom: var(--border-thickness) solid #000;
  height: calc(var(--header-height) - var(--height) * 0.2);
}

div.pid div.next-service-pattern-info > span {
  font-size: calc(var(--height) * 0.075);
}

span.next-service-destination.small {
  font-size: calc(var(--height) * 0.145);
}

span.next-service-destination.smaller {
  font-size: calc(var(--height) * 0.125);
}

div.next-service-detail {
  --service-detail-height: calc(var(--height) - var(--header-height) - var(--body-margin) - var(--border-thickness));
  height: var(--service-detail-height);
}

div.next-service-pattern {
  width: calc(var(--next-service-width) - var(--body-margin) * 2);
  height: var(--service-detail-height);
}

div.next-service-pattern div.stopping-pattern {
  font-size: calc(var(--height) * 0.06);

  --arrow-length: calc(var(--height) * 0.033);
  --arrow-thickness: calc(var(--stop-column-width) * 0.7);
  --arrow-margin-top: calc(var(--stop-column-width) * 0.8);
  --stop-continuation-marker-height: calc(var(--height) * 0.04);
  --stop-column-width: calc(var(--width) * 0.004);
  --stop-column-margin-right: calc(var(--width) * 0.003);
  --column-bullet-width: calc(var(--width) * 0.007);
  --column-bullet-height: calc(var(--height) * 0.013);
}

div.subsequent-service-info {
  width: calc(var(--width) * 0.3);
  height: var(--height);
  display: flex;
  flex-direction: column;
}

div.subsequent-service {
  margin: var(--body-margin);
  margin-bottom: 0;
  height: var(--header-height);
  border-bottom: var(--border-thickness) solid #000;
  display: flex;
}

div.subsequent-service:nth-child(2) {
  border-bottom: none;
}

div.subsequent-service div.line-marker {
  --thickness: calc(var(--width) * 0.006);
  width: var(--thickness);
  height: calc(var(--header-height) * 0.79);
  margin-right: var(--thickness);
  display: block;

  background-color: var(--line-colour);
}

div.subsequent-service div.content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

div.subsequent-service div.content div.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

div.subsequent-service div.content div.top div.left {
  display: flex;
  flex-direction: column;
}


div.subsequent-service div.content span.service-est-time {
  width: calc(var(--width) * 0.08);
  padding-block: calc(var(--width) * 0.004);
  padding-inline: calc(var(--width) * 0.004);

  font-size: calc(var(--height) * 0.08);
  text-align: center;

  display: block;

  background-color: #000;
  color: #fff;
}



div.subsequent-service div.content span.service-sch-time {
  font-size: calc(var(--height) * 0.06);
}

div.subsequent-service div.content span.service-destination {
  font-size: calc(var(--height) * 0.07);
  font-weight: bold;
}

div.subsequent-service div.content span.service-summary {
  margin-top: calc(var(--height) * 0.01);
  font-size: calc(var(--height) * 0.06);
  display: block;
  width: 100%
}


div.clock {
  width: calc(var(--width) * 0.3 - var(--body-margin) * 2);
  height: calc(var(--height) * 0.2);
  border: calc(var(--height) * 0.01) solid #000;
  box-sizing: border-box;

  margin-top: auto;
  margin-bottom: var(--body-margin);
  margin-left: var(--body-margin);
  text-align: center;

  font-size: calc(var(--height) * 0.13);
  line-height: calc(var(--height) * 0.17);
}

div.service-message {
  display: flex;
  position: absolute;

  width: calc(var(--next-service-width) - var(--body-margin) * 2);
  height: var(--service-detail-height);
  
  margin-top: calc(var(--service-detail-height) * -1);
  
  text-align: center;
  justify-content: center;
  align-items: center;
  background-color: var(--pid-background);

  opacity: 0;
}

div.service-message.arrival {
  text-align: left;
  font-size: var(--arrival-font);
  font-weight: 400;
}

div.pid.service-message-active div.service-message:not(.alternating) {
  opacity: 1;
}

div.pid.service-message-active div.service-message.alternating {
  animation: opacity 15s ease-in-out infinite;
}

@keyframes opacity {
  0% {
    opacity: 0;
  }

  48% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  98% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

div.pid:not(.fixed-message-active) div.fixed-message {
  display: none;
}

div.pid.fixed-message-active div.next-service-info-container {
  display: none;
}

div.pid.fixed-message-active div.fixed-message {
  --padding: calc(var(--width) * 0.01);
  display: flex;
  flex-grow: 1;

  padding-inline: var(--padding);
  width: calc(var(--next-service-width) - var(--padding) * 2);
  height: var(--height);
  border-right: var(--border-thickness) solid #000;

  background-color: #000;
  color: #fff;

  text-align: center;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

div.pid .msg-size-1 {
  font-size: calc(var(--height) * 0.12);
}

div.pid .msg-size-2 {
  font-size: calc(var(--height) * 0.13);
}

div.pid .msg-size-3 {
  font-size: calc(var(--height) * 0.16);
}

div.pid .msg-size-4 {
  font-size: calc(var(--height) * 0.17);
}

div.pid .msg-size-5 {
  font-size: calc(var(--height) * 0.18);
}