/* The pairing tour, part two: the session screen the tour taps into, and the
   fingertip that taps and scrolls. Part one, the frame and home, is tour.css. */

/* -------------------------------------------------------------- session --- */

/* The page header on the page's own ground: back, the session and its
   project, its state. */
.tour-term-head {
  display: grid;
  flex: none;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
  height: calc(var(--status-h) + 30px);
  padding: var(--status-h) 8px 0 3px;
  background: var(--base);
  box-shadow: 0 0.5px 0 var(--hairline);
}

.tour-term-head > svg {
  width: 11px;
  height: 11px;
  justify-self: center;
  color: var(--tint);
}

.tour-term-head b {
  display: block;
  color: var(--label);
  font-size: 9.5px;
  font-weight: 600;
}

.tour-term-head small {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 1px;
  color: var(--label-2);
  font-size: 6.5px;
}

.tour-term-head small svg {
  width: 7px;
  height: 7px;
}

.tour-state {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: var(--r-pill);
  background: var(--fill-2);
  color: var(--label-2);
  font-size: 6.5px;
  font-weight: 600;
}

.tour-state i {
  width: 4px;
  height: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

/* The terminal, pinned to its last line the way a live one is, so the
   history above it is reached by scrolling up. */
.tour-term {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--term-bg);
}

.tour-lines {
  position: absolute;
  right: 0;
  bottom: 3px;
  left: 6px;
  font-family: var(--mono);
  font-size: 6.4px;
  line-height: 1.5;
  translate: 0 var(--scroll, 0px);
  transition: translate var(--scroll-ms, 0ms) var(--ease-out-soft);
}

.tour-lines .line {
  min-height: 1.5em;
  overflow: hidden;
  color: #cccccc;
  white-space: pre;
}

.tour-lines .t-dim {
  color: #767676;
}

.tour-lines .t-err {
  color: #e74856;
}

.tour-lines .t-warn {
  color: #f9f1a5;
}

/* The scrollbar's slider, shown only while the history moves. */
.tour-thumb {
  position: absolute;
  top: 0;
  right: 2px;
  width: 2.5px;
  height: var(--thumb-h, 0px);
  border-radius: 99px;
  background: rgba(235, 235, 245, 0.4);
  opacity: 0;
  translate: 0 var(--thumb-y, 0px);
  transition: opacity 300ms var(--ease-out-soft), translate var(--scroll-ms, 0ms) var(--ease-out-soft);
}

.tour-term[data-scrolling] .tour-thumb {
  opacity: 1;
}

/* "Loading terminal…": the veil the app holds over a session while its
   history is replayed from the desktop. It sits on the terminal, so it is
   drawn in the terminal's dark whatever the theme. */
.tour-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--term-bg);
  color: rgba(235, 235, 245, 0.62);
  font-size: 7px;
  font-weight: 510;
  transition: opacity 260ms var(--ease-out-soft);
}

/* Forced past base.css's [hidden] rule, so the veil fades rather than cuts. */
.tour-veil[hidden] {
  display: flex !important;
  opacity: 0;
}

.tour-veil > span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tour-veil [data-replay] {
  font-size: 6.5px;
  font-variant-numeric: tabular-nums;
}

.tour-spinner {
  width: 8px;
  height: 8px;
  border: 1.2px solid rgba(235, 235, 245, 0.18);
  border-top-color: #2e9bff;
  border-radius: 50%;
  animation: tour-spin 0.8s linear infinite;
}

@keyframes tour-spin {
  to {
    rotate: 1turn;
  }
}

/* ---------------------------------------------------------------- touch --- */

/* A fingertip: where the tour taps and what it drags. */
.tour-touch {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 8;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: rgba(245, 245, 247, 0.28);
  box-shadow: 0 0 0 1px rgba(245, 245, 247, 0.55), 0 4px 14px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  scale: 1.35;
  translate: var(--tx, 0px) var(--ty, 0px);
  transition: opacity 160ms var(--ease-out-soft), scale 160ms var(--ease-out-soft), translate var(--move-ms, 0ms) var(--move-ease, linear);
}

.tour-touch[data-state="down"] {
  opacity: 1;
  scale: 0.9;
}
