:root {
    --bg: #050a0d;
    --panel: #071116;
    --line: #073742;
    --line2: #0a5664;
    --fg: #b8f8ff;
    --muted: #4aa8b5;
    --dim: #1d6570;
    --accent: #00eaff;
    --accent2: #00bfd2;
    --danger: #ff5d72;
    --warn: #ffb35c;
    --ok: #00ffa8
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--fg);
    font: 14px/1.5 Consolas, "Segoe UI", monospace;
    letter-spacing: .045em;
    background: radial-gradient(circle at 45% -20%, rgba(0, 234, 255, .14), transparent 38%), linear-gradient(rgba(0, 234, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 234, 255, .035) 1px, transparent 1px), linear-gradient(180deg, #071016, #030608);
    background-size: auto, 48px 48px, 48px 48px, auto
}

body:before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(transparent 50%, rgba(0, 0, 0, .25) 50%);
    background-size: 100% 4px;
    z-index: 10
}

.skip-link {
    position: absolute;
    left: -999px
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    z-index: 20
}

a {
    color: var(--accent);
    text-decoration: none
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 58px;
    z-index: 15;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line2);
    background: rgba(4, 11, 14, .94);
    box-shadow: 0 0 24px rgba(0, 234, 255, .12)
}

.brand-lockup {
    width: 240px;
    padding-left: 24px
}

.grid-logo {
    font-size: 22px;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 6px var(--accent), 0 0 18px rgba(0, 234, 255, .55)
}

.topnav {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 30px;
    height: 100%;
    align-items: center
}

.topnav a {
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 800;
    font-size: 12px;
    color: var(--muted);
    border-bottom: 3px solid transparent;
    text-transform: uppercase
}

.topnav a.active,
.topnav a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
    text-shadow: 0 0 8px var(--accent)
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 20px
}

.icon-button {
    background: transparent;
    border: 0;
    color: var(--accent);
    font: inherit;
    font-size: 20px;
    cursor: pointer
}

.access-button {
    height: 30px;
    min-width: 148px;
    background: rgba(0, 234, 255, .04);
    border: 1px solid var(--accent);
    color: var(--accent);
    font: 800 12px/1 Consolas, monospace;
    letter-spacing: .13em
}

.operator-orb {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line2);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: radial-gradient(circle, rgba(0, 234, 255, .18), transparent 68%);
    font-size: 10px
}

.side-rail {
    position: fixed;
    z-index: 14;
    top: 58px;
    left: 0;
    bottom: 0;
    width: 240px;
    background: linear-gradient(180deg, rgba(7, 18, 23, .96), rgba(3, 8, 11, .98));
    border-right: 1px solid var(--line2);
    display: flex;
    flex-direction: column
}

.operator-card {
    height: 72px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line)
}

.operator-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--accent);
    color: var(--accent);
    background: #02080a
}

.operator-card strong {
    display: block;
    color: var(--accent);
    font-size: 13px
}

.operator-card small {
    display: block;
    color: var(--muted);
    font-size: 10px
}

.side-nav {
    padding-top: 24px
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 56px;
    padding: 0 22px;
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
    border-right: 3px solid transparent
}

.side-nav a.active,
.side-nav a:hover {
    background: linear-gradient(90deg, rgba(0, 234, 255, .13), rgba(0, 234, 255, .03));
    color: var(--accent);
    border-right-color: var(--accent)
}

.side-nav a span {
    font-size: 17px;
    color: var(--accent2)
}

.side-bottom {
    margin-top: auto;
    padding: 20px
}

.encrypt-button {
    width: 100%;
    height: 42px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-weight: 900;
    letter-spacing: .13em;
    box-shadow: 0 0 12px rgba(0, 234, 255, .18), inset 0 0 12px rgba(0, 234, 255, .08)
}

.disconnect-link {
    margin-top: 18px;
    background: transparent;
    border: 0;
    color: var(--muted);
    font: inherit;
    font-size: 11px
}

.shell {
    margin-left: 240px;
    padding: 88px 38px 120px;
    min-height: 100vh
}

.grid-footer {
    position: fixed;
    left: 240px;
    right: 0;
    bottom: 0;
    z-index: 13;
    height: 58px;
    border-top: 1px solid var(--line);
    background: rgba(3, 8, 10, .94);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    color: var(--dim);
    font-size: 10px;
    letter-spacing: .18em
}

.grid-footer nav {
    display: flex;
    gap: 30px
}

.grid-footer strong {
    color: var(--accent)
}

.terminal-card,
.terminal-window,
.key-card {
    position: relative;
    background: linear-gradient(180deg, rgba(8, 22, 28, .78), rgba(4, 10, 13, .86));
    border: 1px solid rgba(0, 234, 255, .22);
    box-shadow: 0 22px 50px rgba(0, 0, 0, .26);
    padding: 24px;
    margin-bottom: 24px
}

.terminal-card:before,
.terminal-window:before,
.key-card:before {
    content: "";
    position: absolute;
    inset: -1px;
    pointer-events: none;
    background: linear-gradient(90deg, var(--accent) 10px, transparent 10px) top left/68px 2px no-repeat, linear-gradient(var(--accent) 10px, transparent 10px) top left/2px 68px no-repeat, linear-gradient(270deg, var(--accent) 10px, transparent 10px) bottom right/68px 2px no-repeat, linear-gradient(0deg, var(--accent) 10px, transparent 10px) bottom right/2px 68px no-repeat
}

.terminal-card h1,
.terminal-card h2 {
    margin-top: 0;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .08em
}

.terminal-card p {
    color: var(--muted)
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.35fr .75fr;
    gap: 28px
}

.terminal-titlebar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line2);
    color: var(--accent);
    font-weight: 800
}

.type-intro {
    min-height: 340px;
    white-space: pre-wrap;
    color: var(--accent);
    font-size: 18px;
    line-height: 1.7;
    text-shadow: 0 0 8px rgba(0, 234, 255, .35)
}

.link-grid,
.cards-grid,
.status-grid,
.key-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 24px
}

.terminal-tile {
    min-height: 92px;
    display: flex;
    align-items: end;
    border: 1px solid rgba(0, 234, 255, .28);
    background: linear-gradient(180deg, rgba(0, 234, 255, .06), rgba(0, 0, 0, .1));
    padding: 20px;
    color: var(--accent);
    font-weight: 900;
    text-transform: uppercase;
    box-shadow: inset 0 -2px 0 var(--accent2)
}

.terminal-button {
    font: 800 12px/1 Consolas, monospace;
    color: var(--accent);
    background: rgba(0, 234, 255, .035);
    border: 1px solid rgba(0, 234, 255, .65);
    padding: 11px 14px;
    cursor: pointer;
    text-transform: uppercase
}

input,
textarea {
    width: 100%;
    font: inherit;
    color: var(--fg);
    background: rgba(0, 0, 0, .28);
    border: 1px solid rgba(0, 234, 255, .25);
    padding: 12px 14px
}

input:focus,
textarea:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(0, 234, 255, .18)
}

.terminal-form {
    display: grid;
    gap: 16px;
    margin-bottom: 24px
}

.terminal-form.inline {
    grid-template-columns: 1fr 1fr 1fr auto;
    align-items: end
}

.terminal-form label {
    display: grid;
    gap: 6px;
    color: var(--accent);
    font-size: 11px;
    text-transform: uppercase
}

.button-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

.input-with-button {
    display: flex;
    gap: 8px
}

.input-with-button input {
    flex: 1
}

.hidden {
    display: none !important
}

.secure-only,
.anon-only {
    display: none
}

.is-authenticated .secure-only {
    display: block
}

.is-anonymous .anon-only {
    display: block
}

.secure-link {
    display: none
}

.is-authenticated .secure-link {
    display: flex
}

.table-wrap {
    overflow: auto;
    border: 1px solid rgba(0, 234, 255, .12)
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 14px
}

th {
    color: var(--dim);
    font-size: 10px;
    letter-spacing: .24em;
    text-align: left;
    padding: 0 16px
}

td {
    background: rgba(8, 27, 33, .7);
    border-top: 1px solid rgba(0, 234, 255, .13);
    border-bottom: 1px solid rgba(0, 234, 255, .13);
    padding: 16px;
    color: var(--accent)
}

.vault-layout {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 26px
}

.category-stack {
    display: grid;
    gap: 12px
}

.category-pill {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-left: 2px solid transparent;
    color: var(--muted);
    background: rgba(0, 0, 0, .1);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 11px
}

.category-pill.active {
    border-left-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 234, 255, .08)
}

.vault-status {
    margin-top: 30px;
    border: 1px solid var(--accent);
    padding: 18px;
    color: var(--accent)
}

.meter {
    height: 4px;
    background: rgba(0, 234, 255, .16);
    margin: 10px 0
}

.meter span {
    display: block;
    height: 100%;
    background: var(--accent);
    width: 82%
}

.key-card {
    min-height: 260px
}

.key-card h2 {
    font-size: 18px;
    color: #fff;
    margin: 28px 0 6px
}

.key-card small,
.key-card p {
    color: var(--muted);
    font-size: 11px
}

.key-card .tag {
    float: right;
    border: 1px solid rgba(0, 234, 255, .5);
    padding: 4px 8px;
    color: var(--accent);
    font-size: 10px
}

.note-console {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 26px
}

.note-item {
    border: 1px solid rgba(0, 234, 255, .22);
    padding: 16px;
    margin-bottom: 14px;
    background: rgba(8, 22, 28, .55)
}

.note-editor {
    border: 1px solid rgba(0, 234, 255, .35);
    background: linear-gradient(180deg, rgba(6, 16, 20, .82), rgba(3, 8, 10, .88));
    padding: 22px
}

.markdown-preview {
    border: 1px solid rgba(0, 234, 255, .18);
    padding: 18px;
    margin-top: 16px;
    background: rgba(0, 0, 0, .16)
}

.status-card.good {
    border-color: rgba(0, 255, 168, .45)
}

.status-card.warn {
    border-color: rgba(255, 179, 92, .65);
    animation: pulseWarn 1s steps(2) infinite
}

.status-card.bad {
    border-color: rgba(255, 93, 114, .7);
    animation: pulseBad 1s steps(2) infinite
}

@keyframes pulseWarn {
    50% {
        box-shadow: 0 0 26px rgba(255, 179, 92, .55)
    }
}

@keyframes pulseBad {
    50% {
        box-shadow: 0 0 30px rgba(255, 93, 114, .62)
    }
}

.mobile-only {
    display: none
}

@media(max-width:900px) {
    .topbar {
        height: auto;
        min-height: 58px;
        flex-wrap: wrap
    }

    .brand-lockup {
        width: auto;
        flex: 1
    }

    .mobile-only {
        display: inline-block
    }

    .topnav {
        display: none;
        order: 4;
        flex-basis: 100%;
        height: auto;
        flex-direction: column;
        gap: 0
    }

    .topnav.open {
        display: flex
    }

    .topnav a {
        height: 42px;
        justify-content: center
    }

    .top-actions {
        gap: 8px;
        padding: 8px 12px
    }

    .side-rail {
        display: none
    }

    .shell {
        margin-left: 0;
        padding: 92px 18px 90px
    }

    .grid-footer {
        left: 0;
        height: auto;
        min-height: 58px;
        flex-wrap: wrap;
        gap: 14px;
        padding: 10px
    }

    .hero-grid,
    .vault-layout,
    .note-console {
        grid-template-columns: 1fr
    }

    .terminal-form.inline {
        grid-template-columns: 1fr
    }

    .type-intro {
        min-height: 240px;
        font-size: 14px
    }
}

@media(prefers-reduced-motion:reduce) {

    *,
    *:before,
    *:after {
        animation: none !important
    }
}

/* ZSYS TfL Phase 1 additions */
/* Add these rules to assets/css/grid.css if you do not replace the CSS file. */
.tfl-hero-card {
    margin-bottom: 24px;
}

.tfl-hero-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: start;
}

.tfl-control-panel {
    border: 1px solid rgba(0, 234, 255, .24);
    padding: 16px;
    min-width: 260px;
    background: rgba(0, 0, 0, .18);
}

.tfl-status-dashboard {
    display: grid;
    gap: 28px;
}

.tfl-mode-section {
    display: grid;
    gap: 16px;
}

.tfl-mode-section h2 {
    color: var(--accent);
    border-bottom: 1px solid rgba(0, 234, 255, .25);
    padding-bottom: 10px;
}

.tfl-line-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.tfl-line-card {
    position: relative;
    border: 1px solid rgba(0, 234, 255, .25);
    background: linear-gradient(180deg, rgba(8, 22, 28, .86), rgba(4, 10, 13, .92));
    padding: 18px;
    min-height: 220px;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .28);
}

.tfl-line-card:before {
    content: "";
    position: absolute;
    inset: -1px;
    pointer-events: none;
    background: linear-gradient(90deg, var(--accent) 10px, transparent 10px) top left/60px 2px no-repeat, linear-gradient(var(--accent) 10px, transparent 10px) top left/2px 60px no-repeat, linear-gradient(270deg, var(--accent) 10px, transparent 10px) bottom right/60px 2px no-repeat, linear-gradient(0deg, var(--accent) 10px, transparent 10px) bottom right/2px 60px no-repeat;
    opacity: .75;
}

.tfl-line-card-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.tfl-line-colour {
    width: 18px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .28);
    box-shadow: 0 0 12px rgba(255, 255, 255, .18);
}

.tfl-line-card h3 {
    margin: 0;
    color: var(--fg);
    font-size: 18px;
}

.tfl-line-card p {
    color: var(--muted);
}

.tfl-status-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(0, 234, 255, .16);
    border-bottom: 1px solid rgba(0, 234, 255, .16);
    padding: 10px 0;
    margin-bottom: 12px;
}

.tfl-reason {
    font-size: 13px;
}

.tfl-details summary {
    cursor: pointer;
    color: var(--accent);
}

.tfl-details pre {
    overflow: auto;
    max-height: 260px;
    background: rgba(0, 0, 0, .3);
    padding: 12px;
    border: 1px solid rgba(0, 234, 255, .16);
}

.tfl-good {
    border-color: rgba(0, 255, 168, .45);
}

.tfl-good .tfl-status-row strong {
    color: #00ffa8;
}

.tfl-warning {
    border-color: rgba(255, 179, 92, .75);
    animation: tflPulseAmber 1s steps(2) infinite;
}

.tfl-warning .tfl-status-row strong {
    color: #ffb35c;
}

.tfl-info {
    border-color: rgba(0, 234, 255, .45);
}

.tfl-severe {
    border-color: rgba(255, 93, 114, .85);
    animation: tflPulseRed 1s steps(2) infinite;
}

.tfl-severe .tfl-status-row strong {
    color: #ff5d72;
}

.tfl-muted {
    color: var(--muted);
}

.tfl-warning-panel,
.tfl-error-panel {
    border-color: rgba(255, 179, 92, .75);
}


.tfl-service-details {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.tfl-service-detail-block {
  border: 1px solid rgba(0, 234, 255, .18);
  background: rgba(0, 0, 0, .22);
  padding: 14px;
}

.tfl-service-detail-block dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.tfl-service-detail-block dl div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  border-bottom: 1px solid rgba(0, 234, 255, .10);
  padding-bottom: 8px;
}

.tfl-service-detail-block dt {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.tfl-service-detail-block dd {
  margin: 0;
  color: var(--fg);
}

.tfl-validity-periods {
  margin-top: 14px;
  border-top: 1px solid rgba(0, 234, 255, .18);
  padding-top: 12px;
}

.tfl-validity-periods h4 {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
}

.tfl-validity-periods p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 700px) {
  .tfl-service-detail-block dl div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}


@keyframes tflPulseAmber {
    50% {
        box-shadow: 0 0 26px rgba(255, 179, 92, .58);
    }
}

@keyframes tflPulseRed {
    50% {
        box-shadow: 0 0 32px rgba(255, 93, 114, .65);
    }
}

@media (max-width: 900px) {
    .tfl-hero-layout {
        grid-template-columns: 1fr;
    }

    .tfl-control-panel {
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    .tfl-warning,
    .tfl-severe {
        animation: none !important;
    }
}

/* ------------------------------------------------------------------
   TfL Phase 1 formatting fix
   Prevents service detail text overlap and improves long disruption text
------------------------------------------------------------------- */

.tfl-status-dashboard,
.tfl-mode-section,
.tfl-line-grid,
.tfl-line-card,
.tfl-details,
.tfl-service-details,
.tfl-service-detail-block {
  min-width: 0;
}

.tfl-line-card {
  overflow: hidden;
}

.tfl-details {
  margin-top: 14px;
  width: 100%;
}

.tfl-details summary {
  line-height: 1.5;
  padding: 8px 0;
}

.tfl-service-details {
  margin-top: 14px;
  display: grid;
  gap: 14px;
  width: 100%;
}

.tfl-service-detail-block {
  border: 1px solid rgba(0, 234, 255, .18);
  background: rgba(0, 0, 0, .22);
  padding: 16px;
  width: 100%;
  overflow: hidden;
}

.tfl-service-detail-block dl {
  margin: 0;
  display: grid;
  gap: 14px;
}

/* Change the details rows from cramped two-column to readable stacked rows */
.tfl-service-detail-block dl div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  border-bottom: 1px solid rgba(0, 234, 255, .12);
  padding-bottom: 12px;
}

.tfl-service-detail-block dl div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.tfl-service-detail-block dt {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.tfl-service-detail-block dd {
  margin: 0;
  color: var(--fg);
  line-height: 1.65;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

/* Improve the main disruption reason on the card */
.tfl-reason {
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

/* Prevent footer overlay when details are expanded */
.shell {
  padding-bottom: 160px;
}

.tfl-status-dashboard {
  margin-bottom: 120px;
}

/* Slightly wider cards where screen size allows */
.tfl-line-grid {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

/* On smaller screens, keep everything single column */
@media (max-width: 900px) {
  .tfl-line-grid {
    grid-template-columns: 1fr;
  }

  .tfl-service-detail-block {
    padding: 14px;
  }
}

.tfl-line-card > .tfl-reason {
  max-height: 9.5em;
  overflow: hidden;
  position: relative;
}

.tfl-line-card > .tfl-reason::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5em;
  background: linear-gradient(
    transparent,
    rgba(4, 10, 13, .96)
  );
}
/* ZSYS TfL Phase 2 Departure Board additions */
/* ZSYS TfL Phase 2 Departure Board additions */
.tfl-departure-layout { display: grid; grid-template-columns: 360px 1fr; gap: 24px; align-items: start; }
.tfl-search-panel, .tfl-board-panel { min-width: 0; }
.tfl-station-results { display: grid; gap: 10px; margin-top: 16px; }
.tfl-station-result { width: 100%; text-align: left; border: 1px solid rgba(0,234,255,.24); background: rgba(0,0,0,.18); color: var(--fg); padding: 12px; cursor: pointer; font: inherit; }
.tfl-station-result:hover { border-color: var(--accent); box-shadow: 0 0 16px rgba(0,234,255,.18); }
.tfl-station-result strong { display: block; color: var(--accent); }
.tfl-station-result span { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.tfl-selected-station { border-bottom: 1px solid rgba(0,234,255,.18); margin-bottom: 18px; padding-bottom: 12px; }
.tfl-departure-board { display: grid; gap: 18px; }
.tfl-departure-group { border: 1px solid rgba(0,234,255,.22); background: rgba(0,0,0,.16); padding: 16px; min-width: 0; }
.tfl-departure-heading { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid rgba(0,234,255,.18); padding-bottom: 12px; margin-bottom: 12px; }
.tfl-departure-heading h2 { margin: 0; color: var(--fg); }
.tfl-departure-heading p { margin: 4px 0 0; color: var(--muted); }
.tfl-departure-rows { display: grid; gap: 8px; }
.tfl-departure-row { display: grid; grid-template-columns: 86px 1fr 72px; gap: 14px; align-items: center; border-bottom: 1px solid rgba(0,234,255,.10); padding: 10px 0; min-width: 0; }
.tfl-departure-row:last-child { border-bottom: 0; }
.tfl-departure-row strong { color: var(--accent); overflow-wrap: anywhere; }
.tfl-departure-row p { margin: 4px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.tfl-due { color: #00ffa8; font-weight: 900; }
.tfl-time { color: var(--fg); text-align: right; }
.tfl-empty-board { color: var(--muted); }
@media (max-width: 1000px) { .tfl-departure-layout { grid-template-columns: 1fr; } }
@media (max-width: 650px) { .tfl-departure-row { grid-template-columns: 1fr; gap: 4px; } .tfl-time { text-align: left; } }


/* ZSYS TfL Departure Boards v2.1 additions */
/* ZSYS TfL Departure Boards v2.1 additions */
.tfl-expand-trains {
  margin-top: 14px;
}

.tfl-later-train {
  border-left: 2px solid rgba(0, 234, 255, .28);
  padding-left: 12px;
}

.tfl-first-last-container {
  margin-bottom: 18px;
}

.tfl-first-last-panel {
  border: 1px solid rgba(0, 234, 255, .22);
  background: rgba(0, 0, 0, .18);
  padding: 16px;
  margin-bottom: 18px;
}

.tfl-first-last-heading {
  border-bottom: 1px solid rgba(0, 234, 255, .18);
  margin-bottom: 14px;
  padding-bottom: 10px;
}

.tfl-first-last-heading h2 {
  margin: 0;
}

.tfl-first-last-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}

.tfl-first-last-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.tfl-first-last-card {
  border: 1px solid rgba(0, 234, 255, .18);
  background: rgba(0, 0, 0, .22);
  padding: 14px;
}

.tfl-first-last-card h3 {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
}

.tfl-first-last-card p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0;
}

.tfl-first-last-card span,
.tfl-first-last-card small {
  color: var(--muted);
}

.tfl-first-last-card strong {
  color: var(--fg);
}

@media (max-width: 650px) {
  .tfl-first-last-card p {
    display: grid;
    gap: 4px;
  }
}


/* ZSYS TfL Inline Station Autocomplete v2.6 */
.tfl-search-panel {
  position: relative;
}

.tfl-autocomplete-panel {
  position: relative;
  z-index: 20;
  display: grid;
  gap: 6px;
  margin-top: -10px;
  margin-bottom: 14px;
  padding: 8px;
  border: 1px solid rgba(0, 234, 255, .28);
  background: rgba(3, 8, 10, .98);
  box-shadow: 0 16px 30px rgba(0, 0, 0, .35), 0 0 18px rgba(0, 234, 255, .12);
}

.tfl-autocomplete-item {
  width: 100%;
  display: grid;
  gap: 3px;
  text-align: left;
  border: 1px solid rgba(0, 234, 255, .16);
  background: rgba(0, 0, 0, .24);
  color: var(--fg);
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
}

.tfl-autocomplete-item:hover,
.tfl-autocomplete-item.active {
  border-color: var(--accent);
  background: rgba(0, 234, 255, .10);
  box-shadow: 0 0 14px rgba(0, 234, 255, .16);
}

.tfl-autocomplete-item strong {
  color: var(--accent);
}

.tfl-autocomplete-item span,
.tfl-autocomplete-item small,
.tfl-autocomplete-loading,
.tfl-autocomplete-empty {
  color: var(--muted);
  font-size: 11px;
}

.tfl-autocomplete-loading,
.tfl-autocomplete-empty {
  padding: 10px 12px;
}




/* ZSYS TfL First / Last Direction Display v2.7 */
.tfl-loading-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin: 12px 0 16px;
}

.tfl-mini-spinner {
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 2px solid rgba(0, 234, 255, .18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: tflMiniSpin .85s linear infinite;
}

.tfl-first-last-loading-card {
  min-height: 118px;
}

.tfl-loading-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.tfl-loading-card-head h3 {
  margin: 0;
}

.tfl-loading-line {
  height: 12px;
  margin: 10px 0;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(0, 234, 255, .07),
    rgba(0, 234, 255, .22),
    rgba(0, 234, 255, .07)
  );
  background-size: 220% 100%;
  animation: tflLoadingSweep 1.2s ease-in-out infinite;
}

.tfl-loading-line.short {
  width: 62%;
}

.tfl-direction-block {
  border: 1px solid rgba(0, 234, 255, .16);
  background: rgba(0, 0, 0, .18);
  padding: 12px;
  margin: 10px 0;
}

.tfl-direction-block.tfl-direction-inbound {
  border-left: 3px solid #00ffa8;
}

.tfl-direction-block.tfl-direction-outbound {
  border-left: 3px solid #ffb35c;
}

.tfl-direction-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .08em;
}

.tfl-direction-title small {
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

@keyframes tflMiniSpin {
  to { transform: rotate(360deg); }
}

@keyframes tflLoadingSweep {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tfl-mini-spinner,
  .tfl-loading-line {
    animation: none !important;
  }
}




/* ZSYS TfL First / Last Destination Labels v2.8 */
.tfl-direction-title span {
  line-height: 1.35;
}

.tfl-direction-title span::before {
  content: "⇢";
  margin-right: 7px;
  color: var(--muted);
}

.tfl-direction-block.tfl-direction-unknown {
  border-left: 3px solid rgba(0, 234, 255, .35);
}

@media (max-width: 720px) {
  .tfl-direction-title {
    display: grid;
    gap: 4px;
  }
}




/* ZSYS TfL First / Last Friendly Direction Labels v2.9 */
.tfl-direction-block.tfl-direction-northbound {
  border-left: 3px solid #00ffa8;
}

.tfl-direction-block.tfl-direction-southbound {
  border-left: 3px solid #ffb35c;
}

.tfl-direction-block.tfl-direction-eastbound {
  border-left: 3px solid #00eaff;
}

.tfl-direction-block.tfl-direction-westbound {
  border-left: 3px solid #c084fc;
}

.tfl-direction-title span {
  line-height: 1.35;
}

.tfl-direction-title span::before {
  content: "⇢";
  margin-right: 7px;
  color: var(--muted);
}




/* ZSYS TfL Platform Card Layout v3.0 */
.tfl-platform-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
  min-width: 0;
}

.tfl-platform-card {
  position: relative;
  border: 1px solid rgba(0, 234, 255, .25);
  background: linear-gradient(180deg, rgba(8, 22, 28, .86), rgba(4, 10, 13, .92));
  padding: 18px;
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .28);
}

.tfl-platform-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--accent) 10px, transparent 10px) top left / 60px 2px no-repeat,
    linear-gradient(var(--accent) 10px, transparent 10px) top left / 2px 60px no-repeat,
    linear-gradient(270deg, var(--accent) 10px, transparent 10px) bottom right / 60px 2px no-repeat,
    linear-gradient(0deg, var(--accent) 10px, transparent 10px) bottom right / 2px 60px no-repeat;
  opacity: .72;
}

.tfl-platform-card-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.tfl-platform-card-header h3 {
  margin: 0;
  color: var(--fg);
  font-size: 18px;
}

.tfl-platform-card-header p {
  margin: 4px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tfl-platform-status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(0, 234, 255, .16);
  border-bottom: 1px solid rgba(0, 234, 255, .16);
  padding: 10px 0;
  margin-bottom: 12px;
}

.tfl-platform-status-row strong {
  color: var(--accent);
}

.tfl-platform-status-row span {
  color: var(--muted);
  text-align: right;
}

.tfl-platform-card-due {
  border-color: rgba(0, 255, 168, .58);
}

.tfl-platform-card-due .tfl-platform-status-row strong,
.tfl-platform-card-due .tfl-platform-train-due {
  color: #00ffa8;
}

.tfl-platform-card-soon {
  border-color: rgba(255, 179, 92, .68);
}

.tfl-platform-card-soon .tfl-platform-status-row strong,
.tfl-platform-card-soon .tfl-platform-train-due {
  color: #ffb35c;
}

.tfl-platform-next-summary {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 234, 255, .14);
  background: rgba(0, 0, 0, .18);
}

.tfl-platform-next-summary span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.tfl-platform-next-summary strong {
  color: var(--fg);
  overflow-wrap: anywhere;
}

.tfl-platform-train-list {
  display: grid;
  gap: 8px;
}

.tfl-platform-train-row {
  display: grid;
  grid-template-columns: 74px 1fr 62px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(0, 234, 255, .10);
  padding: 10px 0;
  min-width: 0;
}

.tfl-platform-train-row:last-child {
  border-bottom: 0;
}

.tfl-platform-train-due {
  font-weight: 900;
  color: #00ffa8;
}

.tfl-platform-train-main {
  min-width: 0;
}

.tfl-platform-train-main strong {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.tfl-platform-train-main p {
  margin: 4px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tfl-platform-train-time {
  color: var(--fg);
  text-align: right;
}

.tfl-platform-expand {
  margin-top: 14px;
}

@media (max-width: 760px) {
  .tfl-platform-card-grid {
    grid-template-columns: 1fr;
  }

  .tfl-platform-status-row {
    display: grid;
    gap: 4px;
  }

  .tfl-platform-status-row span {
    text-align: left;
  }

  .tfl-platform-train-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .tfl-platform-train-time {
    text-align: left;
  }
}




/* ZSYS TfL First / Last Line Colours v3.1 */
.tfl-first-last-line-card {
  border-color: color-mix(in srgb, var(--tfl-line-color) 62%, rgba(0, 234, 255, .25));
}

.tfl-first-last-line-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--tfl-line-color) 10px, transparent 10px) top left / 60px 2px no-repeat,
    linear-gradient(var(--tfl-line-color) 10px, transparent 10px) top left / 2px 60px no-repeat,
    linear-gradient(270deg, var(--tfl-line-color) 10px, transparent 10px) bottom right / 60px 2px no-repeat,
    linear-gradient(0deg, var(--tfl-line-color) 10px, transparent 10px) bottom right / 2px 60px no-repeat;
  opacity: .74;
}

.tfl-first-last-line-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.tfl-first-last-line-card-header h3 {
  margin: 0;
  color: var(--fg);
}

.tfl-first-last-line-card-header p {
  margin: 3px 0 0;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .08em;
}

.tfl-first-last-line-card .tfl-direction-block,
.tfl-first-last-line-card .tfl-direction-block.tfl-direction-inbound,
.tfl-first-last-line-card .tfl-direction-block.tfl-direction-outbound,
.tfl-first-last-line-card .tfl-direction-block.tfl-direction-northbound,
.tfl-first-last-line-card .tfl-direction-block.tfl-direction-southbound,
.tfl-first-last-line-card .tfl-direction-block.tfl-direction-eastbound,
.tfl-first-last-line-card .tfl-direction-block.tfl-direction-westbound,
.tfl-first-last-line-card .tfl-direction-block.tfl-direction-unknown {
  border-left: 3px solid var(--tfl-line-color) !important;
}

.tfl-first-last-line-card .tfl-direction-title {
  color: var(--tfl-line-color);
}

.tfl-first-last-line-card .tfl-direction-title span::before {
  color: var(--tfl-line-color);
}

/* Fallback for browsers without color-mix support */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .tfl-first-last-line-card {
    border-color: var(--tfl-line-color);
  }
}










/* ZSYS Grid Secure Route Guard v3.1.2 */
.access-denied-card { max-width: 760px; margin: 40px auto; }
.access-denied-card h1 { color: var(--accent); }
body.is-anonymous .secure-link,
body.is-anonymous [data-secure-link="true"],
body.is-anonymous .secure-only,
body.is-authenticated .anon-only,
.hidden { display: none !important; }


