/*
 * Journey-times picker. Rides on control_room.css for tokens and panels; this
 * is only the form and the preview grid.
 */

.picker {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}
.picker label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.picker label > span { color: var(--text-muted); }
.picker select,
.picker input[type="date"] {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 7px 9px;
  font-family: var(--font);
  font-size: 13.5px;
  min-width: 130px;
}
.picker select#service { min-width: 320px; }
.picker select:focus-visible,
.picker input:focus-visible,
.picker button:focus-visible {
  outline: 2px solid var(--series-1);
  outline-offset: 2px;
}
.picker label.check { flex-direction: row; align-items: center; gap: 7px; padding-bottom: 8px; }
.picker label.check span { color: var(--text-secondary); font-size: 13px; }
.picker .actions { display: flex; gap: 9px; margin-left: auto; }

.btn-primary,
.btn-quiet {
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--series-1); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-quiet {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--rule);
}
.btn-quiet:hover:not(:disabled) { background: var(--surface-2); }
.btn-quiet:disabled { color: var(--text-muted); cursor: not-allowed; }
button[aria-busy="true"] { opacity: 0.65; cursor: progress; }

/* ---------- preview grid ---------- */

table.jt {
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
table.jt td {
  padding: 3px 7px;
  border-bottom: 1px solid var(--rule-soft);
  white-space: nowrap;
}
/* The three fixed columns -- date, time, measure -- stay put while the 76 stop
   columns scroll, which is the only way this table is readable. */
table.jt td:nth-child(-n + 3) {
  position: sticky;
  background: var(--surface-1);
  z-index: 1;
}
table.jt td:nth-child(1) { left: 0; min-width: 76px; }
table.jt td:nth-child(2) { left: 76px; min-width: 62px; font-family: var(--mono); }
table.jt td:nth-child(3) { left: 138px; min-width: 128px; color: var(--text-secondary); }
table.jt td:nth-child(n + 4) { font-family: var(--mono); text-align: right; color: var(--text-secondary); }

table.jt tr.head td {
  color: var(--text-muted);
  font-size: 11px;
  border-bottom: 1px solid var(--rule);
  vertical-align: bottom;
}
/* Stop names run vertically: 76 of them across is otherwise unreadable. */
table.jt tr.stop-names td:nth-child(n + 4) {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  /* Tall enough for a full NaPTAN name, and clipped rather than allowed to
     overrun -- 76 of these side by side collide otherwise. */
  height: 210px;
  max-height: 210px;
  overflow: hidden;
  padding: 5px 1px;
  font-size: 10px;
  line-height: 1.1;
  text-align: left;
  vertical-align: bottom;
}
table.jt tr.journey-start td { border-top: 1px solid var(--rule); }
table.jt tr[data-measure="Schedule Deviation"] td:nth-child(n + 4) { color: var(--text-primary); }
table.jt td.blank { color: var(--text-muted); }

.result-figures { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; }
.result-figures b { color: var(--text-primary); }

.msg {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 5px;
  font-size: 13px;
  background: var(--surface-1);
  border: 1px solid var(--rule);
  border-left-width: 2px;
}
.msg[data-kind="error"] { border-left-color: var(--status-critical); }
.msg[data-kind="info"] { border-left-color: var(--series-1); }
