/* WaveTrader count history strip (web/history.js). Class prefix hs-.
   Uses only the shell variables from the CONTRACT (--card --line --ink --muted --faint --accent --bad --radius). */

.hs-root {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 12px 14px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 26, 51, .06), 0 8px 24px rgba(16, 26, 51, .06);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hs-root [hidden] {
  display: none !important;
}

/* Previous / label / Next: label on top with the two buttons side by side on a phone,
   one row from 560px wide. */
.hs-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.hs-label {
  grid-column: 1 / -1;
  grid-row: 1;
  margin: 0;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.hs-prev {
  grid-column: 1;
  grid-row: 2;
}

.hs-next {
  grid-column: 2;
  grid-row: 2;
}

.hs-btn {
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.hs-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.hs-btn:disabled {
  color: var(--faint);
  cursor: default;
}

@media (min-width: 560px) {
  .hs-nav {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .hs-label {
    grid-column: 2;
    grid-row: 1;
    text-align: center;
  }
  .hs-prev {
    grid-column: 1;
    grid-row: 1;
  }
  .hs-next {
    grid-column: 3;
    grid-row: 1;
  }
  .hs-btn {
    width: auto;
    min-width: 96px;
  }
}

/* The strip scrolls inside itself, oldest on the left, newest on the right. */
.hs-strip {
  position: relative;
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.hs-chip {
  appearance: none;
  box-sizing: border-box;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 132px;
  min-height: 44px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 26, 51, .05);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.hs-chip:hover {
  border-color: var(--accent);
}

/* Selected count: accent outline, 2px in total. */
.hs-chip.hs-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.hs-chip span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hs-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.hs-pat {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.hs-labels {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.hs-conf {
  font-size: 11px;
  color: var(--muted);
}

.hs-btn:focus-visible,
.hs-chip:focus-visible,
.hs-retry:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hs-cap {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.hs-msgbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.hs-msg-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.hs-root[data-state="error"] .hs-msg-text {
  color: var(--bad);
}

.hs-retry {
  appearance: none;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.hs-retry:hover {
  border-color: var(--accent);
}

.hs-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--bad);
}
