/* Attention simulator specific */
.tokens-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  justify-content: center;
  padding: .8rem 0;
}
.token {
  padding: .45rem 1rem;
  border-radius: 999px;
  background: rgba(0,229,213,0.06);
  border: 1.5px solid rgba(0,229,213,0.18);
  font-family: var(--font-mono);
  font-size: .84rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.token:hover {
  border-color: var(--teal);
  background: rgba(0,229,213,0.12);
  transform: translateY(-2px);
  color: var(--text);
}
.token.selected {
  background: var(--teal);
  color: #030d17;
  border-color: var(--teal);
  box-shadow: 0 0 20px var(--teal-glow);
  transform: translateY(-2px);
  font-weight: 700;
}
.qkv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) {
  .qkv-grid {
    grid-template-columns: 1fr;
  }
}
.qkv-card {
  background: rgba(0,0,0,0.22);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  backdrop-filter: blur(8px);
}
.bar-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: .7rem;
}
.bar-label {
  font-size: .78rem;
  width: 72px;
  flex-shrink: 0;
  color: var(--text-dim);
}
.bar-track {
  flex: 1;
  height: 18px;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal-dim), var(--teal));
  transition: width 0.65s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 0 10px var(--teal-glow);
}
.bar-fill.gold {
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  box-shadow: 0 0 10px var(--gold-glow);
}
.bar-val {
  font-size: .74rem;
  width: 44px;
  text-align: right;
  color: var(--text-dim);
  flex-shrink: 0;
}
.flow-vis {
  position: relative;
  padding: 1.2rem 0;
  min-height: 160px;
}
.flow-tokens-row {
  display: flex;
  justify-content: space-around;
  position: relative;
  z-index: 2;
  min-width: 380px;
  overflow-x: auto;
}
.flow-tok-box {
  padding: .42rem .75rem;
  border-radius: 9px;
  font-size: .77rem;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text-dim);
  font-family: var(--font-mono);
  transition: var(--transition);
}
.flow-tok-box.src {
  border-color: var(--teal);
  background: rgba(0,229,213,0.1);
  color: var(--teal);
  box-shadow: 0 0 14px var(--teal-glow);
  font-weight: 600;
}
#flow-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.heatmap-wrap {
  overflow-x: auto;
  padding-bottom: .5rem;
}
.heatmap-grid {
  display: grid;
  gap: 3px;
  min-width: 480px;
}
.hm-cell {
  height: 38px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-weight: 500;
}
.hm-cell:hover {
  transform: scale(1.08);
  border-color: var(--teal);
  z-index: 2;
  box-shadow: 0 0 12px var(--teal-glow);
}
.hm-cell.row-highlight {
  border-color: rgba(0,229,213,0.5);
  box-shadow: 0 0 8px var(--teal-glow);
}
.embedding-display {
  font-family: var(--font-mono);
  font-size: .85rem;
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  padding: 1rem;
  word-break: break-all;
}
.sim10-controls {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.ctrl-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
}
.ctrl-btn.primary {
  background: var(--teal);
  color: var(--slate);
  border-color: var(--teal);
  box-shadow: 0 0 12px rgba(0,212,200,.35);
}
.ctrl-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.s10-phases {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  padding: .4rem 0 .8rem;
  scrollbar-width: none;
}
.s10-phases::-webkit-scrollbar {
  display: none;
}
.s10-ph {
  padding: .4rem .9rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-dim);
}
.s10-ph.done {
  border-color: rgba(0,212,200,.4);
  color: var(--teal);
}
.s10-ph.active {
  background: var(--teal);
  color: var(--slate);
  border-color: var(--teal);
  box-shadow: 0 0 10px rgba(0,212,200,.3);
}
.s10-canvas {
  background: rgba(0,0,0,.28);
  border-radius: 14px;
  padding: 1.5rem 1.2rem;
  min-height: 240px;
  overflow-x: auto;
}
.s10-explain {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  margin-top: 1.2rem;
  padding: 1rem 1.1rem;
  background: rgba(0,212,200,.07);
  border-radius: 12px;
  border-left: 4px solid var(--teal);
}
.s10-explain-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.s10-explain-text {
  font-size: .87rem;
  line-height: 1.7;
  color: var(--text-dim);
}
.focus-chip {
  background: rgba(0,212,200,.1);
  padding: .3rem .7rem;
  border-radius: 6px;
  font-size: .78rem;
  border: 1px solid var(--border);
  color: var(--teal);
}
.v-box {
  border-radius: 11px;
  border: 1.5px solid rgba(255,255,255,.1);
  background: rgba(15,23,42,.95);
  padding: .6rem .8rem;
  text-align: center;
  transition: all .3s;
}
.v-box.lit {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(0,212,200,.15), 0 4px 16px rgba(0,212,200,.2);
}
.v-box.gold-lit {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(255,209,102,.15);
}
.v-box.pur-lit {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(168,85,247,.15);
}
.v-box.grn-lit {
  border-color: #34d399;
  box-shadow: 0 0 0 2px rgba(52,211,153,.15);
}
.v-lbl {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: .2rem;
}
.v-val {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-dim);
  line-height: 1.4;
}
.v-val.bright {
  color: var(--text);
}
.wsum-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 5px;
}
.wsum-tok {
  font-size: .72rem;
  width: 60px;
  flex-shrink: 0;
  color: var(--text-dim);
}
.wsum-track {
  flex: 1;
  height: 16px;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  overflow: hidden;
}
.wsum-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal-dim), var(--teal));
  transition: width .5s cubic-bezier(.34,1.56,.64,1);
}
.wsum-fill.gold {
  background: linear-gradient(90deg, #d97706, var(--gold));
}
.wsum-val {
  font-family: var(--font-mono);
  font-size: .7rem;
  width: 36px;
  text-align: right;
  color: var(--text-dim);
  flex-shrink: 0;
}
@keyframes outPop {
  from { transform: scale(.85); opacity: 0; }
  60% { transform: scale(1.05); }
  to { transform: scale(1); opacity: 1; }
}
.out-pop {
  animation: outPop .45s ease forwards;
}
.s10-hm {
  display: grid;
  gap: 2px;
}
.s10-hm-cell {
  height: 26px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: .62rem;
  transition: all .3s;
}
.s10-hm-cell.row-active {
  outline: 1.5px solid var(--teal);
}
