﻿body {
    --live-simp-plat-change-border: var(--live-simp-plat-change-border-dark);
    --live-simp-border-width: 1.5px;
    --live-simp-border: var(--live-simp-border-width) solid var(--color-text-6);
    --live-simp-plat-change-border: 2px dashed var(--platform-label-background);
    --live-accent-border: #000;
}
body.light-mode {
    --live-simp-plat-change-border: 2px dashed #dc890d;
}


/* #region Balancing Table */

@scope (table.balance-table) to ([popover], [dialog]) {

    tr span.today,
    tr strong.today {
        background-color: var(--color-red);
        padding: 2px var(--style-padding-small);
        border-radius: var(--style-border-radius);
        color: #fff;
    }

    thead tr:first-of-type th {
        border-top: var(--border-regular);
    }

    th.date {
        border-left: var(--border-regular);
    }

    th.ampm.am {
        border-right: var(--border-regular);
    }

    th.ampm, td.bal-arr, td.bal-diff, td.bal-dep {
        padding: 0 var(--style-padding-medium);
    }

    td.bal-arr, td.bal-diff {
        border-right: none;
    }

    th.day-pad {
        border-right: var(--border-regular);
    }

    td .bal-badge {
        background-color: var(--color-back-5);
        color: var(--color-text-6);
        font-weight: 600;
        display: flex;
        justify-content: center;
        padding: 2px 0;
        width: 32px;
        border-radius: var(--style-border-radius);
    }

        td .bal-badge.bal-orange {
            background-color: var(--color-orange);
            outline-color: var(--color-orange) !important;
            color: #fff;
        }

        td .bal-badge.bal-red {
            background-color: var(--color-red);
            outline-color: var(--color-red) !important;
            color: #fff;
        }

    td.bal-diff.down .bal-badge {
        outline: 1px dashed;
        outline-offset: 1.5px;
    }
}
/* #endregion */

/* #region Depot Arr Dep Table */

table .depot-arr-dep {
  --dep-arr-dep-accent: #888;
}

@scope (table.depot-arr-dep) to ([dialog],[popover]) {
  tr:hover td:not(.selected),
  tr:has(> td.selected) td {
    background-color: var(--style-background-accent-ultrathin);
  }
  tr:has(> td.selected):hover td {
    background-color: var(--style-background-accent-thin);
  }
  td:hover.selectable,
  td.selected {
    background-color: color-mix(in srgb, var(--dep-arr-dep-accent) 15%, transparent) !important;
  }
  td.selected:hover {
    background-color: color-mix(in srgb, var(--dep-arr-dep-accent) 30%, transparent) !important;
  }
  td.selectable {
    cursor: pointer;
  }
  td .gen-lbl-pl {
    font-size: 11px;
    display: block;
    min-height: 0;
    padding: 0 3px;
  }
  td.arr-from {
    border-radius: var(--border-regular) !important;
  }
}

/* #endregion */

/* #region New Shared Timing List  */



@scope (table.shared-timing) to ([dialog],[popover]) {

    tr {
        height: auto;
    }

    th {
        padding: 0 var(--style-padding-tiny) var(--style-padding-tiny);
        font-weight: 500;
    }

        td:last-child {
            padding-right: 8px;
        }

        td.grow {
            width: 100%;
        }

    .align-left {
        text-align: left;
    }

    .align-right {
        text-align: right;
    }

    td > span.time {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        white-space: nowrap;
        text-wrap: nowrap;
        gap: 0;
    }

  /* #region Alt Coloring */
    tr:nth-of-type(odd) td {
        background-color: var(--style-background-accent-ultrathin);
    }
    tbody tr:last-child:nth-child(1) {
      background-color: transparent !important;
    }

    tr td:first-child {
        border-top-left-radius: var(--style-border-radius);
        border-bottom-left-radius: var(--style-border-radius);
    }

    tr td:last-child {
        border-top-right-radius: var(--style-border-radius);
        border-bottom-right-radius: var(--style-border-radius);
    }

/* #endregion */

  /* #region Location */

    th.loc {
        padding-left: 0;
    }

    td.loc {
        position: relative;
    }

        td.loc .loc-text {
            position: absolute;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            top: 0;
            bottom: 0;
            overflow: hidden;
        }

            td.loc .loc-text > * {
                min-width: 0;
                max-width: 100%;
                flex-grow: 0;
                flex-shrink: 1;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }
    /* #endregion */
    /* #region Platform Line Codes */

    td .gen-lbl-pl {
        padding: 0 3px;
        min-height: 0;
        min-width: 0;
        font-size: var(--size-font-small);
    }
    /* #endregion */
    /* #region Timing Marker Icon */

    td.tim-row-marker {
        position: relative;
        width: 24px;
        min-width: 24px;
        height: 100%;
        padding: 0 !important;
    }

        td.tim-row-marker + td {
            padding-left: 0 !important;
        }

        td.tim-row-marker figure {
            overflow: hidden;
            position: absolute;
            width: 100%;
            top: 0;
            bottom: 0;
            left: 0;
            z-index: 0;
        }

        td.tim-row-marker svg {
            position: absolute;
            top: calc(50% - 100px);
        }
    /* #endregion */


}

/* #endregion */

/* #region New Generic Timing List/Table */

table.gen-timing {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    position: relative;
    margin: var(--style-padding-medium) 0;
}

@scope (table.gen-timing) to ([dialog],[popover]) {

    

    td {
        height: 32px;
        padding: 0 var(--style-padding-tiny);
        white-space: nowrap;
        text-wrap: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    
    /* #region Text Coloring */

    tr.stop strong,
    tr.stop .strong {
        color: var(--color-text-1);
    }

    tr.stop {
        color: var(--color-text-2);
    }

        tr.stop .weak,
        tr.stop :has(.strong, strong) {
            color: var(--color-text-4);
        }

    tr.pass strong,
    tr.pass .strong {
        color: var(--color-text-5);
    }

    tr.pass {
        color: var(--color-text-6);
    }

    td.adj {
      text-wrap: nowrap;
      white-space: nowrap;
      text-align: right;
    }

        tr.pass .weak,
        tr.pass :has(.strong, strong) {
            color: var(--color-text-7);
        }

    a {
        color: inherit;
    }

        a:hover {
            text-decoration: underline;
        }
    /* #endregion */
    
    /* #region Schedule Sections */

    td.sec-detail {
      justify-items: center;
      text-align: center;
    }
    /* #endregion */

    /* #region Timing Load Grid */

    .stock-grid {
      display: grid;
      gap: var(--style-padding-small);
      grid-template-columns: auto auto auto auto;
      justify-content: start;
    }

    /* #endregion */
  }


/* #endregion */

/* #region New Generic Timings in Dashboard */

.dbd-content.table .control-item {
  margin: 0 var(--style-padding-medium);
}

@scope(.dbd-content .gen-timing) to ([popover],[dialog]) {
  td {
    border-radius: 0 !important;
    border: none !important;
  }
  td.tim-row-marker {
    border-right: none;
    width: 48px !important;
    max-width: 48px !important;
    min-width: 48px !important;
    padding-left: var(--style-padding-large) !important;
  }
  td.tim-row-marker svg {
    left: var(--style-padding-medium) !important;
  }
}


/* #endregion */

/* #region Location Simplifier Online Table */
.loc-simp-tbl-wrap {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  container-type: inline-size;
  container-name: loc-simplifier;
  display: block;
  padding: 0 var(--style-padding-tiny);
}
.light-mode .loc-simp-tbl-wrap {
  background-color: #fff;
}
table.loc-simp-tbl {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: table;
}
table.loc-simp-tbl td .schedule-list-timeline-wrap {
  height: 100%;
}
table.loc-simp-tbl .schedule-list-timeline-wrap .schedule-list-timeline {
  height: 100%;
}


@scope (.loc-simp-tbl-wrap) to ([dialog], [popover]) {

  tr {
    height: 36px;
    max-height: 36px;
    position: relative;
    z-index: 2;
  }

  

  tr::before {
    display: block;
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1.5px solid;
    background-color: var(--style-background-accent-thin);
    border: none;
    opacity: 0;
    z-index: -1;
    border-radius: var(--style-border-radius-tiny);
  }
  tr:hover::before {
    opacity: 0.35;
  }
  tr.selected::before {
    opacity: 0.5;
    background-color:var(--inline-brand-bg);
    background-color: color-mix(in srgb, var(--inline-brand-bg) 30%, transparent);
    border: 1px solid color-mix(in srgb, var(--inline-brand-bg) 100%, transparent);
  }
  tr.selected:hover::before {
    opacity: 0.8;
    background-color:var(--inline-brand-bg);
    background-color: color-mix(in srgb, var(--inline-brand-bg) 30%, transparent);
    border: 1px solid color-mix(in srgb, var(--inline-brand-bg) 100%, transparent);
  }
  tr.selected:has(+ .selected)::before {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  tr.selected + tr.selected::before {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
  /* .box:has(+ .circle) {
    width: 40px;
    height: 40px;
  } */

  tr td {
    z-index: 3;
  }
  tr.alt td {
    background-color: var(--color-table-alt);
  }
  tr:hover td {
    background-color: var(--color-table-hover);
  }
  tr td:first-child {
    border-top-left-radius: var(--style-border-radius-tiny);
    border-bottom-left-radius: var(--style-border-radius-tiny);
  }
  tr td:last-child {
    border-top-right-radius: var(--style-border-radius-tiny);
    border-bottom-right-radius: var(--style-border-radius-tiny);
  }
  /* tr:hover td {
    background-color: var(--style-background-accent-ultrathin);
  } */
  td {
    height: 36px;
    max-height: 36px;
    text-wrap: nowrap;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-right: var(--style-padding-medium);
    transition-property: opacity;
    transition-duration: var(--anim-duration-long);
    transition-delay: var(--anim-duration-medium);
    opacity: 1;

    @starting-style {
      opacity: 0;
    }
  }
  td:first-child {
    padding-left: var(--style-padding-medium);
  }

  td > span {
    max-width: 100%;
    text-wrap: nowrap;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  
  td:not(.main-ev, .loc-tmln),
  td:not(.main-ev, .loc-tmln) *,
  td:not(.main-ev, .loc-tmln) span {
    color: var(--style-text-quarternary);
  }
  td.main-ev,
  td.main-ev *,
  td.main-ev span {
    color: var(--style-text-primary);
  }
  td.loc {
    max-width: 120px;
    overflow: hidden;
  }
  td.loc .loc-lbl.short {
    display: none;
  }
  td.loc .loc-lbl.long {
    display: inline;
  }
  td.loc-row-dep.loc .loc-lbl {
    text-align: right;
  }
  td.loc a {
    display: inline;
  }
  td.loc-row-dep {
    text-align: right;
  }
  td a {
    opacity: 0.8;
  }
  td a:hover {
    opacity: 1;
    filter: brightness(1.1);
  }

  td.len {
    text-align: right;
  }
  

  td.loc-tmln {
    position: relative;
    width: 100%;
    padding: none;
  }
  td.loc-tmln::before,
  td.loc-tmln::after {
    position: absolute;
    content: '';
    top: 0;
    bottom: 0;
    width: 10px;
  }
  td.loc-tmln::before {
    left: 100%;
  }
  td.loc-tmln::after {
    right: 100%;
  }

  td.plat,
  td.line-code {
    min-width: 24px;
  }
  td.plat span,
  td.line-code span {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 19px;
    background-color: var(--style-background-accent-thin);
    border: 1px solid var(--style-background-accent-regular);
    border-radius: 3px !important;
    padding: 0 3px;
    min-width: 20px;
    font-weight: 700;
    font-size: 11px !important;
  }
  td.plat span {
    border-radius: var(--style-border-radius);
    font-size: 12px;
    background-color: orange;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  td.onreq span {
    border-radius: 0;
    opacity: 0.7;
  }
  td.loc a  span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  @container loc-simplifier (width < 700px) {
    td.loc .loc-lbl.short {
      display: inline;
    }
    td.loc .loc-lbl.long {
      display: none;
    }
  }

  @container loc-simplifier (width > 1200px) {
    td.loc {
      width: 180px !important;
      min-width: 180px !important;
      max-width: 180px !important;
    }
    td.veh,
    td.len {
      width: 48px !important;
      min-width: 48px !important;
      max-width: 48px !important;
    }
    /* td.plat,
    td.line-code,
    td.stage {
      width: 48px !important;
      min-width: 48px !important;
      max-width: 48px !important;
    } */
  }

}

/* #endregion */

/* #region Date Calendar Grid */

.date-cal-wrap {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

@scope (.date-cal-wrap) to ([popover], dialog) {
  table.date-grid {
    border-collapse: separate;
  }
  th {
    font-weight: 500;
    color: var(--color-text-2);
  }
  th.yr {
    color: var(--color-text-4);
  }
  th.mon, th.yr {
    text-align: left;
    height: 18px;
    position: relative;
  }
  th.mon span, th.yr span {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2;
    white-space: nowrap;
    text-wrap: nowrap;
  }
  th.dow {
    position: relative;
    width: 34px;
    min-width: 34px !important;
  }
  th.dow span {
    position: absolute;
    top: 50%;
    left: 0;
    z-index: 2;
    transform: translateY(-50%);
  }

  td {
    height: 9px;
    width: 9px;
    max-width: 9px;
    max-height: 9px;
    border: 1px solid;
    border-radius: 2px;
  }
  td.un {
    border-color: var(--color-text-5);
    opacity: 0.4;
  }



}

/* #endregion */

/* #region Date Range / Weekday Card Branded  */



.wkdy-crd-wrap {
    border-radius: 5px;
    border: 1px solid;
    overflow: hidden;
}
table.wkdy-crd {
    border-collapse: collapse;
}
table.wkdy-crd td {
    font-size: 12px;
    padding: 0 3px;
    text-align: center;
}

.dateval-brand {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: var(--style-padding-small);
}
.dateval-brand table.wkdy-crd {
  border-radius: 2px;
}
.dateval-brand table.wkdy-crd td {
  font-size: 10px;
  padding: 0 1.5px;
}

/* #endregion */

/* #region Date Calendar List */

.date-cal-list {
  display: flex;
  flex-direction: column;
}

@scope (.date-cal-list) to ([popover], [dialog]) {

  ol {
    display: flex;
    flex-direction: column;
    gap: var(--style-padding-tiny);
  }
  ol:not(:last-of-type) {
    margin-bottom: var(--style-padding-tiny);
    padding-bottom:  var(--style-padding-tiny);
    border-bottom: var(--border-regular);
  }

  ol > li {
    padding: var(--style-padding-tiny) var(--style-padding-small);
    border-radius: var(--style-border-radius);
  }
  ol > li:nth-of-type(odd) {
    background-color: var(--style-background-accent-ultrathin);
  }
  .cal-item {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between
  }
  .cal-item .lead,
  .cal-item .trail {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--style-padding-small);
  }
  ol > li > .cal-item .glyph {
    width: 12px;
    height: 12px;
    border: 1px solid;
    border-radius: var(--style-border-radius);
  }
}

.date-cal-table .date-grid-glyph {
  width: 12px;
    height: 12px;
    border: 1px solid;
    border-radius: var(--style-border-radius);
}

/* #endregion */

/* #region New Generic Diagram Leg List  */

.gen-diag-leg-list.narrow {
  width: 100%;
  max-width: 100%;
  min-width: 100%;
  position: relative;
  flex-direction: column;
  flex-wrap: nowrap;
}

@scope (.gen-diag-leg-list.narrow) to ([popover],[dialog]) {
  ol.gen-diag-legs {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100% !important;
    grid-template-columns: 1fr;
    position: relative;
  }

  ol.gen-diag-legs > li {
    background-color: var(--style-background-accent-ultrathin);
    border: 1px solid var(--style-background-accent-thin);
    padding: 0 var(--style-padding-medium);
    border-radius: var(--style-border-radius);
    flex-direction: row;
    display: grid;
    grid-template-columns: 56px 20px minmax(0px, 1fr);
    gap: 0 var(--style-padding-tiny);
    align-items: center;
    justify-content: center;
    max-width: 100%;
    margin-bottom: var(--style-padding-small);
  }

  ol.gen-diag-legs > li.selected,
  ol.gen-diag-legs > li:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
    background-color: var(--style-background-accent-thin);
  }
  
  ul.diag-row-items {
    display: contents;
  }
  ul.diag-row-items:first-child li {
    padding-top: var(--style-padding-tiny);
  }
  ul.diag-row-items:last-child li {
    padding-bottom: var(--style-padding-tiny);
  }
  ul.diag-row-items a:hover {
    text-decoration: underline;
  }

  .diag-row-items li > div {
    display: flex;
    align-items: center;
    height: var(--style-label-height) !important;
    max-height: var(--style-label-height) !important;
    min-height: var(--style-label-height) !important;
  }

  .diag-row-items li.leg-icon {
    overflow: clip;
  }
  .diag-row-items li.leg-icon > div {
    justify-self: center;
    width: 16px;
    height: auto;
    position: relative;
  }
  .diag-row-items li.leg-icon:has(.hstack) > div {
    justify-self: end;
  }
  
  .diag-row-items li.leg-lead > div {
    justify-self: end;
  }
  .diag-row-items .pfm {
    background-color: var(--platform-label-background);
        color: #000;
        min-width: var(--style-label-height);
        display: flex;
        justify-content: center;
        font-weight: 700;
        border-radius: var(--style-border-radius);
  }

  .diag-row-items li.leg-body {
    display: flex;
    flex-shrink: 1;
    flex-grow: 0;
    max-width: 100%;
    position: relative;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: var(--style-padding-small);
  }
  .diag-row-items li.leg-body .lead {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
  }
  .diag-row-items li.leg-body .lead > * {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .diag-row-items li.leg-body .trail {
    white-space: nowrap;
  }
}

/* #endregion */

/* #region LIVE Simplifier */

.live-loc-simp {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  container-type: inline-size;
  container-name: live-simplifier;
  display: block;
  padding: 0 var(--style-padding-tiny);
}

table.live-location {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-wrap: nowrap;
    position: relative;
    z-index: 2;
}

@scope (table.live-location) to ([popover],[dialog]) {

  tr {
    position: relative;
  }
  
  tr a:focus,
  tr a:focus span {
    text-decoration: underline;
  }

    tr.even:not(.warn-canc) td {
        background-color: var(--color-table-alt);
    }
    tr:hover:not(.selected) td {
        background-color: var(--color-table-hover);
    }
    tr td:first-child {
        border-top-left-radius: var(--style-border-radius-tiny);
        border-bottom-left-radius: var(--style-border-radius-tiny);
    }
    tr td:last-child {
        border-top-right-radius: var(--style-border-radius-tiny);
        border-bottom-right-radius: var(--style-border-radius-tiny);
    }

    tr {
      transition-property: opacity;
      transition-duration: var(--anim-duration-long);
      transition-delay: var(--anim-duration-medium);
      opacity: 1;

      @starting-style {
        opacity: 0;
      }
    }
    

    
    td a {
      cursor: pointer;
      color: var(--color-text-3);
    }
    td a:hover {
      color: var(--color-text-1);
    }
    tr.complete a {
      color: var(--color-text-6);
    }
    tr.complete a:hover {
      color: var(--color-text-4);
    }

    td {
        height: 36px;
        padding: 0 var(--style-padding-tiny);
    }
    td:first-child {
        padding-left: var(--style-padding-small);
    }
    td:last-child {
        padding-right: var(--style-padding-small);
    }
    td.brand {
        text-align: center;
        justify-content: center;
    }
    td.brand span:has(svg) {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    td.loc {
      width: 50%;
    }
    td.loc.dep {
        text-align: right;
    }
    td.brand.canc {
      filter: grayscale(1);
      opacity: 0.5;
    }
    tr.complete td.brand > * {
      filter: grayscale(1);
      opacity: 0.8;
    }
    td.trainid.canc,
    td.loc .canc {
      opacity: 0.5;
      text-decoration: line-through;
    }
    td.plat span,
    td.line-code span {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 20px;
        background-color: var(--style-background-accent-thin);
        border: 1px solid var(--style-background-accent-regular);
        border-radius: 3px !important;
        padding: 0 3px;
        min-width: 20px;
        font-weight: 700;
        max-width: 48px;
    }
    td.plat.changed span {
        outline-offset: 1.5px;
        outline: 1.5px dashed var(--platform-label-background);
        animation: plat-change-flash 1s infinite;
    }
    @keyframes plat-change-flash {
      0% {outline-color: transparent;}
      15% {outline-color: var(--platform-label-background);}
      100% {outline-color: transparent;}
    }

    td.live-caps,
    td.wtt-caps,
    td.error-caps {
      position: relative;
      justify-content: stretch;
      padding: 0;
    }
    /* td.live-caps {
    } */
    td.wtt-caps {
      padding: 0 var(--style-padding-small);
      color: var(--color-text-6);
    }
    td.error-caps {
      background-color: orange !important;
    }
    
    tr.complete td {
      transition-property: opacity;
      transition-duration: var(--anim-duration-short);
    }
    tr.complete td.plat .plat-icon,
    tr.warn-canc td.plat .plat-icon {
      background-color: var(--color-back-6) !important;
    }
    tr.complete td.plat.changed span {
      animation: plat-change-flash-complete 1s infinite;
    }
    @keyframes plat-change-flash-complete {
      0% {outline-color: transparent;}
      15% {outline-color: var(--color-back-6);}
      100% {outline-color: transparent;}
    }

    /* #region Selection */

    tr {
      position: relative;
    }
    tr.selected::before {
      content: '';
      display: block;
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: orange;
      overflow: clip;
      border: 1px solid;
      border-radius: var(--style-border-radius-tiny);
      background-color:var(--inline-brand-bg);
      background-color: color-mix(in srgb, var(--inline-brand-bg) 30%, transparent);
      border-color: color-mix(in srgb, var(--inline-brand-bg) 100%, transparent);
      opacity: 0.5;
    }
    tr.selected:hover::before {
      opacity: 0.7;
    }


    /* #endregion */

    /* #region Capsule Styling */

    .live-body {
      border: var(--live-simp-border);
      flex-grow: 1;
      width: 100%;
      height: 20px;
      padding: 0 var(--style-padding-small);
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      gap: var(--style-padding-tiny);
      min-width: 24px;
      align-items: center;
      justify-content: center;
    }
    .live-body.canc {
      border-style: dashed;
    }
    .live-body.dwell {
      padding: 0 var(--style-padding-tiny);
      border-left: none;
    }

    td.pass .group-dep {
      width: 100%;
    }
    .live-body.pass {
      width: 100%;
      border-right: none;
      border-left: none;
      mask-image: linear-gradient(90deg, transparent 0px, black var(--style-padding-medium), black calc(100% - var(--style-padding-medium)), transparent 100%);
    }

    td.live-caps .group-arr,
    td.live-caps .group-dep {
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      align-items: center;
      gap: var(--style-padding-small);
    }

    td.live-caps.pass {
      text-align: right;
    }

    .group-arr {
      justify-self: end;
    }
    .group-dep {
      justify-self: start;
    }

    .live-body {
      color: var(--color-text-4);
      border-color: var(--style-background-accent-thick);
    }
    .live-body.confirmed {
      color: var(--color-text-6);
      border-color: var(--style-background-accent-regular);
    }

    .live-body.arr,
    .live-body.dep {
      width: 56px;
      max-width: 56px;
      min-width: 56px;
      overflow: hidden;
    }
    .live-body.arr {
      border-left: none;
      justify-content: end;
      mask-image: linear-gradient(90deg, transparent 0px, black var(--style-padding-medium));
    }
    .live-body.dep {
      border-right: none;
      justify-content: start;
      mask-image: linear-gradient(270deg, transparent 0px, black var(--style-padding-medium));
    }
    .live-body.dep:not(.origin) {
      border-left: none;
    }
    .live-body.terminus {
      border-top-right-radius: var(--style-border-radius);
      border-bottom-right-radius: var(--style-border-radius);
    }
    .live-body.origin {
      border-top-left-radius: var(--style-border-radius);
      border-bottom-left-radius: var(--style-border-radius);
    }

    .live-body.early {
      border-color: var(--color-cyan) !important;
      color: var(--color-cyan);
      background-color: color-mix(in srgb, var(--color-cyan) 10%, transparent);
    }

    .live-body.small-late {
      border-color: var(--color-orange) !important;
      color: var(--color-orange);
      background-color: color-mix(in srgb, var(--color-orange) 10%, transparent);
    }

    .live-body.medium-late {
      border-color: var(--color-red) !important;
      color: var(--color-red);
      background-color: color-mix(in srgb, var(--color-red) 10%, transparent);
    }

    .live-body.large-late {
      border-color: var(--color-purple) !important;
      color: var(--color-purple);
      background-color: color-mix(in srgb, var(--color-purple) 10%, transparent);
    }

    .live-body.canc {
      border: 1.5px dotted #888 !important;
      border: none;
      color: #888;
      text-decoration: line-through;
      background-color: transparent !important;
    }

    tr.starts .live-body.arr,
    tr.starts .live-body.dwell {
      background-color: color-mix(in srgb, var(--color-yellow) 50%, transparent);
      color: var(--color-yellow);
      border-color: var(--color-yellow);
      border-style: dashed;
    }
    tr.starts .live-body.arr {
      border-left: none;
    }
    tr.starts .live-body.dwell {
      border-left: none;
      border-right-style: solid;
    }

    tr.terminates .live-body.dwell,
    tr.terminates .live-body.dep {
      background-color: color-mix(in srgb, var(--color-yellow) 50%, transparent);
      color: var(--color-yellow) !important;
      border-color: var(--color-yellow) !important;
      border-style: dashed;
    }
    tr.terminates .live-body.dep {
      border-left: none;
      border-right: none;
    }
    tr.terminates .live-body.dwell {
      border-left: none;
      border-right-style: dashed;
    }
  
    tr {
      position: relative;
    }
    tr::before {
      content: '';
      display: block;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      position: absolute;
      z-index: -1;
      border-radius: var(--style-border-radius-tiny);
      background-color: transparent;
      opacity: 0;
      border: 1.5px solid transparent;
    }
    tr:hover:before {
      opacity: 0.5;
    }

    tr.warn-canc::after,
    tr.warn-chan::after,
    tr.warn-info::after {
      content: '';
      display: block;
      top: 1.5px;
      left: 1.5px;
      right: 1.5px;
      bottom: 1.5px;
      position: absolute;
      z-index: -1;
        background:  repeating-linear-gradient(
          -45deg,
          transparent,
          transparent 10px,
          var(--style-background-accent-thin) 10px,
          var(--style-background-accent-thin) 20px
        );
      z-index: -1;
      border-radius: var(--style-border-radius-tiny);
      overflow: clip;
    }

    tr.warn-canc.starts::after,
    tr.warn-chan.starts::after,
    tr.warn-info.starts::after {
      right: 50%;
      mask-image: linear-gradient(90deg, black calc(100% - var(--style-padding-medium)), transparent 100%);
    }

    tr.warn-canc.terminates::after,
    tr.warn-chan.terminates::after,
    tr.warn-info.terminates::after {
      left: 50%;
      mask-image: linear-gradient(90deg, black calc(100% - var(--style-padding-medium)), transparent 100%);
    }

    /* #endregion */


    /* #region Marker Icon */

    .live-caps .rep-late-ico {
      width: 12px;
      height: 12px;
    }
    .rep-late-ico {
        display: flex;
        align-items: center;
    }
    .rep-late-ico.early {
      color: var(--color-cyan) !important;
    }
    .rep-late-ico.on-time {
        color: var(--color-green) !important;
    }
    .rep-late-ico.small-late {
        color: var(--color-orange) !important;
    }
    .rep-late-ico.medium-late {
        color: var(--color-red) !important;
    }
    .rep-late-ico.large-late {
        color: var(--color-purple) !important;
    }

    /* #endregion */


    .live-change-item {
      display: flex;
      flex-shrink: 1;
      min-width: 0;
      max-width: 160px;
      overflow: hidden;
      flex-grow: 0;
      gap: var(--style-padding-medium);
    }
    .live-change-body {
      background-color: grey;
      display: flex;
      flex-direction: row;
      flex-grow: 1;
      flex-shrink: 1;
      min-width: 9;
      max-width: 100%;
      text-wrap: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
      align-items: center;
      height: 20px;
      gap: var(--style-padding-tiny);
      padding: 0 var(--style-padding-tiny);
      border-radius: var(--style-border-radius);
    }
    .live-change-body svg {
      width: 16px;
      height: 16px;
      min-width: 16px;
      min-height: 16px;
      flex-shrink: 0;
    }
    .live-change-body.info {
      background-color: color-mix(in srgb, var(--color-cyan) 20%, transparent);
      color: var(--color-cyan);
    }
    .live-change-body.change {
      background-color: color-mix(in srgb, var(--color-yellow) 20%, transparent);
      color: var(--color-yellow);
    }
    .live-change-body.cancellation {
      background-color: color-mix(in srgb, var(--color-red) 20%, transparent);
      color: var(--color-red);
    }
    .live-change-body span {
      display: block;
      text-wrap: nowrap;
      text-overflow: ellipsis;
    }
}

/* #endregion */

/* #region Live Badge */

.late-badge {
  display: flex;
  justify-content: center;
  padding: 0 1px;
  border-radius: var(--style-border-radius);
  /* border: 1.5px solid rgba(0, 0, 0, 0.4); */
  color: #fff;
  min-width: 28px;
  font-size: 11px;
}

.late-badge.on-time {
  background-color: var(--style-background-accent-ultrathin);
  color: var(--style-background-accent-thick);
  border-color: var(--style-background-accent-thin);
}

.late-badge.early {
  background-color: color-mix(in srgb, var(--color-cyan) 35%, transparent);
  color: var(--color-cyan);
  outline-color: var(--color-cyan);
}
.late-badge.small-late {
  background-color: color-mix(in srgb, var(--color-orange) 35%, transparent);
  color: var(--color-orange);
  outline-color: var(--color-orange);
}
.late-badge.medium-late {
  background-color: color-mix(in srgb, var(--color-red) 35%, transparent);
  color: var(--color-red);
}
.late-badge.large-late {
  background-color: color-mix(in srgb, var(--color-purple) 35%, transparent);
  color: var(--color-purple);
}

.late-badge.confirmed.early {
  background-color: color-mix(in srgb, var(--color-cyan) 10%, transparent);
}
.late-badge.confirmed.small-late {
  background-color: color-mix(in srgb, var(--color-orange) 10%, transparent);
}
.late-badge.confirmed.medium-late {
  background-color: color-mix(in srgb, var(--color-red) 10%, transparent);
}
.late-badge.confirmed.large-late {
  background-color: color-mix(in srgb, var(--color-purple) 10%, transparent);
}

/* tr.complete .late-badge:not(.on-time) {
  opacity: 0.6;
}  */

/* #endregion */

/* #region Live Timing Table  */

.dbd .live-sch-tim-opt {
  padding: var(--style-padding-large) var(--style-padding-large) 0;
  gap: var(--style-padding-large);
}
.dbd .live-sch-tim-opt .control-item {
  margin: 0;
}
.live-sch-tim-opt {
  display: flex;
  width: 100%;
  gap: var(--style-padding-small);
  margin-bottom: var(--style-padding-medium);
}
.live-sch-tim-opt > .opt {
  display: flex;
  flex-grow: 1;
}
.live-sch-tim-opt > .opt > * {
  width: 100%;
}

table.live-sch-timings {
  width: 100%;
  min-width: 100%;
  max-width: 100%;

  --live-marker-active: var(--color-text-5);
  --live-marker-canc: var(--color-text-7);
}


@scope (table.live-sch-timings) to ([popover],[dialog]) {

  td {
    height: 32px;
    max-height: 32px;
    overflow: hidden;
    white-space: nowrap;
    text-wrap: nowrap;
    text-overflow: ellipsis;
  }
  td.rte {
    position: relative;
    width: 28px;
    min-width: 28px;
    overflow: visible;
  }
  td.rte > .marker {
    position: relative;
    width: 28px;
    height: 100%;
    overflow: hidden;
    z-index: 1;
  }
  td.rte > .marker > * {
    position: absolute;
    top: 50%;
    left: var(--style-padding-tiny);
    transform: translateY(-50%);
    z-index: 2;
  }
  td.loc {
    width: 100%;
    position: relative;
  }
  td.loc .loc-text {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    top: 0;
    bottom: 0;
    overflow: hidden;
  }

  td.plat {
    width: 0%;
  }
  tr.compl td.plat .gen-lbl-pl,
  tr.compl td.line .gen-lbl-pl {
    background-color: var(--color-back-5);
    color: #000;
  }
  
  td.time {
    padding: 0 var(--style-padding-tiny);
  }
  td.time span.weak {
    color: inherit;
    opacity: 0.5;
  }
  td.late {
    padding: 0 var(--style-padding-tiny);

  }

  td.dwell > .dwell-badge {
    text-align: right;
    padding: 0 var(--style-padding-tiny);
  }

  tr.early .rte,
  tr.early.compl td.rep,
  td.dwell .dwell-badge.actual.early,
  tr.arrived td.time.rep.early span  {
    color: var(--color-cyan) !important;
  }
  tr.on-time .rte,
  tr.on-time.compl td.rep,
  td.dwell .dwell-badge.actual.on-time,
  tr.arrived td.time.rep.on-time span  {
    color: var(--color-green) !important;
  }
  tr.small-late .rte,
  tr.small-late.compl td.rep,
  td.dwell .dwell-badge.actual.small-late,
  tr.arrived td.time.rep.small-late span  {
    color: var(--color-orange) !important;
  }
  tr.medium-late .rte,
  tr.medium-late.compl td.rep,
  td.dwell .dwell-badge.actual.medium-late,
  tr.arrived td.time.rep.medium-late span  {
    color: var(--color-red) !important;
  }
  tr.large-late .rte,
  tr.large-late.compl td.rep,
  td.dwell .dwell-badge.actual.large-late,
  tr.arrived td.time.rep.large-late span  {
    color: var(--color-purple) !important;
  }

  tr.compl td.time.rep {
    color: inherit;
  }

  td.wtt {
    color: var(--color-text-6);
  }
  tr.canc td:not(.plat, .late) * {
    color: var(--color-text-7);
  }

  tr.stop a {
    color: var(--color-text-1);
  }
  tr.pass a {
    color: var(--color-text-4);
  }
  a {
    opacity: 0.8;
  }
  a:hover {
    opacity: 1;
  }
  tr.compl a {
    color: var(--color-text-6);
  }

  tr.canc td.loc a {
    text-decoration: line-through;
  }
  tr.canc:not(.int-cancel) td.plat > *,
  tr.canc:not(.int-cancel) td.rep > *,
  tr.canc:not(.int-cancel) td.late > * {
    display: none;
  }

  tr.compl {
    --live-marker-active: var(--color-text-7);
  }

  
  tr .last-rep {
    z-index: 20;
    width: 36px;
    height: 36px;
    position: absolute;
    top: calc(50% - 18px);
    left: calc(50% - 17px);
  }
  tr.departed .last-rep {
    top: calc(100% - 18px);
  }  
  tr .last-rep .mark {
    z-index: 7;
    background-color: currentColor;
    width: 10px;
    height: 10px;
    left: calc(50% - 5px);
    top: calc(50% - 5px);
    border-radius: 50%;
    border: 1.5px solid rgba(44, 44, 44, 0.4);
    position: absolute;
    border-radius: 100%;
  }

  tr .last-rep .pulse {
    position: absolute;
    z-index: 6;
    filter: blur(1px);
  }
  tr .last-rep .pulse::before,
  tr .last-rep .pulse::after {
    position: absolute;
    content: '';
    width: 36px;
    height: 36px;
    opacity: 0.5;
    background-color: currentColor;
    top: 0;
    left: 0;
    border-radius: 50%;
    opacity: 0;
    animation: pulse-live 4s infinite;
    z-index: -1;
  }
  tr .last-rep .pulse::before {
    animation-delay: 0;
  }
  tr .last-rep .pulse::after {
    animation-delay: 1s;
  }
  tr .last-rep .pulse.p2::before {
    animation-delay: 2s;
    display: block;
  }
  tr .last-rep .pulse.p2::after {
    animation-delay: 3s;
    display: block;
  }

  @keyframes pulse-live {
    0% {
      transform: scale(0);
      opacity: 1;
    }
    100% {
      transform: scale(1);
      opacity: 0;
    }
  }

}

/* #endregion */


/* #region Live Schedule Timings */

@scope (.dbd-wrap) to ([dialog],[popover]) {
  table.live-sch-timings td {
    border: none;
    border-radius: 0 !important;
  }
  table.live-sch-timings td.rte {
    padding-left: var(--style-padding-small);
    padding-right: 0;
  }
  table.live-sch-timings tr .last-rep {
    top: calc(50% - 18px);
    left: calc(50% - 13px);
  }
  table.live-sch-timings tr.departed .last-rep {
    top: calc(100% - 18px);
  }
}

/* #endregion */

/* #region Live Sch Alterations and Reports */

.live-sch.info-box {
  display: flex;
  justify-content: center;
  padding: var(--style-padding-small);
  border-radius: var(--style-border-radius);
  border: 1.5px solid;
}
.live-sch.info-box + .live-sch.info-box {
  margin-top: var(--style-padding-small);
}
.live-sch.info-box > .rep-wrap {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
}
.live-sch.info-box > .rep-wrap .body {
  display: block;
  text-wrap: balance;
}
.live-sch.info-box > .rep-wrap .body > * {
  display: inline;
}
.live-sch.info-box > .rep-wrap > .ico {
  align-items: center;
  display: flex;
  padding-right: var(--style-padding-small);
}
.live-sch.info-box > .rep-wrap > .nowrap {
  white-space: nowrap;
  text-wrap: nowrap;
}
.live-sch.info-box.early {
  background-color: color-mix(in srgb, var(--color-cyan) 60%, transparent);
  border-color: color-mix(in srgb, var(--color-cyan) 80%, rgba(160, 160, 160, 0.5));
}
.live-sch.info-box.on-time {
  background-color: color-mix(in srgb, var(--color-green) 60%, transparent);
  border-color: color-mix(in srgb, var(--color-green) 80%, rgba(160, 160, 160, 0.5));
}
.live-sch.info-box.small-late {
  background-color: color-mix(in srgb, var(--color-orange) 60%, transparent);
  border-color: color-mix(in srgb, var(--color-orange) 80%, rgba(160, 160, 160, 0.5));
}
.live-sch.info-box.medium-late,
.live-sch.info-box.error {
  background-color: color-mix(in srgb, var(--color-red) 60%, transparent);
  border-color: color-mix(in srgb, var(--color-red) 80%, rgba(160, 160, 160, 0.5));
}
.live-sch.info-box.large-late {
  background-color: color-mix(in srgb, var(--color-purple) 60%, transparent);
  border-color: color-mix(in srgb, var(--color-purple) 80%, rgba(160, 160, 160, 0.5));
}
.live-sch.info-box.warn {
  background-color: color-mix(in srgb, var(--color-yellow) 60%, transparent);
  border-color: color-mix(in srgb, var(--color-yellow) 80%, rgba(160, 160, 160, 0.5));
}
.light-mode .live-sch.info-box.warn * {
  color: #000;
}

.light-mode .live-sch.info-box.early {
  background-color: color-mix(in srgb, var(--color-cyan) 90%, transparent);
}
.light-mode .live-sch.info-box.on-time {
  background-color: color-mix(in srgb, var(--color-green) 90%, transparent);
}
.light-mode .live-sch.info-box.small-late {
  background-color: color-mix(in srgb, var(--color-orange) 90%, transparent);
}
.light-mode .live-sch.info-box.medium-late {
  background-color: color-mix(in srgb, var(--color-red) 90%, transparent);
}
.light-mode .live-sch.info-box.very-late {
  background-color: color-mix(in srgb, var(--color-purple) 90%, transparent);
}


.live-sch.info-box * {
  color: rgba(255, 255, 255, 0.8);
}
.live-sch.info-box strong {
  color: rgba(255, 255, 255, 1);
}

/* #endregion */

/* #region QuickGridInfoStyle */

table.qk-grid-info {
}

table.row-height-36 tr th,
table.row-height-36 tr td {
  height: 36px;
}

table.qk-grid-info.border-top thead tr th::before,
table.qk-grid-info.border-top thead tr th::after {
  position: absolute;
  content: '';
  display: block;
  left: 0;
  right: 0;
  background-color: var(--color-back-3);
  height: 0.5px;
}
table.qk-grid-info.border-top thead tr th::before {
  top: 0;
}
table.qk-grid-info.border-top thead tr th::after {
  bottom: 0;
}

@scope (table.qk-grid-info) to ([dialog],[popover]) {

  th,
  td {
    padding: 0 var(--style-padding-large) !important;
  }
  th {
    font-family: var(--font-default);
  }
  th .col-header-content,
  th .col-title {
    display: contents;
  }
  td {
    border-right: none !important;
    border-left: none !important;
  }

  td * {
    white-space: nowrap;
  }

  td > button.none {
    margin: 0 calc(var(--style-padding-small) * -1);
  }

  th:first-of-type,
  td:first-of-type {
    padding-left: var(--style-padding-xxxlarge) !important;
  }
  th:last-of-type,
  td:last-of-type {
    padding-right: var(--style-padding-xxxlarge) !important;
  }
  tr:hover {
    background-color: var(--style-background-accent-ultrathin);
  }

  button.col-title,
  div.col-title {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: start;
    gap: var(--style-padding-tiny);
    flex-shrink: 1 !important;
    flex-grow: 0 !important;
    margin: 0 calc(var(--style-padding-small) * -1);
  }
  button.col-title *,
  div.col-title * {
    color: var(--color-text-5);
  }
  button.col-title:hover * {
    color: var(--color-text-1);
  }
  button.col-title:hover {
    background-color: var(--style-background-accent-thin) !important;
  }
  

  button.col-title .sort-indicator {
    background-color: var(--color-text-6);
    transition: none;
    opacity: 0 !important;
  }
  button.col-title:hover .sort-indicator {
    background-color: var(--color-text-2) !important;
  }

  th.col-sort-desc .sort-indicator,
  th.col-sort-asc .sort-indicator,
  button.col-title:hover .sort-indicator {
    opacity: 1 !important;
  }

  .col-justify-end .col-header-content {
    justify-content: end;
    padding-right: 0 !important;
    padding-left: var(--style-padding-medium);
  }
  .col-justify-end button.col-title,
  .col-justify-end div.col-title {
    flex-direction: row-reverse;
  }
}

/* #endregion */

/* #region Table Horizontal Capsule */

ul.qk-grid-h-capsules {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: var(--style-padding-tiny);
}

@scope (.qk-grid-h-capsules) to ([dialog], [popover]) {
  li.contents {
    display: contents;
  }
  .capsule {
    border: var(--border-regular);
    height: var(--style-label-height);
    align-items: center;
    display: flex;
    padding: 0 var(--style-padding-tiny);
    border-radius: var(--style-border-radius-tiny);
  }
  .capsule.selectable > * {
    opacity: 0.7;
  }

  .capsule.selectable:hover, 
  .capsule.selectable.selected {
    background-color: var(--style-background-accent-thin);
    border-color: var(--style-background-accent-thick);
  }
  .capsule.selectable.selected:hover {
    background-color: var(--style-background-accent-regular);
    border-color: var(--style-background-accent-ultrathick);
  }
  .capsule.selectable:hover > *, 
  .capsule.selectable.selected > * {
    opacity: 1;
  }
}

/* #endregion */




