.hm-shifts {
  --shift-ink: #23344a;
  --shift-subtle: #52637a;
  --shift-grid: #dde4ec;
  --shift-columns: minmax(0, 1.23fr) minmax(0, 1fr) 54px;
  container: ranked-shifts / inline-size;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  padding: 14px clamp(9px, 2.2vw, 24px) 16px;
  color: var(--shift-ink);
  background: #ffffff;
  font-variant-numeric: tabular-nums;
}
.hm-shifts .hm-shift-key,
.hm-shifts .hm-shift-footer,
.hm-shifts .hm-shift-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hm-shifts .hm-shift-key {
  flex-wrap: wrap;
  padding: 0 4px 15px;
  color: var(--shift-subtle);
  font-size: 12px;
  line-height: 1.4;
}
.hm-shift-key > span { display: inline-flex; align-items: center; gap: 6px; }
.hm-shifts .hm-shift-formula { margin-left: auto; }
.hm-shifts .hm-shift-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 50%; box-sizing: border-box; }
.hm-shifts .hm-shift-swatch.raw { border: 1.6px solid #44536b; }
.hm-shifts .hm-shift-swatch.adjusted { background: #44536b; }
.hm-shifts .hm-shift-head,
.hm-shifts .hm-shift-row {
  display: grid;
  grid-template-columns: var(--shift-columns);
  column-gap: 12px;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0 7px;
}
.hm-shifts .hm-shift-head {
  align-items: end;
  padding-block: 1px 8px;
  color: var(--shift-subtle);
  border-bottom: 1px solid #d4deea;
  font-size: 11px;
  line-height: 1.25;
}
.hm-shifts .hm-shift-scale { text-align: center; }
.hm-shifts .hm-shift-axis,
.hm-shifts .hm-shift-track { position: relative; margin-inline: 9px; }
.hm-shifts .hm-shift-axis { height: 16px; margin-top: 3px; color: #54647a; }
.hm-shifts .hm-shift-axis > span { position: absolute; top: 1px; transform: translateX(-50%); white-space: nowrap; }
.hm-shifts .hm-shift-delta-head,
.hm-shifts .hm-shift-delta { text-align: right; }
.hm-shifts .hm-shift-row {
  --shift-accent: #637387;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid #e5eaf0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: var(--shift-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}
.hm-shifts .hm-shift-row.positive { --shift-accent: #08796d; }
.hm-shifts .hm-shift-row.negative { --shift-accent: #b74c38; }
.hm-shifts .hm-shift-row.reversal { --shift-accent: #966314; }
.hm-shifts .hm-shift-row:hover { background: #f0f4fa; color: #23344a; }
.hm-shifts .hm-shift-row[aria-pressed="true"] { background: #edf2f9; box-shadow: inset 3px 0 var(--shift-accent); }
.hm-shifts button:focus-visible { position: relative; outline: 2px solid #536eac; outline-offset: -2px; z-index: 2; }
.hm-shifts .hm-shift-name { display: flex; align-items: baseline; gap: 7px; padding: 7px 0; overflow-wrap: anywhere; }
.hm-shifts .hm-shift-number { flex: 0 0 1.6em; color: #607086; text-align: right; font-size: 11px; font-weight: 400; }
.hm-shifts .hm-shift-track {
  display: block;
  height: 31px;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), #6b7a97 calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(90deg, var(--shift-grid) 1px, transparent 1px) left center / 25% 100% repeat-x;
  border-right: 1px solid var(--shift-grid);
}
.hm-shifts .hm-shift-connector,
.hm-shifts .hm-shift-point { position: absolute; top: 50%; box-sizing: border-box; }
.hm-shifts .hm-shift-connector {
  left: var(--begin);
  width: var(--extent);
  height: 3px;
  transform: translateY(-50%);
  border-radius: 20px;
  background: var(--shift-accent);
}
.hm-shifts .hm-shift-point { border-radius: 50%; transform: translate(-50%, -50%); }
.hm-shifts .hm-shift-point.raw { left: var(--raw); width: 12px; height: 12px; border: 1.6px solid #44536b; background: #ffffff; }
.hm-shifts .hm-shift-point.adjusted { left: var(--adjusted); width: 7px; height: 7px; background: var(--shift-accent); }
.hm-shifts .hm-shift-delta { color: #33465a; white-space: nowrap; }
.hm-shifts .hm-shift-footer { justify-content: space-between; flex-wrap: wrap; padding: 12px 2px 0; }
.hm-shifts .hm-shift-footer > span { color: var(--shift-subtle); font-size: 11px; }
.hm-shifts .hm-shift-controls { gap: 5px; margin-left: auto; }
.hm-shifts .hm-shift-page-count { margin-right: 5px; color: #515f76; font-size: 12px; }
.hm-shifts .hm-shift-controls button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0 0 2px;
  border: 1px solid #c8d3df;
  border-radius: 6px;
  background: #f6f8fb;
  box-shadow: none;
  color: #36455c;
  font: 20px/1 system-ui, sans-serif;
  cursor: pointer;
}
.hm-shifts .hm-shift-controls button:disabled { opacity: .4; cursor: default; }
.hm-shifts .hm-shift-controls button:enabled:hover { background: #e4ebf4; }
@container ranked-shifts (max-width: 430px) {
  .hm-shifts .hm-shift-key { gap: 6px 10px; padding: 0 3px 10px; }
  .hm-shifts .hm-shift-head,
  .hm-shifts .hm-shift-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding-inline: 6px; }
  .hm-shifts .hm-shift-label-head,
  .hm-shifts .hm-shift-delta-head { display: none; }
  .hm-shifts .hm-shift-scale { grid-column: 1/-1; }
  .hm-shifts .hm-shift-name { grid-area: 1/1; padding: 5px 0 1px; }
  .hm-shifts .hm-shift-delta { grid-area: 1/2; align-self: center; padding: 5px 0 1px; }
  .hm-shifts .hm-shift-track { grid-column: 1/-1; height: 19px; margin-bottom: 4px; }
  .hm-shifts .hm-shift-footer { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-shifts button { transition: none; }
}
