.simulator {
  border: 1px solid #555;
  max-width: 1000px;
  padding: 1rem;
  margin: 1.5rem auto;
  font-size: 0.9rem;
}
.simulator h2 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}
.simulator p {
  padding: 0;
  font-size: inherit;
}
.label,
.note {
  color: #aaa;
  font-size: 0.78rem;
  line-height: 1.45;
}
.keys,
.slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.keys {
  margin-bottom: 0.85rem;
}
.simulator button {
  background: transparent;
  border: 1px solid #777;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.25rem 0.6rem;
}
.simulator button:hover {
  border-color: #ffd84d;
  color: #ffd84d;
}
.slot {
  align-items: center;
  background: #111;
  border: 1px solid #555;
  display: flex;
  font-size: 1rem;
  height: 40px;
  justify-content: center;
  width: 40px;
}
.slot.empty {
  border-style: dashed;
  color: gray;
}
.slot.hit {
  background: #263b1b;
  border-color: #98c379;
  color: #b7e28d;
}
.slot.miss {
  background: #483312;
  border-color: #ffd84d;
  color: #ffd84d;
}
.ends {
  color: gray;
  display: flex;
  font-size: 0.7rem;
  justify-content: space-between;
  max-width: 280px;
  margin: 0.2rem 0 0.75rem;
}
.message {
  border-left: 3px solid #ffd84d;
  margin: 0.75rem 0;
  min-height: 2.75rem;
  padding: 0.35rem 0.6rem;
}
.control {
  margin: 0.9rem 0;
}
.control label {
  display: block;
  margin-bottom: 0.3rem;
}
input[type="range"] {
  width: 100%;
  accent-color: #ffd84d;
}
.value {
  color: #ffd84d;
}
.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.result {
  background: #111;
  padding: 0.6rem;
}
.result span {
  display: block;
  color: gray;
  font-size: 0.75rem;
}
.result strong {
  color: #ffd84d;
  font-size: 1.1rem;
}
.bar {
  display: flex;
  height: 18px;
  margin: 0.4rem 0 0.75rem;
  overflow: hidden;
}
.bar div {
  align-items: center;
  display: flex;
  font-size: 0.7rem;
  justify-content: center;
  transition: width 0.15s;
}
.cache-bar {
  background: #263b1b;
  color: #b7e28d;
}
.db-bar {
  background: #483312;
  color: #ffd84d;
}
.response-time {
  margin: 0.9rem 0;
}
.response-time strong {
  color: #ffd84d;
  font-size: 1.25rem;
}
.speedup {
  color: #b7e28d;
  font-size: 0.8rem;
}
.track {
  background: #333;
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
}
.track div {
  background: #ffd84d;
  border-radius: 99px;
  height: 100%;
  transition: width 0.15s;
}
@media (max-width: 500px) {
  .simulator {
    margin: 1rem 20px;
    padding: 0.85rem;
  }

  .results {
    grid-template-columns: 1fr;
  }
}
