/* Family Wien ---------------------------------------------------------------
   Everything app-specific on top of dbnetsoft.admin.css: the icons this site
   uses, the departure board and the journey timeline. The dbn- tokens
   (--dbn-surface, --dbn-accent, …) come from the theme and are reused here so
   the two layers stay in step. */

/* Icons (Font Awesome 7 Pro regular, loaded by icons.base.css from dbnetsoft.Web) */
.fa-fw-departures:before { content: '\f207'; }
.fa-fw-route:before { content: '\f4d7'; }
.fa-fw-home:before { content: '\f015'; }
.fa-fw-locate:before { content: '\f05b'; }
.fa-fw-clock:before { content: '\f017'; }
.fa-fw-walk:before { content: '\f554'; }
.fa-fw-warning:before { content: '\f071'; }
.fa-fw-refresh:before { content: '\f021'; }
.fa-fw-wheelchair:before { content: '\f193'; }
.fa-fw-arrow:before { content: '\f061'; }
.fa-fw-flag:before { content: '\f024'; }

/* --- the shell ---------------------------------------------------------- */

.fw-clock {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.fw-hint {
    color: var(--dbn-text-muted);
    font-size: 12.5px;
    margin: 0;
}

.fw-updated {
    color: var(--dbn-text-dim);
    font-size: 12px;
    white-space: nowrap;
}

/* --- the departure board ------------------------------------------------ */

/* A line number, coloured the way Vienna colours it: U-Bahn each its own,
   trams red, everything else the quiet blue of a city bus. */
.fw-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 3px 9px;
    border-radius: 9px;
    background: #2b63b4;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0.01em;
}

.fw-line[data-kind="Tram"] { background: #e3000f; }
.fw-line[data-kind="S-Bahn"] { background: #1a62a5; }
.fw-line[data-kind="Night bus"] { background: #1b1b3a; }
.fw-line[data-kind="On-call bus"] { background: #6a6f82; }
.fw-line[data-line="U1"] { background: #e20d17; }
.fw-line[data-line="U2"] { background: #9b4d9b; }
.fw-line[data-line="U3"] { background: #ec6726; }
.fw-line[data-line="U4"] { background: #0a9e4a; }
.fw-line[data-line="U5"] { background: #19b4a6; }
.fw-line[data-line="U6"] { background: #9a6334; }

.fw-dir {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid var(--dbn-border-soft);
}

.fw-dir:first-child {
    border-top: 0;
    padding-top: 2px;
}

.fw-dir-main {
    min-width: 0;
    flex: 1 1 auto;
}

.fw-towards {
    display: block;
    font-weight: 600;
    font-size: 14.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fw-towards:before {
    content: '→ ';
    color: var(--dbn-text-dim);
}

.fw-meta {
    color: var(--dbn-text-dim);
    font-size: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 2px;
}

/* Where this departure meets the U-Bahn. */
.fw-changes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 7px;
}

.fw-change {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--dbn-text-muted);
}

.fw-line-sm {
    min-width: 32px;
    padding: 1px 7px;
    border-radius: 7px;
    font-size: 12px;
}

/* The stops along the way: the next few, and the rest on a click. */
.fw-via {
    margin-top: 6px;
    font-size: 12px;
}

.fw-via > summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: baseline;
    cursor: pointer;
    color: var(--dbn-text-dim);
    list-style: none;
}

.fw-via > summary::-webkit-details-marker { display: none; }

.fw-via > summary:before {
    content: '▸';
    color: var(--dbn-text-dim);
}

.fw-via[open] > summary:before { content: '▾'; }

.fw-via > summary:hover { color: var(--dbn-text-muted); }

.fw-via-peek {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.fw-via-all {
    margin: 8px 0 2px;
    padding-left: 20px;
    color: var(--dbn-text-muted);
    columns: 2;
    column-gap: 20px;
}

.fw-via-all li { break-inside: avoid; padding: 1px 0; }

.fw-times {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* The countdown that matters, then the ones after it in a lighter key. */
.fw-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 48px;
    padding: 4px 8px;
    border-radius: var(--dbn-radius-sm);
    background: var(--dbn-sunken);
    line-height: 1.2;
}

.fw-time:first-child {
    background: var(--dbn-ink);
    color: #fff;
}

.fw-time:first-child .fw-time-at { color: rgba(255, 255, 255, 0.72); }

.fw-time-in {
    font-family: var(--dbn-mono);
    font-size: 16px;
    font-weight: 700;
}

.fw-time-at {
    font-size: 11px;
    color: var(--dbn-text-dim);
}

.fw-time[data-planned="true"] { outline: 1px dashed var(--dbn-warn); }
.fw-time[data-delayed="true"] .fw-time-in { color: var(--dbn-warn); }
.fw-time:first-child[data-delayed="true"] .fw-time-in { color: #ffd166; }

/* The live pulse: the board is only worth trusting while this is beating. */
.fw-pulse {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--dbn-ok);
    animation: fw-pulse 2s ease-in-out infinite;
}

@keyframes fw-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.8); }
}

@media (prefers-reduced-motion: reduce) {
    .fw-pulse { animation: none; }
}

/* --- the journey timeline ----------------------------------------------- */

.fw-journey + .fw-journey {
    margin-top: 14px;
}

.fw-journey-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.fw-journey-when {
    font-family: var(--dbn-mono);
    font-size: 20px;
    font-weight: 700;
}

.fw-journey-sub {
    color: var(--dbn-text-muted);
    font-size: 13px;
}

.fw-legs {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fw-leg {
    display: grid;
    grid-template-columns: 54px 22px 1fr;
    gap: 0 12px;
    align-items: start;
}

.fw-leg-time {
    font-family: var(--dbn-mono);
    font-size: 13px;
    color: var(--dbn-text-muted);
    padding-top: 1px;
}

/* The rail down the left: a dot per step, joined by a line. */
.fw-leg-rail {
    position: relative;
    justify-self: center;
    width: 2px;
    background: var(--dbn-border);
    min-height: 44px;
}

.fw-leg:first-child .fw-leg-rail { background: linear-gradient(to bottom, transparent 9px, var(--dbn-border) 9px); }
.fw-leg:last-child .fw-leg-rail { background: linear-gradient(to bottom, var(--dbn-border) 9px, transparent 9px); }

.fw-leg-rail:before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    width: 11px;
    height: 11px;
    margin-left: -5.5px;
    border-radius: 50%;
    background: var(--dbn-surface-strong);
    border: 2px solid var(--dbn-text-dim);
}

.fw-leg[data-kind="Ride"] .fw-leg-rail:before { border-color: var(--dbn-accent); }
.fw-leg:last-child .fw-leg-rail:before { border-color: var(--dbn-ink); background: var(--dbn-ink); }

.fw-leg-body {
    padding-bottom: 14px;
    min-width: 0;
}

.fw-leg:last-child .fw-leg-body { padding-bottom: 0; }

.fw-leg-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
}

.fw-leg-sub {
    color: var(--dbn-text-muted);
    font-size: 12.5px;
    margin-top: 2px;
}

.fw-via {
    color: var(--dbn-text-dim);
    font-size: 12px;
    margin-top: 2px;
}

/* --- forms -------------------------------------------------------------- */

.fw-suggest {
    position: relative;
}

.fw-suggest-list {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--dbn-surface-strong);
    backdrop-filter: var(--dbn-blur);
    border: 1px solid var(--dbn-surface-edge);
    border-radius: var(--dbn-radius-sm);
    box-shadow: var(--dbn-shadow-soft);
    max-height: 260px;
    overflow-y: auto;
}

.fw-suggest-list:empty { display: none; }

.fw-suggest-list button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13.5px;
}

.fw-suggest-list button:hover,
.fw-suggest-list button:focus-visible {
    background: var(--dbn-bg-lift);
}

.fw-chosen {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--dbn-text-muted);
    margin-top: 8px;
    min-height: 20px;
}

@media (max-width: 575.98px) {
    .fw-dir { flex-wrap: wrap; }
    .fw-via-all { columns: 1; }
    .fw-times { justify-content: flex-start; }
    .fw-leg { grid-template-columns: 46px 20px 1fr; }
}

/* --- screen time ------------------------------------------------------- */

.fa-fw-screentime:before { content: '\f3cd'; }

.fw-st-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fw-st-days {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fw-st-day {
    display: grid;
    grid-template-columns: 90px 190px 1fr;
    gap: 10px 16px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid var(--dbn-border-soft);
}

.fw-st-day:first-child { border-top: 0; }

.fw-st-date {
    font-weight: 600;
    font-size: 13.5px;
}

.fw-st-peak {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

/* "at least this much" - the right edge is deliberately soft, because the real
   figure sits somewhere above the rung that was crossed. */
.fw-st-bar {
    flex: 1 1 auto;
    height: 8px;
    border-radius: 999px;
    background: var(--dbn-sunken);
    overflow: hidden;
}

.fw-st-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(to right, var(--dbn-ok), var(--dbn-ok) 70%, transparent);
}

.fw-st-bar[data-tone="warn"] > span { background: linear-gradient(to right, var(--dbn-warn), var(--dbn-warn) 70%, transparent); }
.fw-st-bar[data-tone="err"] > span { background: linear-gradient(to right, var(--dbn-err), var(--dbn-err) 70%, transparent); }

.fw-st-selections {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 12.5px;
}

@media (max-width: 767.98px) {
    .fw-st-day { grid-template-columns: 1fr; gap: 6px; }
}

/* The build stamp in the footer: present, but never the loudest thing there. */
.fw-build {
    color: var(--dbn-text-dim);
    white-space: nowrap;
}
