/* =========================================================
   R.CUBE PCO — poste de commandement opérationnel
   Écran de référence : 24 pouces. Paysage 1920 × 1080 (3 colonnes),
   portrait 1080 × 1920 (2 colonnes + running order en bas, body.portrait).
   Thème hérité de Grist (variables --grist-theme-*), repli sombre.
   ========================================================= */

:root {
  --grist-header-bg: var(--grist-theme-table-header-bg, #262636);
  --grist-body-bg: var(--grist-theme-table-body-bg, #1e1e2a);
  --grist-header-fg: var(--grist-theme-table-header-fg, #eeeef3);
  --grist-text: var(--grist-theme-cell-fg, #ececf1);
  --grist-muted: var(--grist-theme-control-secondary-fg, #a0a2b0);
  --grist-border: var(--grist-theme-table-body-border, rgba(255, 255, 255, .14));
  --grist-hover: var(--grist-theme-hover-light, rgba(255, 255, 255, .05));
  --grist-selection: var(--grist-theme-selection, rgba(29, 184, 123, .16));
  --grist-control: var(--grist-theme-control-fg, #17b87a);
  --grist-error: var(--grist-theme-text-error, #e5484d);

  --panel-bg: var(--grist-theme-page-panels-main-panel-bg, rgba(255, 255, 255, .03));
  --card-bg: var(--grist-theme-popup-bg, rgba(255, 255, 255, .055));

  /* Statuts live (alignés sur Runs.Statut / Alerte_transport). */
  --st-ok: #1f9d55;
  --st-info: #2f80ed;
  --st-warn: #e8912d;
  --st-crit: #e5484d;
  --st-wait: #8a8d99;
  --st-now: #17b87a;

  --row-h: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--grist-body-bg);
  color: var(--grist-text);
  overflow: hidden;
}

body {
  font-family: Lato, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* =========================================================
   BANDEAU
   ========================================================= */

.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background: var(--grist-header-bg);
  color: var(--grist-header-fg);
  border-bottom: 1px solid var(--grist-border);
  min-height: 56px;
}

.bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.event-logo {
  flex: none;
  height: 44px;
  max-width: 130px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
}

.bar-titles {
  min-width: 0;
}

.event {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-sub {
  color: var(--grist-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-days {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.day-chip {
  border: 1px solid var(--grist-border);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.day-chip:hover {
  background: var(--grist-hover);
}

.day-chip.active {
  background: var(--grist-control);
  border-color: var(--grist-control);
  color: #fff;
  font-weight: 700;
}

.day-chip.today::before {
  content: "●";
  font-size: 8px;
  margin-right: 5px;
  vertical-align: 1px;
}

.bar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
}

.counters {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--grist-muted);
  white-space: nowrap;
}

.counter b {
  font-size: 15px;
  color: var(--grist-text);
}

.counter.warn b {
  color: var(--st-warn);
}

.counter.crit b {
  color: var(--st-crit);
}

.counter.live b {
  color: var(--st-now);
}

.clock {
  text-align: right;
}

.clock-time {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.clock-next {
  font-size: 11px;
  color: var(--grist-muted);
  margin-top: 2px;
  white-space: nowrap;
}

.error-line {
  padding: 5px 14px;
  background: rgba(229, 72, 77, .15);
  color: var(--grist-error);
  border-bottom: 1px solid var(--grist-border);
}

/* =========================================================
   GRILLE
   ========================================================= */

.grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 46fr) minmax(0, 26fr) minmax(0, 28fr);
  gap: 8px;
  padding: 8px;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel-bg);
  border: 1px solid var(--grist-border);
  border-radius: 8px;
  overflow: hidden;
}

.panel-flow,
.panel-alerts {
  display: none;
}

.panel-runs {
  flex: 56 1 0;
}

.panel-artists {
  flex: 44 1 0;
}

.panel-next {
  flex: 1 1 0;
}

.panel-tracking {
  flex: 52 1 0;
}

.panel-order {
  flex: 48 1 0;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  background: var(--grist-header-bg);
  border-bottom: 1px solid var(--grist-border);
}

.panel-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.panel-meta {
  font-size: 11px;
  color: var(--grist-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.empty {
  padding: 14px 10px;
  color: var(--grist-muted);
  font-style: italic;
}

/* =========================================================
   TABLEAUX COMPACTS (colonne gauche)
   ========================================================= */

.dense {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.dense th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--grist-header-bg);
  color: var(--grist-muted);
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: left;
  padding: 3px 6px;
  border-bottom: 1px solid var(--grist-border);
  white-space: nowrap;
}

.dense td {
  height: var(--row-h);
  padding: 0 6px;
  border-bottom: 1px solid var(--grist-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.dense tbody tr {
  cursor: pointer;
}

.dense tbody tr:hover {
  background: var(--grist-hover);
}

.dense tr.past td {
  opacity: .45;
}

.dense tr.current td {
  background: var(--grist-selection);
}

.dense tr.current td:first-child {
  box-shadow: inset 3px 0 0 var(--st-now);
}

.dense tr.soon td:first-child {
  box-shadow: inset 3px 0 0 var(--st-warn);
}

/* Run non démarré après le délai de grâce. */
.dense tr.late td:first-child {
  box-shadow: inset 3px 0 0 var(--st-crit);
}

.dense tr.cancelled td {
  text-decoration: line-through;
  opacity: .4;
}

.dense tr.unscheduled td {
  opacity: .6;
  font-style: italic;
}

/* Largeurs fixes (table-layout: fixed) ; Passagers et Description
   prennent le reste. Colonne gauche ≈ 870 px sur un 24 pouces. */
.c-time { width: 84px; font-variant-numeric: tabular-nums; font-weight: 700; }
.c-type { width: 46px; }
.c-interv { width: 140px; }
.c-pax { width: auto; }
.c-route { width: 160px; }
.c-runner { width: 100px; }
.c-track { width: 150px; }
.c-artist { width: 140px; }
.c-desc { width: auto; }
.c-place { width: 140px; }
.c-remain { width: 92px; text-align: right; }

/* Noms des prestataires / artistes et des passagers : mis en avant. */
.dense td.c-interv,
.dense td.c-artist {
  font-size: 13px;
  font-weight: 700;
}

.dense td.c-pax {
  font-size: 13px;
  font-weight: 600;
}

.dense td.c-time .end {
  color: var(--grist-muted);
  font-weight: 400;
}

.pax-n {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-right: 5px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--grist-border);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  vertical-align: 1px;
}

/* Pastilles de type (couleurs des choix Grist Taches.Type). */
.chip {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #1a1a1a;
  background: #ddd;
  line-height: 16px;
  vertical-align: middle;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Icônes SVG (véhicules, types de lieux) : taille = font-size du conteneur. */
.ico {
  display: inline-block;
  line-height: 0;
  vertical-align: -0.15em;
}

.ico svg {
  width: 1em;
  height: 1em;
}

.by {
  margin-right: 5px;
  font-size: 14px;
}

.route .arrow {
  color: var(--grist-muted);
  margin: 0 4px;
}

.place-t {
  font-size: 10px;
  color: var(--grist-muted);
  text-transform: uppercase;
  margin-right: 3px;
}

/* Suivi (tracking) dans les tableaux. */
.track {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--st-wait);
}

.st-ok .dot { background: var(--st-ok); }
.st-info .dot { background: var(--st-info); }
.st-warn .dot { background: var(--st-warn); }
.st-crit .dot { background: var(--st-crit); }
.st-now .dot { background: var(--st-now); box-shadow: 0 0 0 3px rgba(23, 184, 122, .25); }
.st-wait .dot { background: var(--st-wait); }

.st-warn .track-text { color: var(--st-warn); }
.st-crit .track-text { color: var(--st-crit); font-weight: 700; }
.st-now .track-text { color: var(--st-now); font-weight: 700; }

/* Temps restant (mis à jour chaque seconde, texte seul). */
.remain {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.remain.soon { color: var(--st-warn); font-weight: 700; }
.remain.now { color: var(--st-now); font-weight: 700; }
.remain.late { color: var(--st-crit); font-weight: 700; }
.remain.past { color: var(--grist-muted); }

/* =========================================================
   PROCHAINS RUNS (colonne centrale, grand format)
   ========================================================= */

.cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--grist-border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}

.card:hover {
  background: var(--grist-hover);
}

.card.current {
  border-color: var(--st-now);
  box-shadow: 0 0 0 1px var(--st-now);
}

.card.late {
  border-color: var(--st-crit);
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.card-time {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.card-time small {
  font-size: 13px;
  font-weight: 400;
  color: var(--grist-muted);
  margin-left: 5px;
}

.card-remain {
  font-size: 16px;
  font-weight: 700;
  text-align: right;
}

.card-route {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.card-route .arrow {
  color: var(--grist-muted);
  margin: 0 6px;
}

.card-route .place-t {
  font-size: 10px;
}

/* Prestataire / artiste et passagers : les deux lignes les plus lisibles. */
.card-who {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.card-pax {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.card-pax .pax-n {
  font-size: 12px;
}

.card-line {
  margin-top: 4px;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.card-line .lbl {
  flex: none;
  width: 84px;
  color: var(--grist-muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.card-line .val {
  min-width: 0;
}

.card-tel {
  color: var(--grist-muted);
  margin-left: 6px;
}

.card-transport {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--grist-border);
  background: rgba(0, 0, 0, .18);
}

.card-transport .t-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
}

.card-transport .t-head .t-status {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.card-transport .t-route {
  font-size: 13px;
  margin-top: 2px;
}

.card-transport .t-times {
  margin-top: 3px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.card-transport .t-times b {
  font-size: 15px;
}

.card-transport .t-alert {
  margin-top: 3px;
  font-size: 12px;
}

.card-transport.st-warn .t-status,
.card-transport.st-warn .t-alert { color: var(--st-warn); }
.card-transport.st-crit .t-status,
.card-transport.st-crit .t-alert { color: var(--st-crit); }
.card-transport.st-ok .t-status { color: var(--st-ok); }
.card-transport.st-info .t-status { color: var(--st-info); }
.card-transport.st-wait .t-status,
.card-transport.st-wait .t-alert { color: var(--grist-muted); }

.card-live {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
}

.delay-plus { color: var(--st-warn); }
.delay-minus { color: var(--st-ok); }

/* =========================================================
   TRACKING EN COURS (colonne droite, haut)
   ========================================================= */

.track-group {
  padding: 6px 8px 2px;
}

.track-group h3 {
  margin: 0 0 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--grist-muted);
}

.tcard {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 2px 8px;
  align-items: center;
  padding: 6px 8px;
  margin-bottom: 5px;
  border-radius: 6px;
  background: var(--card-bg);
  border: 1px solid var(--grist-border);
}

.tcard.done {
  opacity: .5;
}

.tcard .t-icon {
  grid-row: 1 / span 2;
  font-size: 22px;
  text-align: center;
  line-height: 0;
}

.tcard .t-title {
  font-size: 15px;
  font-weight: 800;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tcard .t-title small {
  font-weight: 400;
  color: var(--grist-muted);
  margin-left: 5px;
  font-size: 11px;
}

/* Prestataire / passagers du transport ou du run : lisibles. */
.tcard .t-who {
  margin-left: 8px;
  font-size: 14px;
  font-weight: 600;
}

.tcard .t-status {
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.tcard .t-sub {
  grid-column: 2 / span 2;
  font-size: 12px;
  color: var(--grist-muted);
  font-variant-numeric: tabular-nums;
}

.tcard .t-sub b {
  color: var(--grist-text);
}

.tcard .t-alert {
  grid-column: 2 / span 2;
  font-size: 12px;
}

.tcard.st-ok .t-status { color: var(--st-ok); }
.tcard.st-info .t-status { color: var(--st-info); }
.tcard.st-now .t-status { color: var(--st-now); }
.tcard.st-warn .t-status, .tcard.st-warn .t-alert { color: var(--st-warn); }
.tcard.st-crit .t-status, .tcard.st-crit .t-alert { color: var(--st-crit); }
.tcard.st-wait .t-status { color: var(--grist-muted); }

.tcard .pct {
  display: inline-block;
  width: 50px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .12);
  vertical-align: middle;
  overflow: hidden;
  margin-left: 5px;
}

.tcard .pct i {
  display: block;
  height: 100%;
  background: var(--st-ok);
}

.tcard .pct.low i {
  background: var(--st-crit);
}

/* =========================================================
   RUNNING ORDER (colonne droite, bas)
   ========================================================= */

.order {
  padding: 4px 8px;
}

.order-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 6px;
  border-left: 3px solid transparent;
  margin-bottom: 2px;
}

.order-item.past {
  opacity: .4;
}

.order-item.current {
  background: var(--grist-selection);
  border-left-color: var(--st-now);
}

.order-item.next {
  border-left-color: var(--st-warn);
}

.order-item .o-time {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.order-item .o-time small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--grist-muted);
}

.order-item .o-label {
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-item .o-label .chip {
  margin-right: 5px;
}

.order-item .o-label small {
  color: var(--grist-muted);
  font-weight: 400;
  margin-left: 5px;
}

.order-item .remain {
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.order-item .prog,
.order-item .prog-wrap {
  grid-column: 1 / span 3;
}

/* =========================================================
   BARRES DE PROGRESSION (créneau en cours, approche d'un départ)
   ========================================================= */

.prog {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

.prog i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--st-now);
  transition: width .6s linear;
}

.prog.approach i {
  background: var(--st-warn);
}

.prog-wrap {
  margin-top: 8px;
}

.prog-wrap .prog {
  height: 8px;
  border-radius: 4px;
}

.prog-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--grist-muted);
}

/* =========================================================
   ÉCRANS PLUS PETITS : empilement
   ========================================================= */

/* Fenêtre étroite (panneau, portable) : la page défile, chaque panneau
   garde une hauteur fixe au lieu de se partager l'écran. */
@media (max-width: 1400px) {
  body:not(.portrait) .grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    overflow: auto;
  }

  body:not(.portrait) .col {
    min-height: 0;
  }

  body:not(.portrait) .col-left {
    grid-column: 1 / span 2;
  }

  body:not(.portrait) .panel {
    flex: none;
    height: 46vh;
    min-height: 320px;
  }
}

@media (max-width: 1000px) {
  body:not(.portrait) .grid {
    display: flex;
    flex-direction: column;
  }

  body:not(.portrait) .col {
    flex: none;
  }

  body:not(.portrait) .panel {
    height: 420px;
  }

  .bar {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bar-days,
  .bar-right {
    justify-content: flex-start;
  }

  .clock {
    text-align: left;
  }
}

/* =========================================================
   PORTRAIT (écran tourné, 1080 × 1920) : flux à gauche, tracking à
   droite, running order en bas sur toute la largeur.
   ========================================================= */

/* Écran de consultation : ni défilement, ni clic. */
body.portrait .panel-body {
  overflow: hidden;
}

body.portrait .card,
body.portrait .frow,
body.portrait .day-chip {
  cursor: default;
  pointer-events: none;
}

/* Bandeau sur une ligne basse. */
body.portrait .bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 4px 10px;
}

body.portrait .bar-left {
  flex: 0 1 auto;
  gap: 8px;
}

body.portrait .event-logo {
  height: 30px;
  max-width: 90px;
  border-radius: 4px;
}

body.portrait .event {
  font-size: 15px;
}

body.portrait .event-sub {
  font-size: 11px;
}

/* Vue de consultation : tous les jours de l'événement, pas de choix de jour. */
body.portrait .bar-days {
  display: none;
}

body.portrait .day-chip {
  font-size: 11px;
  padding: 2px 8px;
}

body.portrait .bar-right {
  flex: 1 1 auto;
  gap: 10px;
}

body.portrait .counters {
  font-size: 11px;
  gap: 8px;
}

body.portrait .counter b {
  font-size: 13px;
}

body.portrait .clock-time {
  font-size: 22px;
}

body.portrait .clock-next {
  font-size: 10.5px;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.portrait .grid {
  grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
  grid-template-rows: minmax(0, auto) minmax(0, auto) minmax(0, 1fr);
  grid-template-areas:
    "flow alerts"
    "flow order"
    "flow tracking";
}

body.portrait .col {
  display: contents;
}

body.portrait .panel-alerts {
  display: flex;
  grid-area: alerts;
  max-height: 24vh;
}

body.portrait .panel-order {
  max-height: 40vh;
}

/* Alertes importantes. */
.alerts {
  padding: 4px 6px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 8px;
  margin-bottom: 4px;
  border-radius: 6px;
  border: 1px solid var(--grist-border);
  border-left-width: 4px;
  background: var(--card-bg);
}

.alert.st-crit {
  border-left-color: var(--st-crit);
  background: rgba(229, 72, 77, .12);
}

.alert.st-warn {
  border-left-color: var(--st-warn);
  background: rgba(232, 145, 45, .10);
}

.alert.st-wait {
  border-left-color: var(--st-wait);
}

.alert.none {
  border-left-color: var(--st-ok);
  color: var(--grist-muted);
  font-style: italic;
}

.alert .a-icon {
  flex: none;
  font-size: 18px;
  margin-top: 2px;
}

.alert .a-body {
  min-width: 0;
}

.alert .a-title {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert.st-crit .a-title {
  color: var(--st-crit);
}

.alert.st-warn .a-title {
  color: var(--st-warn);
}

.alert .a-text {
  font-size: 12px;
  color: var(--grist-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.portrait .panel-runs,
body.portrait .panel-artists,
body.portrait .panel-next {
  display: none;
}

body.portrait .panel-flow {
  display: flex;
  grid-area: flow;
}

body.portrait .panel-tracking {
  grid-area: tracking;
}

body.portrait .panel-order {
  grid-area: order;
}

body.portrait .panel-head {
  padding: 4px 10px;
}

body.portrait .panel-head h2 {
  font-size: 11px;
}

/* Flux : en-têtes de groupe, lignes réduites, grandes cartes. */
.flow {
  padding: 6px 8px 10px;
}

.flow-head {
  margin: 8px 2px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--grist-muted);
}

.flow-more {
  margin: 0 2px 2px;
  font-size: 11px;
  color: var(--grist-muted);
  font-style: italic;
}

/* Bloc réduit (runs suivants) : colonnes fixes, alignées d'un bloc à
   l'autre (heure | artiste + passagers | From / To | suivi). */
.frow {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1.35fr) 118px;
  gap: 4px 12px;
  align-items: center;
  padding: 6px 10px;
  margin: 0 0 5px;
  border-radius: 8px;
  border: 1px solid var(--grist-border);
  background: var(--card-bg);
  font-size: 12px;
  cursor: pointer;
}

.frow:hover {
  background: var(--grist-hover);
}

.frow .f-time {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.frow .f-date {
  color: var(--grist-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.frow .f-hour {
  color: var(--grist-text);
  font-size: 21px;
  font-weight: 800;
}

.frow .f-who {
  min-width: 0;
}

.frow .f-who-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.frow .f-veh {
  flex: none;
  font-size: 17px;
}

.frow .f-name {
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frow .f-pax {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--grist-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frow .f-places {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.frow .f-place {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.frow .f-place-ico {
  flex: none;
  font-size: 13px;
  color: var(--grist-muted);
}

.frow .f-place-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frow .f-track {
  min-width: 0;
  justify-self: end;
  font-size: 12px;
}

.frow.past {
  opacity: .45;
}

.frow.cancelled {
  text-decoration: line-through;
  opacity: .4;
}

.frow.late .f-hour {
  color: var(--st-crit);
}

.fcard {
  margin: 3px 0 6px;
  padding: 8px 10px;
}

.fcard .card-top {
  gap: 8px;
}

.fcard .card-time {
  font-size: 26px;
  flex: none;
  white-space: nowrap;
}

.fcard .card-time small {
  font-size: 12px;
}

.fcard .card-remain {
  font-size: 15px;
}

/* From / To à droite de l'heure : icône du type de lieu + nom, une
   ligne chacun, en plus petit pour tenir en longueur. */
.fcard .card-places {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-self: center;
}

.fcard .place-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.fcard .place-ico {
  flex: none;
  font-size: 16px;
  color: var(--grist-muted);
}

.fcard .place-name {
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fcard .card-remain {
  flex: none;
  white-space: nowrap;
}

.place-ico {
  margin-right: 4px;
  color: var(--grist-muted);
}

.fcard .card-who,
.card .card-who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.card .who-pax {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-who .pax-n {
  flex: none;
  font-size: 13px;
  margin-right: 0;
}

.fcard .who-ico {
  flex: none;
  font-size: 24px;
}

.fcard .who-name {
  flex: none;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fcard .who-pax {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--grist-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fcard .card-who {
  font-size: 17px;
  margin-top: 4px;
}

.fcard .card-who .chip {
  font-size: 11px;
  vertical-align: 2px;
  margin-right: 4px;
}

.fcard .card-pax {
  font-size: 14px;
  margin-top: 2px;
}

.fcard .card-route {
  font-size: 14px;
  margin-top: 3px;
}

.fcard .card-line {
  font-size: 12.5px;
  margin-top: 2px;
}

.fcard .card-transport {
  margin-top: 6px;
  padding: 5px 8px;
}

.fcard .card-transport .t-head {
  font-size: 13px;
}

.fcard .card-transport .t-head .t-status {
  font-size: 12px;
}

.fcard .card-transport .t-route,
.fcard .card-transport .t-times {
  font-size: 12px;
  margin-top: 1px;
}

.fcard .card-transport .t-times b {
  font-size: 13px;
}

.fcard .card-transport .t-alert {
  font-size: 11.5px;
}

.fcard .card-live {
  font-size: 12.5px;
  margin-top: 4px;
}

.fcard .prog-wrap {
  margin-top: 6px;
}

.fcard .prog-wrap .prog {
  height: 6px;
}

.fcard .prog-label {
  font-size: 11px;
  margin-top: 2px;
}

.fcard.late {
  border-color: var(--st-crit);
}

.fcard.soon {
  border-color: var(--st-warn);
}

/* Tracking et running order un peu plus grands en portrait. */
body.portrait .tcard {
  padding: 5px 8px;
  margin-bottom: 4px;
}

body.portrait .tcard .t-title {
  font-size: 14px;
}

body.portrait .tcard .t-who {
  font-size: 13px;
}

body.portrait .tcard .t-status {
  font-size: 12px;
}

body.portrait .tcard .t-sub,
body.portrait .tcard .t-alert {
  font-size: 11.5px;
}

body.portrait .order {
  padding: 4px 6px;
}

/* Intertitre de jour (vue de consultation, plusieurs jours). */
.order-day {
  margin: 6px 6px 3px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--grist-muted);
}

.fcard .card-time .card-day {
  display: block;
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--st-warn);
  text-transform: capitalize;
}

.card-transport .t-ico {
  font-size: 15px;
}

body.portrait .order-item {
  grid-template-columns: 50px 1fr auto;
  padding: 3px 6px;
  gap: 6px;
}

body.portrait .order-item .o-time {
  font-size: 14px;
}

body.portrait .order-item .o-label {
  font-size: 14px;
}

body.portrait .order-item .remain {
  font-size: 14px;
}
