/* History timeline below the tile in the viewer (see viewer.js). Uses the
   color tokens the page defines on :root. */
.hist {
  padding-top: 14px;
  color: var(--cream);
  font-family: 'Cormorant Garamond', 'Fraunces', Georgia, serif;
}
.hist[hidden] { display: none; }
.hist-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hist-btn {
  flex: none;
  width: 32px; height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--cream-strong);
  font-size: 16px; line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.hist-btn:hover, .hist-btn:focus-visible {
  border-color: var(--cream-faint);
  background: rgba(228, 212, 166, 0.06);
  outline: none;
}
.hist-slider {
  flex: 1;
  min-width: 60px;
  margin: 0 6px;
  accent-color: #9cae7a;
  cursor: pointer;
}
.hist-count {
  flex: none;
  min-width: 76px;
  text-align: right;
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 14;
  font-size: 13px;
  color: var(--cream-faint);
  letter-spacing: 0.04em;
}
.hist-info {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
  margin-top: 8px;
  font-size: 17px;
  line-height: 1.35;
}
.hist-when { font-style: italic; color: var(--cream-faint); white-space: nowrap; }
/* What happened in the moment's block, on one line (several transactions
   in a block share it; see .hist-pop); an entry opened in full scrolls past
   two lines, the room the viewer leaves for it. */
.hist-entries {
  flex: 1 1 260px;
  min-width: 0;
  margin: 0; padding: 0;
  list-style: none;
  display: flex; flex-direction: column; gap: 2px;
  max-height: calc(2 * 1.5em + 2px);
  overflow-y: auto;
}
.hist-entries.more {
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.hist-line { display: flex; align-items: baseline; gap: 0 14px; min-width: 0; }
/* One line per entry: when it doesn't fit, a long name or status
   (.hist-quote) is cut to an ellipsis first; if that's not enough the
   rest after the first piece gives way (.tight), then the first
   (.tighter); a piece left as little more than an ellipsis is hidden. A
   cut entry opens in full when clicked (.open; see markCut in viewer.js),
   wrapping beside its transaction link. */
.hist-what { display: flex; flex: 0 1 auto; min-width: 0; overflow: hidden; color: var(--cream-strong); }
.hist-what > span {
  flex: 0 0 auto;
  min-width: 0;
  overflow: hidden;
  white-space: pre;
  text-overflow: ellipsis;
}
.hist-what > .hist-quote { flex-shrink: 1; min-width: 4em; }
.tight > .hist-what > span:not(:first-child),
.tighter > .hist-what > span { flex-shrink: 1; }
.hist-what.flow { display: block; white-space: nowrap; text-overflow: ellipsis; }
.hist-what.flow > span { display: inline; white-space: inherit; overflow: visible; }
.cut > .hist-what { cursor: pointer; }
.cut > .hist-what:focus-visible { outline: 1px dotted var(--cream-faint); outline-offset: 2px; }
.open > .hist-what { display: block; flex: 1 1 auto; overflow: visible; }
.open > .hist-what > span, .open > .hist-what.flow > span { display: inline; white-space: pre-wrap; overflow: visible; }
.noop > .hist-what, .hist-what > .hist-noop { color: var(--cream-faint); font-style: italic; }
.hist-tx {
  font-style: italic;
  font-size: 15px;
  color: var(--cream-faint);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  flex: none;
  white-space: nowrap;
}
.hist-tx:hover { color: var(--cream-strong); border-bottom-color: var(--cream); }
button.hist-tx {
  padding: 0;
  background: none;
  border-width: 0 0 1px;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
}
button.hist-tx:focus-visible { outline: 1px dotted var(--cream-faint); outline-offset: 2px; }
/* Each transaction of a block with several, one line each, in a panel that
   opens above the line over the tile. */
.hist-pop {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(100% + 6px);
  z-index: 2;
  margin: 0;
  padding: 8px 12px;
  list-style: none;
  display: flex; flex-direction: column; gap: 4px;
  max-height: min(40vh, 14em);
  overflow-y: auto;
  background: var(--bg-2, #1e2620);
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
.hist-pop[hidden] { display: none; }
.hist-tx[hidden] { display: none; }

@media (max-width: 640px) {
  .hist { padding-top: 10px; }
  .hist-btn { width: 28px; }
  .hist-count { min-width: 58px; font-size: 12px; }
  .hist-info { font-size: 15px; }
}
