html {
  font-size: 20px;
}
html,
body {
  height: 100%;
  margin: 0;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Centered layout for non-fullscreen routes */
.section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.section > .container {
  width: 100%;
}

/* Fullscreen */
body.is-fullscreen .section {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}
body.is-fullscreen .section > .container {
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: none;
}
body.is-fullscreen .section > .container > * {
  width: 100vw;
  height: 100vh;
}

/* =========================
   Monitor layout
   ========================= */
.monitor {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Header */
.monitor__header {
  flex: 0 0 5vh;
  height: 5vh;
  min-height: 45px;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: #e62f27;
  color: #fff;
  border-bottom: 2px solid #bcbcbc;
  position: relative;
}

.monitor__header--alert {
  animation: header-flash 0.8s infinite alternate;
}

@keyframes header-flash {
  0% {
    background-color: #e62f27;
  }
  100% {
    background-color: #a80000;
  }
}

.monitor__header-left {
  z-index: 1;
}
.monitor__title {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
}

.monitor__header-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
}

.monitor__header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1;
}

.monitor__header-link {
  font-size: 0.8rem;
  color: #ffffff;
  text-decoration: underline;
  opacity: 0.9;
}

.monitor__time {
  font-weight: 400;
  color: #fff;
  font-size: 1.8rem;
  letter-spacing: 0.5px;
}

/* Notification header */
.monitor__notification {
  flex: 0 0 5vh;
  height: 5vh;
  width: 100%;
  display: flex;
  align-items: center;
  background: #dcdcdc;
  border-bottom: 2px solid #bcbcbc;
  overflow: hidden;
}

.notification__viewport {
  width: 100%;
  padding: 0 0.75rem;
  overflow: hidden;
}

.notification__text {
  color: #e62f27;
  font-weight: 400;
  font-size: 3.5vh;
  line-height: 5vh;
  white-space: nowrap;
  width: auto;
  text-align: left;
}

.notification__text.is-marquee {
  will-change: transform;
  animation: notification-marquee var(--marquee-duration, 14s) linear infinite;
}

@keyframes notification-marquee {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-120%);
  }
}

/* Body */
.monitor__body {
  flex: 1;
  min-height: 0;
  display: flex;
}

/* Pane widths via CSS variables */
.monitor__pane-a {
  flex: 0 0 var(--pane-a, 44%);
  min-width: 0;
  min-height: 0;
  border-right: 4px solid #bcbcbc;
  background: #d1d2d4;
  display: flex;
}

.monitor__right {
  flex: 0 0 var(--pane-right, 56%);
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.monitor__pane-b {
  flex: 0 0 60%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 4px solid #9fa1a3;
}

.monitor__pane-c {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* =========================
   Pane A (SAFE: cannot disturb B/C)
   ========================= */
.pane-a {
  flex: 1;
  position: relative;
  background: #d1d2d4;
  display: flex;
  min-width: 0;
  min-height: 0;
}

.pane-a__imgwrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.pane-a__stage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden; /* critical: prevents layout from pushing B/C */
  background: #d1d2d4; /* letterbox color */
}

/* Sized in JS: {width:px, height:px} */
.pane-a__map {
  position: relative;
  flex: 0 0 auto;
}

.pane-a__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.pane-a__coord {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.pane-a__coord-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}

/* Alarm titles + table */
.alarmlist__title {
  padding: 0.5rem 0.75rem;
  font-weight: 900;
  font-size: 1.3rem;
  background: #0b3a4a;
  color: #fff;
  border-bottom: none;
}

.alarmlist__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-width: none;
}
.alarmlist__scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.alarmlist__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Extra vertical space for descenders like g/y/p */
.alarmlist__table td {
  padding: 0.42rem 0.7rem 0.6rem 0.7rem;
  max-width: 0;
  vertical-align: middle;
}

.alarmlist__station {
  font-weight: 900;
  font-size: 1.7rem;
  line-height: 1.22;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alarmlist__desc {
  font-size: 1.52rem;
  line-height: 1.22;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Priority/isNew colors + consistent striping */
.alarm-p1-light td {
  background: #ffffff;
  color: #000;
}
.alarm-p1-dark td {
  background: #c6eeff;
  color: #000;
}

.alarm-p2-light td {
  background: #ffc536;
  color: #000;
}
.alarm-p2-dark td {
  background: #fea500;
  color: #000;
}

.alarm-p3-light td {
  background: #e62e27;
  color: #fff;
}
.alarm-p3-dark td {
  background: #c91f1a;
  color: #fff;
}

/* ============================================
   Marker arrows (corner unicode, refined)
   ============================================ */

.pane-a__coord-pill {
  position: relative;
  border-radius: 3px;
}

/* Arrow */
.pane-a__marker {
  position: absolute;
  font-size: 1.05em;
  line-height: 1;
  color: #fff;
  font-weight: 900;
  pointer-events: none;
  opacity: 0.95;
}

/* ---- markerType 0: top-left ---- */
.pane-a__coord-pill.marker-0 {
  padding-left: 1.35em;
  padding-top: 0.25em;
}
.pane-a__coord-pill.marker-0 .pane-a__marker {
  top: -0.25em;
  left: 0.35em;
}

/* ---- markerType 1: top-right ---- */
.pane-a__coord-pill.marker-1 {
  padding-right: 1.35em;
  padding-top: 0.25em;
}
.pane-a__coord-pill.marker-1 .pane-a__marker {
  top: -0.25em;
  right: 0.35em;
}

/* ---- markerType 2: bottom-right ---- */
.pane-a__coord-pill.marker-2 {
  padding-right: 1.35em;
  padding-bottom: 0.25em;
}
.pane-a__coord-pill.marker-2 .pane-a__marker {
  bottom: 0.15em;
  right: 0.35em;
}

/* ---- markerType 3: bottom-left ---- */
.pane-a__coord-pill.marker-3 {
  padding-left: 1.35em;
  padding-bottom: 0.25em;
}
.pane-a__coord-pill.marker-3 .pane-a__marker {
  bottom: 0.15em;
  left: 0.35em;
}

/* =========================
   Home page (menu)
   ========================= */
.home {
  width: 100%;
  display: flex;
  justify-content: center;
}

.home__box {
  max-width: 42rem;
  width: 100%;
}

.home__buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.home__btn {
  width: 24rem;
  max-width: 100%;
  justify-content: center;
  font-weight: 600;
}

.monitor--memos .monitor__body {
  display: block;
}

.memos__pane {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.memo__table td {
  padding: 0.42rem 0.7rem 0.6rem 0.7rem;
  vertical-align: middle;
}

.memo__meta {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  min-width: 0;
}

.memo__desc {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.22rem;
  line-height: 1.22;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.memo__type {
  flex: 0 0 auto;
  font-size: 1.22rem;
  line-height: 1.22;
  white-space: nowrap;
  text-align: right;
  font-weight: 700;
}

.pane-a__coord-pill--default {
  background-color: inherit;
  color: inherit;
  border-color: inherit;
}

.pane-a__coord-pill--red {
  background-color: #ffdddd;
  color: #b00020;
  border-color: #b00020;
}