.duration-meter {
  position: absolute;
  left: 114px;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 0;
  width: auto;
  height: auto;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  pointer-events: none;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sr-only {
  position: fixed;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.tally-toggle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #3b4651;
  border-radius: 7px;
  background: #252d36;
  color: #f3f5f7;
  font-size: 17px;
  line-height: 1;
}
.tally-toggle:hover { background: #34414d; }

.duration-meter i {
  display: block;
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--duration-px, 40px);
  max-width: none;
  min-width: 34px;
  height: 100%;
  background: color-mix(in srgb, var(--duration-color, #315b86) 52%, #20252b);
  border-radius: 0 4px 4px 0;
  transform: translate3d(var(--timeline-x, 0), 0, 0);
  will-change: transform;
}

.duration-meter b {
  position: absolute;
  top: 50%;
  right: 78px;
  z-index: 1;
  display: block;
  padding: 0;
  font: 700 10px/16px ui-monospace, monospace;
  color: #fff;
  text-shadow: 0 1px 2px #000;
  transform: translateY(-50%);
}

.vision-panel .cue-copy { overflow: hidden; }
.vision-panel .cue-copy > strong { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.cue-copy > strong.embedded-shot-list { display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
.embedded-shot { display: flex; align-items: center; gap: 4px; min-width: 0; width: 100%; white-space: normal; }
.embedded-shot > span { min-width: 0; overflow-wrap: anywhere; }
.embedded-shot > span { font-size: 1em; }
.embedded-shot i { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: 3px; background: var(--camera-color); color: var(--camera-text); font: 800 1em/1 ui-monospace, monospace; font-style: normal; vertical-align: middle; }
.vision-panel .cue-row {
  position: relative;
  min-height: 64px;
  padding: 7px 10px;
  overflow: hidden;
}
.vision-panel .cue-row > :not(.duration-meter) {
  position: relative;
  z-index: 1;
}
.vision-panel .cue-list {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: #101419;
}
.vision-grid {
  /* Keep the red alert backdrop outside the floating panels. The grid itself
     is an opaque surface, so gaps or a short final list never show through
     the Vision A/B windows. */
  background: #101419;
}
.vision-panel {
  background-color: #101419;
  isolation: isolate;
  position: relative;
}
.vision-panel .cue-row.active {
  background: #111d2a;
  color: #e8eef5;
  box-shadow: inset 5px 0 #315b86;
}
.vision-panel .cue-row.active .cue-copy small,
.vision-panel .cue-row.active .cue-time { color: #9eafc1; }
.cue-list .scroll-tail {
  height: calc(100% - 64px);
  min-height: 180px;
  pointer-events: none;
}
.vision-panel { grid-template-rows: auto 1fr; }
.vision-panel.selected-panel { grid-template-rows: auto 1fr auto; }
.selected-panel .camera-filter {
  border-top: 1px solid #2a3139;
  border-bottom: 0;
  background: #151a20;
}

.camera-alert[data-alert-mode="border"],
.camera-alert[data-alert-mode="both"] {
  position: relative;
  z-index: 0;
}

.camera-alert[data-alert-mode="border"] .vision-panel,
.camera-alert[data-alert-mode="both"] .vision-panel {
  outline: 2px solid #ff1018;
  outline-offset: 1px;
  box-shadow: 0 0 12px #ff101855;
}

.camera-alert[data-alert-mode="background"],
.camera-alert[data-alert-mode="both"] { background: #d7070d; }

.camera-alert[data-alert-mode="background"] > header,
.camera-alert[data-alert-mode="background"] > main,
.camera-alert[data-alert-mode="background"] > footer,
.camera-alert[data-alert-mode="both"] > header,
.camera-alert[data-alert-mode="both"] > main,
.camera-alert[data-alert-mode="both"] > footer { background-color: #7d080bd9; }

.camera-alert::after {
  content: "CAM " attr(data-alert-camera);
  position: fixed;
  right: 18px;
  bottom: 70px;
  z-index: 20;
  padding: 7px 12px;
  border-radius: 6px;
  background: #ff1018;
  color: #fff;
  font: 900 18px ui-monospace, monospace;
  box-shadow: 0 4px 20px #0008;
}

.status-toggle { display: none; }

@media (orientation: portrait) and (max-width: 600px) {
  body { grid-template-rows: auto auto auto; align-content: start; }
  .statusbar { position: relative; display: flex; flex-wrap: nowrap; align-items: center; max-height: 29px; overflow: hidden; padding-right: 0; gap: 4px; white-space: nowrap; }
  .statusbar .status-secondary { display: none; }
  .statusbar.show-status-details { max-height: 78px; }
  .statusbar.show-status-details .status-secondary { display: inline; }
  .statusbar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .statusbar > span:first-child { flex: 1 1 auto; }
  .statusbar > span:nth-of-type(2) { flex: 0 1 120px; }
  .statusbar:not(.show-status-details) > span:nth-of-type(4) { display: none; }
  .status-toggle { display: grid; place-items: center; position: static; z-index: 2; flex: 0 0 38px; width: 38px; height: 20px; min-width: 38px; padding: 0 4px; border: 1px solid #3b4752; border-radius: 4px; background: #202832; color: #b8c4cf; font-size: 9px; line-height: 1; white-space: nowrap; }
  .statusbar.show-status-details { flex-wrap: wrap; overflow: visible; padding-right: 44px; }
  .statusbar.show-status-details .status-toggle { position: absolute; right: 0; top: 1px; }
}

@media (orientation: portrait) and (max-height: 700px) {
  body > header {
    min-height: 58px;
    gap: 3px;
    padding: 3px 7px;
  }
  h1 { font-size: 13px; }
  .transport { gap: 5px; }
  .transport strong { font-size: 20px; }
  main { padding: 2px 5px 3px; }
  .vision-panel {
    height: clamp(198px, calc((100dvh - 168px) / 2), 240px);
  }
  .panel-head { padding: 4px 7px; }
  .panel-head h2 { font-size: 11px; }
  .countdown { font-size: 18px; }
  .camera-filter { padding: 3px 5px; gap: 2px; font-size: 8px; }
  .camera-filter span { padding: 1px 3px; }
  .vision-panel .cue-row {
    min-height: 31px;
    padding: 3px 4px;
  }
  .camera { width: 24px; height: 24px; font-size: 12px; }
  .cue-time { font-size: 8px; }
  .cue-copy { gap: 1px; }
  .cue-copy strong { font-size: 9px; }
  .cue-copy small { font-size: 7px; }
  .duration-meter { height: 9px; }
  .duration-meter b { font-size: 6px; line-height: 9px; }
  .command { font-size: 6px; padding: 0 1px; display: grid; place-items: center; }
  body > footer { flex-direction: row; align-items: center; justify-content: space-between; gap: 6px; padding: 0 6px max(3px, env(safe-area-inset-bottom)); }
  body > footer > span { display: block; min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body > footer > div { flex: 0 0 auto; margin-top: 0; }
  button { padding: 4px 6px; font-size: 9px; }
}

@media (orientation: portrait) and (max-width: 600px) {
  body > header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  body > header .local-service-link { display: none; }
  body > header > div:first-child {
    min-width: 0;
    overflow: hidden;
  }
  body > header .transport {
    width: auto;
    flex-shrink: 0;
    justify-content: flex-end;
    white-space: nowrap;
  }
  body > footer { flex-direction: row; align-items: center; justify-content: space-between; gap: 6px; padding: 0 6px max(3px, env(safe-area-inset-bottom)); }
  body > footer > span { display: block; min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body > footer > div { flex: 0 0 auto; margin-top: 0; }
  button { padding: 8px 13px; font-size: 12px; }
  main {
    padding: 3px 12px 12px;
    gap: 2px;
    height: 618px;
    grid-template-rows: 29px 572px;
  }
  .vision-panel {
    height: 280px;
    min-height: 0;
    max-height: 280px;
  }
  .vision-grid {
    gap: 12px;
    align-content: start;
    grid-template-rows: repeat(2, 280px);
    height: 572px;
  }
  .vision-panel .cue-row {
    min-height: 36px;
    padding: 7px 5px;
  }
  .duration-meter { left: 70px; }
  .duration-meter b { right: 50px; }
  .duration-meter {
    height: auto;
  }
  .duration-meter b {
    padding-left: 4px;
    font-size: 7px;
    line-height: 1;
  }
  .cue-list .scroll-tail {
    height: calc(100% - 36px);
    min-height: 70px;
  }
}

@media (orientation: portrait) and (max-height: 700px) {
  body > header { min-height: 46px; gap: 2px; padding: 2px 7px; }
  h1 { font-size: 12px; }
  .transport strong { font-size: 18px; }
  main { height: 488px; padding: 2px 12px 12px; grid-template-rows: 20px 452px; }
  .vision-panel { height: 220px; max-height: 220px; }
  .vision-grid { grid-template-rows: repeat(2, 220px); height: 452px; }
  .vision-panel .cue-row { min-height: 27px; padding: 2px 4px; }
  .vision-panel .camera { width: 22px; height: 22px; font-size: 12px; }
  .vision-panel .cue-time { font-size: 8px; }
  .vision-panel .cue-copy { gap: 1px; }
  .vision-panel .cue-copy strong { font-size: 11px; }
  .vision-panel .cue-copy small { font-size: 8px; }
  .duration-meter { height: auto; }
  .duration-meter b { right: 46px; font-size: 7px; line-height: 1; }
  .command { font-size: 7px; padding: 0 1px; display: grid; place-items: center; }
  body > footer { flex-direction: row; align-items: center; justify-content: space-between; gap: 6px; padding: 0 6px max(3px, env(safe-area-inset-bottom)); }
  body > footer > span { display: block; min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body > footer > div { flex: 0 0 auto; margin-top: 0; }
  button { padding: 8px 13px; font-size: 12px; }
}

@media (orientation: portrait) and (max-width: 600px) {
  main:has(.statusbar.show-status-details) {
    height: 667px;
    grid-template-rows: 78px 572px;
    gap: 10px;
  }
}

@media (orientation: portrait) and (max-width: 600px) and (max-height: 700px) {
  main:has(.statusbar.show-status-details) {
    height: 537px;
    grid-template-rows: 78px 452px;
    gap: 10px;
  }
}

/* Mobile readability pass: taller rows, larger labels, and a duration bar
   centered to the same vertical box as the camera number. */
@media (orientation: portrait) and (max-width: 600px) {
  main {
    height: 606px;
    padding-bottom: 0;
  }
  .vision-panel .cue-row {
    height: 40px;
    min-height: 40px;
  }
  .duration-meter {
    top: 50%;
    bottom: auto;
    height: 27px;
    transform: translateY(-50%);
  }
  .vision-panel .cue-copy strong { font-size: 13px; }
  .vision-panel .cue-copy small { font-size: 9px; }
  .vision-panel .camera { font-size: 17px; }
  .command { font-size: 10px; }
  .duration-meter b { font-size: 9px; }
  main:has(.statusbar.show-status-details) {
    height: 669px;
  }
}

@media (orientation: portrait) and (max-width: 600px) and (max-height: 700px) {
  main {
    height: 462px;
    padding-bottom: 0;
  }
  .vision-panel .cue-row {
    height: 31px;
    min-height: 31px;
  }
  .duration-meter {
    height: 22px;
  }
  .vision-panel .cue-copy strong { font-size: 13px; }
  .vision-panel .cue-copy small { font-size: 9px; }
  .vision-panel .camera { font-size: 15px; }
  .command { font-size: 9px; }
  .duration-meter b { font-size: 9px; }
  main:has(.statusbar.show-status-details) {
    height: 534px;
  }
}

/* Keep these overrides last so they win over the compact baseline above. */
@media (orientation: portrait) and (max-width: 600px) {
  main {
    height: 606px;
    padding-bottom: 0;
  }
  .vision-panel .cue-row {
    height: 40px;
    min-height: 40px;
  }
  .duration-meter {
    top: 50%;
    bottom: auto;
    height: 27px;
    transform: translateY(-50%);
  }
  .vision-panel .cue-copy strong { font-size: 13px; }
  .vision-panel .cue-copy small { font-size: 9px; }
  .vision-panel .camera { font-size: 17px; }
  .command { font-size: 10px; }
  .duration-meter b { font-size: 9px; }
  main:has(.statusbar.show-status-details) { height: 669px; }
}

@media (orientation: portrait) and (max-width: 600px) and (max-height: 700px) {
  main {
    height: 462px;
    padding-bottom: 0;
  }
  .vision-panel .cue-row {
    height: 31px;
    min-height: 31px;
  }
  .duration-meter { height: 22px; }
  .vision-panel .cue-copy strong { font-size: 13px; }
  .vision-panel .cue-copy small { font-size: 9px; }
  .vision-panel .camera { font-size: 15px; }
  .command { font-size: 9px; }
  .duration-meter b { font-size: 9px; }
  main:has(.statusbar.show-status-details) { height: 534px; }
}

/* Final compact/mobile alignment: keep the two floating views stable while
   the list fills, and keep the duration/CUT/MIX labels on the same row. */
.command {
  display: grid;
  place-items: center;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  padding: 0 2px;
  line-height: 1;
  font-size: 11px;
}
.duration-meter b {
  right: 88px;
  font-size: 11px;
}

@media (orientation: portrait) and (max-width: 600px) {
  body > footer {
    min-height: 48px;
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
  }
  .vision-panel .cue-list {
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .vision-panel .cue-row {
    height: 36px;
    min-height: 36px;
  }
  .vision-panel .cue-copy strong { font-size: 11.5px; }
  .vision-panel .camera { font-size: 15px; }
  .command {
    font-size: 9px;
    padding: 0 1px;
  }
  .duration-meter b {
    right: 62px;
    font-size: 8px;
    line-height: 1;
  }
  main:has(.statusbar.show-status-details) {
    height: 681px;
    grid-template-rows: 78px 572px;
    gap: 16px;
  }
}

@media (orientation: portrait) and (max-width: 600px) and (max-height: 700px) {
  main {
    height: 474px;
    grid-template-rows: 20px 438px;
  }
  .vision-panel {
    height: 213px;
    max-height: 213px;
  }
  .vision-grid {
    grid-template-rows: repeat(2, 213px);
    height: 438px;
  }
  .vision-panel .cue-row {
    height: 27px;
    min-height: 27px;
  }
  .vision-panel .cue-copy strong { font-size: 12px; }
  .vision-panel .camera { font-size: 13px; }
  .command { font-size: 8px; }
  .duration-meter b {
    right: 58px;
    font-size: 8px;
  }
  main:has(.statusbar.show-status-details) {
    height: 546px;
    grid-template-rows: 78px 438px;
    gap: 16px;
  }
}

/* Last mobile overrides. */
@media (orientation: portrait) and (max-width: 600px) {
  main { height: 606px; padding-bottom: 0; }
  .vision-panel .cue-row { height: 40px; min-height: 40px; }
  .duration-meter {
    top: 50%;
    bottom: auto;
    height: 27px;
    transform: translateY(-50%);
  }
  .vision-panel .cue-copy strong { font-size: 13px; }
  .vision-panel .cue-copy small { font-size: 9px; }
  .vision-panel .camera { font-size: 17px; }
  .command { font-size: 10px; }
  .duration-meter b { font-size: 9px; }
  main:has(.statusbar.show-status-details) { height: 669px; }
}

@media (orientation: portrait) and (max-width: 600px) and (max-height: 700px) {
  main { height: 462px; padding-bottom: 0; }
  .vision-panel .cue-row { height: 31px; min-height: 31px; }
  .duration-meter { height: 22px; }
  .vision-panel .cue-copy strong { font-size: 13px; }
  .vision-panel .cue-copy small { font-size: 9px; }
  .vision-panel .camera { font-size: 15px; }
  .command { font-size: 9px; }
  .duration-meter b { font-size: 9px; }
  main:has(.statusbar.show-status-details) { height: 534px; }
}

/* Align the desktop duration bar with the 42px camera number tile. */
@media (orientation: landscape), (min-width: 601px) {
  .duration-meter {
    top: 50%;
    bottom: auto;
    height: 42px;
    transform: translateY(-50%);
  }
}

/* Leave a small breathing room above the footer while making mobile rows
   visibly taller. */
@media (orientation: portrait) and (max-width: 600px) {
  main {
    height: 618px;
    padding-bottom: 12px;
  }
  .vision-panel .cue-row {
    height: 44px;
    min-height: 44px;
  }
  main:has(.statusbar.show-status-details) { height: 681px; }
}

@media (orientation: portrait) and (max-width: 600px) and (max-height: 700px) {
  main {
    height: 474px;
    padding-bottom: 12px;
  }
  .vision-panel .cue-row {
    height: 34px;
    min-height: 34px;
  }
  main:has(.statusbar.show-status-details) { height: 546px; }
}

/* Keep six-and-a-half cue rows visible after increasing row height. */
@media (orientation: portrait) and (max-width: 600px) {
  main {
    height: 754px;
    grid-template-rows: 29px 708px;
  }
  .vision-grid {
    height: 708px;
    grid-template-rows: repeat(2, 348px);
  }
  .vision-panel {
    height: 348px;
    max-height: 348px;
  }
  .vision-panel .cue-row {
    height: 48px;
    min-height: 48px;
  }
  .duration-meter { height: 27px; }
  main:has(.statusbar.show-status-details) {
    height: 829px;
    grid-template-rows: 78px 708px;
    gap: 28px;
  }
}

@media (orientation: portrait) and (max-width: 600px) and (max-height: 700px) {
  main {
    height: 612px;
    grid-template-rows: 20px 576px;
  }
  .vision-grid {
    height: 576px;
    grid-template-rows: repeat(2, 282px);
  }
  .vision-panel {
    height: 282px;
    max-height: 282px;
  }
  .vision-panel .cue-row {
    height: 36px;
    min-height: 36px;
  }
  .duration-meter { height: 22px; }
  main:has(.statusbar.show-status-details) {
    height: 696px;
    grid-template-rows: 78px 576px;
    gap: 28px;
  }
}

/* Alert layer owns the foreground notification; the mobile details control
   remains underneath it whenever an alert is active. */
@media (orientation: portrait) and (max-width: 600px) {
  .camera-alert .status-toggle {
    position: relative;
    z-index: 0;
  }
}

/* Keep a clear terminal row after the final cue instead of leaving the last
   camera looking like it is still live. */
.vision-panel .cue-row.end-row {
  background: #0d1218;
  color: #6f7d89;
  box-shadow: none;
}
.vision-panel .end-row .camera {
  background: #202832;
  color: #8f9ca8;
  font-size: 11px;
  letter-spacing: .04em;
}
.vision-panel .end-row .cue-copy strong { color: #a9b4bf; }
.vision-panel .end-row .cue-copy small { color: #6f7d89; opacity: 1; }
.vision-panel .end-row .command { background: #202832; color: #71808d; }
.vision-panel .end-row .duration-meter { display: none; }

/* Long shot/comment text should wrap instead of being clipped.  The cue row
   grows with its content while the duration meter remains vertically aligned
   to the row's camera tile. */
.vision-panel .cue-row:not(.end-row) {
  height: auto;
  min-height: 64px;
}
.cue-time {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
}
.shot-number {
  color: #8493a2;
  font-size: .82em;
  line-height: 1;
  white-space: nowrap;
}
.cue-copy strong,
.cue-copy small {
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Reserve the right side for the duration value so long Shot/Comment text
   wraps inside the copy column instead of running under the duration label. */
.vision-panel .cue-copy {
  align-self: stretch;
  align-content: center;
  padding-right: 96px;
}
.vision-panel .cue-row:not(.end-row) {
  height: auto !important;
  min-height: 64px !important;
}

@media (orientation: portrait) and (max-width: 600px) {
  .vision-panel .cue-copy { padding-right: 70px; }
  .vision-panel .cue-row:not(.end-row) { min-height: 48px !important; }
}

/* Keep the moving duration fill almost as tall as its row, with only a
   2px breathing gap.  This also follows rows that grow for wrapped text. */
.vision-panel .duration-meter {
  top: 2px;
  right: 0;
  bottom: 2px;
  height: auto;
  transform: none;
}
.vision-panel .cue-row:not(.end-row) > .camera {
  height: auto;
  min-height: 22px;
  align-self: stretch;
  margin: 0;
}
.vision-panel .cue-row:not(.end-row) {
  padding-top: 2px;
  padding-bottom: 2px;
}

/* A MIX/WIPE is represented as a color hand-off at both ends: the outgoing
   cue fades toward the next camera during the overlap, while the incoming
   cue fades from the previous camera during its transition lead-in. */
.duration-meter.has-transition-gradient i {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--transition-color, var(--duration-color, #315b86)) 52%, #20252b) 0,
    color-mix(in srgb, var(--duration-color, #315b86) 52%, #20252b) var(--transition-px, 0px),
    color-mix(in srgb, var(--duration-color, #315b86) 52%, #20252b) calc(100% - var(--overlap-px, 0px)),
    color-mix(in srgb, var(--next-color, var(--duration-color, #315b86)) 52%, #20252b) 100%
  );
}

@media (orientation: portrait) and (max-width: 600px) {
  .vision-panel .cue-row:not(.end-row) {
    padding-left: 10px;
    padding-right: 6px;
  }
}

/* Show the actual MIX/WIPE duration beneath its command label. */
.command {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.command > strong {
  font: inherit;
  line-height: 1;
  white-space: nowrap;
}
.command > small {
  font-size: .68em;
  line-height: 1;
  font-weight: 600;
  opacity: .9;
  white-space: nowrap;
}

/* CuePilot marks disabled Vision cues with a diagonal slash. Keep the cue
   visible for reference, but make it clear that it is not playable. */
.vision-panel .cue-row.disabled {
  opacity: .58;
}
.vision-panel .cue-row.disabled .camera {
  position: relative;
}
.vision-panel .cue-row.disabled .camera::after {
  content: "";
  position: absolute;
  left: 8%;
  top: 47%;
  width: 84%;
  height: 3px;
  border-radius: 2px;
  background: #fff;
  transform: rotate(-45deg);
  box-shadow: 0 0 1px #000;
}
.vision-panel .cue-row.disabled .cue-copy,
.vision-panel .cue-row.disabled .command {
  text-decoration: line-through;
}
.vision-panel .cue-row.disabled .duration-meter {
  opacity: 0;
}

/* Vision A/B can now have independent Tally alerts. The outline stays outside
   each floating panel, so it does not change the cue viewport dimensions. */
body[data-alert-mode="border"] .vision-panel.tally-alert,
body[data-alert-mode="both"] .vision-panel.tally-alert {
  outline: 2px solid #ff1018;
  outline-offset: 1px;
  box-shadow: 0 0 12px #ff101855;
}
.vision-panel.tally-alert::after {
  content: "CAM " attr(data-tally-camera);
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 8;
  display: block;
  min-width: 88px;
  padding: 8px 12px;
  border-radius: 7px;
  background: #ff1018;
  color: #fff;
  text-align: center;
  font: 900 18px/1 ui-monospace, monospace;
  box-shadow: 0 4px 20px #0008;
  pointer-events: none;
}
body.tally-any-alert[data-alert-mode="both"] > header,
body.tally-any-alert[data-alert-mode="both"] > main,
body.tally-any-alert[data-alert-mode="both"] > footer {
  background-color: #4b080dcc;
}
body.tally-any-alert[data-alert-mode="both"] {
  background-color: #320609;
}

@media (orientation: portrait) and (max-width: 600px) {
  .vision-panel.tally-alert::after {
    right: 10px;
    bottom: 10px;
    min-width: 72px;
    padding: 7px 9px;
    border-radius: 6px;
    font-size: 15px;
  }
}

/* On phones keep the action buttons on the first footer row and put the
   last-command/last-sync status on a full-width line underneath. */
@media (orientation: portrait) and (max-width: 600px) {
  body > footer {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
  body > footer > div {
    order: 0;
    align-self: center;
  }
  body > footer > span {
    order: 1;
    width: 100%;
    flex: 0 0 auto;
    text-align: center;
  }
}
